From 9a111024c84f7f7cc10cbbd5fc43ee82e48ae79e Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 28 Jul 2012 11:11:56 +0200 Subject: Class Application Import, first (important) part --- src/main.cpp | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5c55aa81..c5759d84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,12 +21,14 @@ // version include #include "config-version.h" +#include "application.h" #include "tabwindow.h" #include "urlresolver.h" #include -#include +#include #include +#include #include #include @@ -62,18 +64,18 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) // Register the supported options KCmdLineArgs::addCmdLineOptions(options); -// if (!Application::start()) -// { -// kWarning() << "rekonq is already running!"; -// return 0; -// } + if (!Application::start()) + { + kWarning() << "rekonq is already running!"; + return 0; + } #if defined(Q_WS_X11) // On X11, the raster engine gives better performance than native. QApplication::setGraphicsSystem(QLatin1String("raster")); #endif - KApplication app; + Application app; QWebSettings::setIconDatabasePath("/tmp/iconcache"); @@ -83,26 +85,6 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KCmdLineArgs::setCwd(QDir::currentPath().toUtf8()); - TabWindow *w = new TabWindow; - - // no session.. just start up normally - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - if (args->count() == 0) - { - w->newCleanTab(); - w->show(); - } - else - { - int i = 0; - for (; i < args->count(); i++) - { - w->loadUrlInNewTab( UrlResolver::urlFromTextTyped(args->arg(i)) ); - } - w->show(); - } - args->clear(); - // if (app.isSessionRestored()) // for (int i = 1; MainWindow::canBeRestored(i); i++) // app.newMainWindow(false)->restore(i); -- cgit v1.2.1