From e3e2b7c6e30073acd54766cba8a744058dfd06c1 Mon Sep 17 00:00:00 2001 From: Olivier CHURLAUD Date: Tue, 12 Jul 2016 21:12:58 +0200 Subject: [PATCH] Register Okular to DBus to get back the "open in new tab" feature. REVIEW: 128424 --- shell/shell.cpp | 5 +++++ shell/shellutils.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shell/shell.cpp b/shell/shell.cpp index 87f90175d..2d7801b6b 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -127,6 +127,11 @@ Shell::Shell( const QString &serializedOptions ) if (!m_unique) KMessageBox::information(this, i18n("There is already a unique Okular instance running. This instance won't be the unique one.")); } + else + { + QString serviceName = QStringLiteral("org.kde.okular-") + QString::number(qApp->applicationPid()); + QDBusConnection::sessionBus().registerService(serviceName); + } if (ShellUtils::noRaise(serializedOptions)) { setAttribute(Qt::WA_ShowWithoutActivating); diff --git a/shell/shellutils.cpp b/shell/shellutils.cpp index 9debb2b91..0e79634f4 100644 --- a/shell/shellutils.cpp +++ b/shell/shellutils.cpp @@ -82,7 +82,7 @@ QString serializeOptions(const QCommandLineParser &args) const bool startInPresentation = args.isSet( QStringLiteral("presentation") ); const bool showPrintDialog = args.isSet( QStringLiteral("print") ); const bool unique = args.isSet(QStringLiteral("unique")) && args.positionalArguments().count() <= 1; - const bool noRaise = !args.isSet(QStringLiteral("raise")); + const bool noRaise = args.isSet(QStringLiteral("noraise")); const QString page = args.value(QStringLiteral("page")); return serializeOptions(startInPresentation, showPrintDialog, unique, noRaise, page);