Author Topic: RecentFilesHistory  (Read 4689 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
RecentFilesHistory
« on: January 27, 2006, 02:39:47 pm »
how can files opened by

DefaultMimeHandler::DoOpenFile()

added to the RecentFilesHistory - list ?

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: RecentFilesHistory
« Reply #1 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 ?