summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-07-28 11:11:56 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:04 +0100
commit9a111024c84f7f7cc10cbbd5fc43ee82e48ae79e (patch)
tree688b549594169bfca6b248415286adede8e4f4c5 /src/main.cpp
parentUpdate SearchEngine class to fix it with KDE 4.9 changes (diff)
downloadrekonq-9a111024c84f7f7cc10cbbd5fc43ee82e48ae79e.tar.xz
Class Application Import, first (important) part
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp36
1 files changed, 9 insertions, 27 deletions
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 <KDE/KAboutData>
-#include <KDE/KApplication>
+#include <KDE/KUniqueApplication>
#include <KDE/KCmdLineArgs>
+#include <KDebug>
#include <QDir>
#include <QUrl>
@@ -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);