summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CHURLAUD <olivier@churlaud.com>2016-07-12 19:12:58 (GMT)
committerOlivier CHURLAUD <olivier@churlaud.com>2016-07-12 19:14:55 (GMT)
commite3e2b7c6e30073acd54766cba8a744058dfd06c1 (patch)
tree65dba9c4cadf1680609495af85fa69450619f59a
parentc8e3c0eb0159fdc0acf34fd5fa1775d40180ffd3 (diff)
Register Okular to DBus to get back the "open in new tab" feature.
REVIEW: 128424
-rw-r--r--shell/shell.cpp5
-rw-r--r--shell/shellutils.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 87f9017..2d7801b 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 9debb2b..0e79634 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);