Patch #1387 2006-08-23 17:54

dermeister

OpenedFilesTree did not get updated properly
Download
1387-OpenedFilesTre.patch (663 bytes)
Category
Application::Bugfix
Status
Closed
Close date
2006-08-23 18:17
Assigned to
 
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp   (revision 2889)
+++ src/sdk/editormanager.cpp   (working copy)
@@ -533,7 +533,15 @@
     }
 #ifdef USE_OPENFILES_TREE
     if(can_updateui)
-        AddFiletoTree(ed);
+    {
+       // If this file is already in the tree we have to call
+       // RefreshOpenedFilesTree because AddFiletoTree would not do anything
+       // and the file would not be selected.
+       if (eb)
+                       RefreshOpenedFilesTree();
+               else
+                       AddFiletoTree(ed);
+    }
 #endif
 
     // we 're done
dermeister 2006-08-23 17:57

If you doubleclick on a file in the project explorer that is already open Code::Blocks selects the correct editor page for this file but does not update the OpenedFilesTree. It still has the previous active file selected. If the file was not open before or you switch the file by clicking the editor tab for it everything worked ok.

This patch solves this issue.

killerbot 2006-08-23 18:17

applied, thanks !!!