diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 20c30c68..6db6f36c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,9 @@ static const char *description = "A lightweight Web Browser based on Qt WebEngin int main(int argc, char **argv) { + // When loading QtWebEngine from a plugin, set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); + Application app(argc, argv); // Set application data QCoreApplication::setApplicationName(QL1S("rekonq")); @@ -34,13 +37,19 @@ int main(int argc, char **argv) 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)")); - parser.addOptions({options_incognito, options_webapp}); + 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())); |