Patch #2508 2008-07-02 20:47

olipfei

Wrong name for .o file after renaming .cpp file
Download
2508-Wrong_name_for.patch (491 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2008-07-03 15:34
Assigned to
biplab
Index: sdk/projectfile.cpp
===================================================================
--- sdk/projectfile.cpp    (revision 5106)
+++ sdk/projectfile.cpp    (working copy)
@@ -59,17 +59,17 @@
     relativeFilename.IsEmpty() || relativeFilename.Append(wxFILE_SEP_PATH);
     relativeFilename.Append(new_name);
 
-    UpdateFileDetails();
     if (project)
     {
         project->ProjectFileRenamed(this);
         project->CalculateCommonTopLevelPath();
         project->SetModified(true);
     }
+    UpdateFileDetails();
 }
olipfei 2008-07-02 20:48

Demonstration of misbehaviour with respect to CB's sources: Rename src\app.cpp to src\app_test.cpp via context menu in project tree. When you rebuild immediately, target 'src' will be up to date, even though .objs\src\app_test.o does not exist. If you 'touch' src\app_test.cpp and rebuild, then full command line in 'Build log' will show up '-c src\app_test.cpp', but '-o .objs\src\app.o'! Fixed by changing execution order of ProjectFile::UpdateFileDetails() in ProjectFile::Rename().

biplab 2008-07-03 15:34

Thanks for your patch.