diff --git a/startkde/ksyncdbusenv/ksyncdbusenv.cpp b/startkde/ksyncdbusenv/ksyncdbusenv.cpp index 8a01e7d..06e54d2 100644 --- a/startkde/ksyncdbusenv/ksyncdbusenv.cpp +++ b/startkde/ksyncdbusenv/ksyncdbusenv.cpp @@ -17,6 +17,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include + #include #include #include @@ -31,6 +33,7 @@ Q_DECLARE_METATYPE(EnvMap) int main(int argc, char **argv) { QCoreApplication app(argc, argv); + qDBusRegisterMetaType(); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); @@ -43,13 +46,12 @@ int main(int argc, char **argv) QStringLiteral("/org/freedesktop/DBus"), QStringLiteral("org.freedesktop.DBus"), QStringLiteral("UpdateActivationEnvironment")); - qDBusRegisterMetaType(); - msg.setArguments(QList({QVariant::fromValue(envMap)})); + msg << QVariant::fromValue(envMap); QDBusPendingCall reply = QDBusConnection::sessionBus().asyncCall(msg); reply.waitForFinished(); if (reply.isError()) { - qDebug() << reply.error().name() << reply.error().message(); + qDebug() << reply.error().name() << reply.error().message(); } - return reply.isError() ? 1 : 0; + return reply.isError() ? EXIT_FAILURE : EXIT_SUCCESS; }