News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Tiny sdk fix (patch)

Started by DrewBoo, March 14, 2008, 11:19:22 PM

Previous topic - Next topic

DrewBoo

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:

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;
     }

Biplab

Applied to trunk. Thanks for the patch. :)
Be a part of the solution, not a part of the problem.