Author Topic: Tiny sdk fix (patch)  (Read 3270 times)

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Tiny sdk fix (patch)
« on: March 14, 2008, 11:19:22 pm »
Code::Blocks has this nice Project Manager feature that will show you if a file in the project is missing.

There's a "broken file" icon that shows you a file should exist, but doesn't.

  • If you load a project and one of the files is missing, you see the icon.
  • If a project is already loaded and a file you are editing gets deleted, you see the icon.
  • :( If a project is already loaded and a file you are not editing gets deleted, you do not see the icon.

You're told that the file doesn't exist when you double-click the icon, but you still see the "working file" icon.

Here's a one-line fix that simply sets the correct icon after C::B has already determined the file is missing:
Code
Index: sdk/projectmanager.cpp
===================================================================
--- sdk/projectmanager.cpp      (revision 4957)
+++ sdk/projectmanager.cpp      (working copy)
@@ -1419,6 +1419,7 @@
         wxString msg;
         msg.Printf(_("Could not open the file '%s'.\nThe file does not exist."), filename.c_str());
         cbMessageBox(msg, _("Error"));
+        pf->SetFileState(fvsMissing);
         Manager::Get()->GetLogManager()->LogError(msg);
         return;
     }

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Tiny sdk fix (patch)
« Reply #1 on: March 15, 2008, 06:57:50 am »
Applied to trunk. Thanks for the patch. :)
Be a part of the solution, not a part of the problem.