Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on January 27, 2006, 02:39:47 pm

Title: RecentFilesHistory
Post by: tiwag on January 27, 2006, 02:39:47 pm
how can files opened by

DefaultMimeHandler::DoOpenFile()

added to the RecentFilesHistory - list ?
Title: Re: RecentFilesHistory
Post by: tiwag on January 27, 2006, 02:51:18 pm
Code
Index: D:/Devel/CodeBlocks/trunk/src/src/main.cpp
===================================================================
--- D:/Devel/CodeBlocks/trunk/src/src/main.cpp (revision 1886)
+++ D:/Devel/CodeBlocks/trunk/src/src/main.cpp (working copy)
@@ -1104,7 +1104,9 @@
         default:
         {
             cbMimePlugin* plugin = Manager::Get()->GetPluginManager()->GetMIMEHandlerForFile(filename);
-            return plugin && plugin->OpenFile(filename) == 0;
+            bool res = plugin && plugin->OpenFile(filename) == 0;
+            if (res) AddToRecentFilesHistory(filename);
+            return res;
         }
     }
     return true;

would this work ok in all cases ?