Browse Source

Copy unchanged and binary files correctly in fileSave_loadList.

git-svn-id: file:///var/svn/tigccpp/trunk@424 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 years ago
parent
commit
527de82a33
1 changed files with 7 additions and 4 deletions
  1. 7 4
      ktigcc/mainform.ui.h

+ 7 - 4
ktigcc/mainform.ui.h

@@ -836,14 +836,17 @@ void MainForm::fileSave_loadList(QListViewItem *category,void *fileListV,const Q
         relPath=absPath;
       }
       
-      if (IS_EDITABLE_CATEGORY(category)
-          && (theFile->isDirty || theFile->isNew)) {
+      if (tmpPath.path().compare(theFile->fileName)
+          || (IS_EDITABLE_CATEGORY(category)
+              && (theFile->isDirty || theFile->isNew))) {
         tmpPath=*new_dir;
         kurlNewFileName(tmpPath,relPath);
-        theFile->fileName=tmpPath.path();
-        if (saveFileText(tmpPath.path(),theFile->textBuffer))
+        if (IS_EDITABLE_CATEGORY(category)
+            ?saveFileText(tmpPath.path(),theFile->textBuffer)
+            :copyFile(theFile->fileName,tmpPath.path()))
           KMessageBox::error(this,QString("Can't save to \'%1\'").arg(tmpPath.path()));
         else {
+          theFile->fileName=tmpPath.path();
           theFile->isNew=FALSE;
           theFile->isDirty=FALSE;
         }