summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp43
1 files changed, 6 insertions, 37 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6db6f36c..1d6e30da 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -9,13 +9,7 @@
* Description: Application Entry Point
* ============================================================ */
-#include "application.h"
-//#include "sessionmanager.h"
-//#include "rekonqwindow.h"
-//#include "urlresolver.h"
-#include <QCommandLineParser>
-
-static const char *description = "A lightweight Web Browser based on Qt WebEngine";
+#include "application.hpp"
int main(int argc, char **argv)
{
@@ -27,37 +21,12 @@ int main(int argc, char **argv)
QCoreApplication::setApplicationName(QL1S("rekonq"));
QCoreApplication::setApplicationVersion(REKONQ_VERSION);
- // Initialize command line args
- QCommandLineParser parser;
- parser.setApplicationDescription(description);
- parser.addHelpOption();
- parser.addVersionOption();
-
- // Define the command line options
- QCommandLineOption options_incognito("incognito", QCoreApplication::translate("main", "Open in incognito mode"));
- QCommandLineOption options_webapp("webapp",
- QCoreApplication::translate("main", "Open URL as web app (in a simple window)"));
- QCommandLineOption options_plugin({"l", "load"}, QCoreApplication::translate("main", "Add plugin to load path"),
- "path");
- parser.addOptions({options_incognito, options_webapp, options_plugin});
-
- // Define the positional arguments
- parser.addPositionalArgument("URL", QCoreApplication::translate("main", "Location to open"));
-
- parser.process(app);
-
- if (parser.isSet(options_plugin)) {
- for (const auto &plugin : parser.values(options_plugin)) app.registerPlugin(plugin);
- }
-
- const auto positionalArguments = parser.positionalArguments();
- if (parser.isSet(options_webapp))
- positionalArguments.isEmpty() ? app.newWebApp() : app.newWebApp(QUrl::fromUserInput(positionalArguments.first()));
-
- /*if (!Application::start()) {
- kWarning() << "rekonq is already running!";
+ if (app.isSecondary()) {
+ app.sendMessage(Application::arguments().join('\n').toUtf8());
return 0;
- }*/
+ }
+ else
+ app.parseCommandLine(app.instanceId(), {});
/*