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);