[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdbusaddons] src: Resolve TODO: we can get the startup id from the env var here
From:       David Faure <faure () kde ! org>
Date:       2014-03-31 21:49:16
Message-ID: E1WUk4y-0006fK-UY () scm ! kde ! org
[Download RAW message or body]

Git commit e998c7ebbef0a7143b58123d0991af044b596015 by David Faure.
Committed on 31/03/2014 at 13:57.
Pushed by dfaure into branch 'master'.

Resolve TODO: we can get the startup id from the env var here

Also: call Activate rather than CommandLine, if no args; more standard.

M  +7    -4    src/kdbusservice.cpp

http://commits.kde.org/kdbusaddons/e998c7ebbef0a7143b58123d0991af044b596015

diff --git a/src/kdbusservice.cpp b/src/kdbusservice.cpp
index aada2c6..497c774 100644
--- a/src/kdbusservice.cpp
+++ b/src/kdbusservice.cpp
@@ -104,10 +104,13 @@ KDBusService::KDBusService(StartupOptions options, QObject \
*parent)  QDBusInterface iface(d->serviceName, objectPath);
                 iface.setTimeout(5 * 60 * 1000); // Application can take time to \
answer  QVariantMap platform_data;
-
-                // TODO getter for startup id in qapp (documented to be empty after \
                showing the first window)
-                // platform_data.insert("desktop-startup-id", ?);
-                QDBusReply<int> reply = iface.call(QLatin1String("CommandLine"), \
QCoreApplication::arguments(), platform_data); +                \
platform_data.insert(QStringLiteral("desktop-startup-id"), \
QString::fromUtf8(qgetenv("DESKTOP_STARTUP_ID"))); +                QDBusReply<int> \
reply; +                if (QCoreApplication::arguments().count() > 1) {
+                    reply = iface.call(QLatin1String("CommandLine"), \
QCoreApplication::arguments(), platform_data); +                } else {
+                    reply = iface.call(QLatin1String("Activate"), platform_data);
+                }
                 if (reply.isValid()) {
                     exit(reply.value());
                 } else {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic