summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Tinkl <lukas@kde.org>2014-09-11 00:47:15 (GMT)
committerLukáš Tinkl <lukas@kde.org>2014-09-11 09:26:16 (GMT)
commit33f6862a94bf224ac465c4e27fb45fba4140b74a (patch)
tree0a27f89aae7d1a8dffbb615221bef6e72471389d
parent83d3f1f6b73a0ab44864d2f786c34f33b4a8d689 (diff)
fix command line parsing and DBUS registration in effect
Okular still doesn't start tho when e.g. clicking on a PDF in Dolphin and fails to open a file from command line (QUrl porting bug)
-rw-r--r--shell/main.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/shell/main.cpp b/shell/main.cpp
index 6313019..821b529 100644
--- a/shell/main.cpp
+++ b/shell/main.cpp
@@ -36,20 +36,22 @@ int main(int argc, char** argv)
app.setApplicationDisplayName(aboutData.applicationData().displayName());
app.setApplicationVersion(aboutData.version());
app.setOrganizationDomain("kde.org");
+
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
- parser.process(app);
- aboutData.processCommandLine(&parser);
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("p") << QLatin1String("page"), i18n("Page of the document to be shown"), QLatin1String("number")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("presentation"), i18n("Start the document in presentation mode")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("print"), i18n("Start with print dialog")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("unique"), i18n("\"Unique instance\" control")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("noraise"), i18n("Not raise window")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[URL]"), i18n("Document to open. Specify '-' to read from stdin.")));
+ parser.addOption(QCommandLineOption(QStringList() << QLatin1String("presentation"), i18n("Start the document in presentation mode")));
+ parser.addOption(QCommandLineOption(QStringList() << QLatin1String("print"), i18n("Start with print dialog")));
+ parser.addOption(QCommandLineOption(QStringList() << QLatin1String("unique"), i18n("\"Unique instance\" control")));
+ parser.addOption(QCommandLineOption(QStringList() << QLatin1String("noraise"), i18n("Not raise window")));
+ parser.addPositionalArgument(QStringLiteral("urls"), i18n("Documents to open. Specify '-' to read from stdin."));
+
+ parser.process(app);
+ aboutData.processCommandLine(&parser);
// see if we are starting with session management
if (app.isSessionRestored())