[Uml-devel] KDE/kdesdk/umbrello/umbrello

Sharan Rao sharanrao at gmail.com
Sun Jul 22 08:48:57 UTC 2007


SVN commit 690782 by sharan:

fix broken "load last file". 


 M  +8 -12     main.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/main.cpp #690781:690782
@@ -26,8 +26,8 @@
 #include "version.h"
 #include "umldoc.h"
 #include "cmdlineexportallviewsevent.h"
+#include "umbrellosettings.h"
 
-
 static const char description[] =
     I18N_NOOP("Umbrello UML Modeller");
 // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
@@ -51,9 +51,8 @@
  * in the configuration.
  *
  * @param args The command line arguments given.
- * @param cfg The application configuration.
  */
-void initDocument(KCmdLineArgs *args, KConfig* cfg);
+void initDocument(KCmdLineArgs *args);
 
 /**
  * Export all the views in the document using the command line args set by the user.
@@ -94,24 +93,22 @@
 
         UMLApp *uml = new UMLApp();
         flushEvents();
-        KConfig * cfg = app.sessionConfig();
 
-       
         if (showGUI) {
             uml->show();
         }
         uml->initGenerator();
 
-        
-        initDocument(args, cfg);
 
+        initDocument(args);
+
         // export option
         QStringList exportOpt = args->getOptionList("export");
         if (exportOpt.size() > 0) {
              exportAllViews(args, exportOpt);
         }
 
-       
+
     }
     return app.exec();
 }
@@ -125,13 +122,12 @@
 }
 
 
-void initDocument(KCmdLineArgs *args, KConfig* cfg) {
+void initDocument(KCmdLineArgs *args) {
     if ( args -> count() ) {
         UMLApp::app()->openDocumentFile( args->url( 0 ) );
     } else {
-        cfg->setGroup( "General Options" );
-        bool last = cfg->readEntry( "loadlast", false );
-        QString file = cfg->readPathEntry( "lastFile" );
+        bool last = UmbrelloSettings::loadlast();
+        QString file = UmbrelloSettings::lastFile();
         if( last && !file.isEmpty() ) {
             UMLApp::app()->openDocumentFile( KUrl( file ) );
         } else {




More information about the umbrello-devel mailing list