fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kinit / klauncher_adaptor.cpp
blobe8da3a8bfdac706c48fe975d347f2bb967f89d0d
1 /*
2 * Copyright 2006, 2007 Thiago Macieira <thiago@kde.org>
3 * Copyright 2006-2008 David Faure <faure@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) version 3, or any
9 * later version accepted by the membership of KDE e.V. (or its
10 * successor approved by the membership of KDE e.V.), which shall
11 * act as a proxy defined in Section 6 of version 3 of the license.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
23 #include "klauncher_adaptor.h"
24 #include <QtCore/QArgument>
25 #include <QtCore/QByteRef>
26 #include <QtCore/QList>
27 #include <QtCore/QMap>
28 #include <QtCore/QString>
29 #include <QtCore/QStringList>
30 #include <QtCore/QVariant>
32 #include "klauncher.h"
35 * Implementation of adaptor class KLauncherAdaptor
37 * This file was initially generated by dbusidl2cpp version 0.4,
38 * but then modified by hand.
41 KLauncherAdaptor::KLauncherAdaptor(QObject *parent)
42 : QDBusAbstractAdaptor(parent)
44 // constructor
45 setAutoRelaySignals(true);
48 KLauncherAdaptor::~KLauncherAdaptor()
50 // destructor
53 void KLauncherAdaptor::autoStart(int phase)
55 // handle method call org.kde.KLauncher.autoStart
56 static_cast<KLauncher *>(parent())->autoStart(phase);
59 void KLauncherAdaptor::exec_blind(const QString &name, const QStringList &arg_list)
61 // handle method call org.kde.KLauncher.exec_blind
62 static_cast<KLauncher *>(parent())->exec_blind(name, arg_list);
65 void KLauncherAdaptor::exec_blind(const QString &name, const QStringList &arg_list, const QStringList &envs, const QString &startup_id)
67 // handle method call org.kde.KLauncher.exec_blind
68 static_cast<KLauncher *>(parent())->exec_blind(name, arg_list, envs, startup_id);
71 int KLauncherAdaptor::kdeinit_exec(const QString &app, const QStringList &args, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
73 // handle method call org.kde.KLauncher.kdeinit_exec
74 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, QString(), env, startup_id, false, msg);
75 return 0; // delayed reply
78 int KLauncherAdaptor::kdeinit_exec_wait(const QString &app, const QStringList &args, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
80 // handle method call org.kde.KLauncher.kdeinit_exec_wait
81 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, QString(), env, startup_id, true, msg);
82 return 0; // delayed reply
85 int KLauncherAdaptor::kdeinit_exec_with_workdir(const QString &app, const QStringList &args, const QString& workdir, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
87 // handle method call org.kde.KLauncher.kdeinit_exec_with_workdir
88 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, workdir, env, startup_id, false, msg);
89 return 0; // delayed reply
92 void KLauncherAdaptor::reparseConfiguration()
94 // handle method call org.kde.KLauncher.reparseConfiguration
95 static_cast<KLauncher *>(parent())->reparseConfiguration();
98 int KLauncherAdaptor::requestHoldSlave(const QString &url, const QString &app_socket)
100 // handle method call org.kde.KLauncher.requestHoldSlave
101 return static_cast<KLauncher *>(parent())->requestHoldSlave(KUrl(url), app_socket);
104 int KLauncherAdaptor::requestSlave(const QString &protocol, const QString &host, const QString &app_socket, QString &error)
106 // handle method call org.kde.KLauncher.requestSlave
107 return static_cast<KLauncher *>(parent())->requestSlave(protocol, host, app_socket, error);
110 void KLauncherAdaptor::setLaunchEnv(const QString &name, const QString &value)
112 // handle method call org.kde.KLauncher.setLaunchEnv
113 static_cast<KLauncher *>(parent())->setLaunchEnv(name, value);
116 int KLauncherAdaptor::start_service_by_desktop_name(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
118 // handle method call org.kde.KLauncher.start_service_by_desktop_name
119 KLauncher *p = static_cast<KLauncher *>(parent());
120 p->start_service_by_desktop_name(serviceName, urls, envs, startup_id, blind, msg);
121 dbusServiceName = p->requestResult.dbusName;
122 error = p->requestResult.error;
123 pid = p->requestResult.pid;
124 return p->requestResult.result;
127 int KLauncherAdaptor::start_service_by_desktop_path(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
129 // handle method call org.kde.KLauncher.start_service_by_desktop_path
130 KLauncher *p = static_cast<KLauncher *>(parent());
131 p->start_service_by_desktop_path(serviceName, urls, envs, startup_id, blind, msg);
132 dbusServiceName = p->requestResult.dbusName;
133 error = p->requestResult.error;
134 pid = p->requestResult.pid;
135 return p->requestResult.result;
138 int KLauncherAdaptor::start_service_by_name(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
140 // handle method call org.kde.KLauncher.start_service_by_name
141 KLauncher *p = static_cast<KLauncher *>(parent());
142 p->start_service_by_name(serviceName, urls, envs, startup_id, blind, msg);
143 dbusServiceName = p->requestResult.dbusName;
144 error = p->requestResult.error;
145 pid = p->requestResult.pid;
146 return p->requestResult.result;
149 void KLauncherAdaptor::waitForSlave(int pid, const QDBusMessage &msg)
151 // handle method call org.kde.KLauncher.waitForSlave
152 static_cast<KLauncher *>(parent())->waitForSlave(pid, msg);
155 #include "klauncher_adaptor.moc"