]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
Make use of the error messages coming from the places model.
[dolphin.git] / src / main.cpp
index eacff0cba5f97262b4039bf0be7bc9d7fbe1a95c..98a6a87f1fd437be497437b4efc59b129831c4e7 100644 (file)
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "dolphin.h"
-#include <kapplication.h>
+#include "dolphinapplication.h"
+
 #include <kaboutdata.h>
 #include <kcmdlineargs.h>
 #include <klocale.h>
-#include <krun.h>
 
 static KCmdLineOptions options[] =
-{
-    { "+[Url]", I18N_NOOP( "Document to open" ), 0 },
-    KCmdLineLastOption
-};
+    {
+        { "+[Url]", I18N_NOOP("Document to open"), 0
+        },
+        KCmdLineLastOption
+    };
 
 int main(int argc, char **argv)
 {
     KAboutData about("dolphin",
                      I18N_NOOP("Dolphin"),
-                     "0.8.0",
+                     "0.9.0",
                      I18N_NOOP("File Manager"),
                      KAboutData::License_GPL,
                      "(C) 2006 Peter Penz");
@@ -54,28 +54,22 @@ int main(int argc, char **argv)
     KCmdLineArgs::init(argc, argv, &about);
     KCmdLineArgs::addCmdLineOptions(options);
 
-    KApplication app;
-
-    Dolphin& mainWin = Dolphin::mainWin();
-    mainWin.show();
+    if (!DolphinApplication::start()) {
+        return 0;
+    }
 
+    DolphinApplication app;
+#ifdef __GNUC__
+#warning TODO, SessionManagement
+#endif
+#if 0
     if (false /* KDE4-TODO: app.isSessionRestored() */) {
         int n = 1;
-        while (KMainWindow::canBeRestored(n)){
+        while (KMainWindow::canBeRestored(n)) {
             Dolphin::mainWin().restore(n);
             ++n;
         }
     } else {
-        KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
-        if (args->count() > 0) {
-            mainWin.activeView()->setUrl(args->url(0));
-
-            for (int i = 1; i < args->count(); ++i) {
-                KRun::run("dolphin", args->url(i));
-            }
-        }
-        args->clear();
+#endif
+        return app.exec();
     }
-
-    return app.exec();
-}