Changeset View
Changeset View
Standalone View
Standalone View
dataengines/applicationjobs/kuiserverengine.cpp
Show All 12 Lines | |||||
13 | * You should have received a copy of the GNU Library General Public | 13 | * You should have received a copy of the GNU Library General Public | ||
14 | * License along with this program; if not, write to the | 14 | * License along with this program; if not, write to the | ||
15 | * Free Software Foundation, Inc., | 15 | * Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "jobviewadaptor.h" | 19 | #include "jobviewadaptor.h" | ||
20 | #include "jobviewserveradaptor.h" | 20 | #include "jobviewserveradaptor.h" | ||
21 | #include "kuiserverinterface.h" | ||||
21 | #include "kuiserverengine.h" | 22 | #include "kuiserverengine.h" | ||
22 | #include "jobcontrol.h" | 23 | #include "jobcontrol.h" | ||
23 | 24 | | |||
24 | #include <QDBusConnection> | 25 | #include <QDBusConnection> | ||
25 | #include <QUrl> | 26 | #include <QUrl> | ||
26 | 27 | | |||
27 | #include <KJob> | 28 | #include <KJob> | ||
28 | #include <KFormat> | 29 | #include <KFormat> | ||
▲ Show 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | 383 | if (jobView) { | |||
383 | return new JobControl(this, jobView); | 384 | return new JobControl(this, jobView); | ||
384 | } else { | 385 | } else { | ||
385 | return DataEngine::serviceForSource(source); | 386 | return DataEngine::serviceForSource(source); | ||
386 | } | 387 | } | ||
387 | } | 388 | } | ||
388 | 389 | | |||
389 | void KuiserverEngine::init() | 390 | void KuiserverEngine::init() | ||
390 | { | 391 | { | ||
391 | // register with the Job UI Serer to receive notifications of jobs becoming available | 392 | // register with the Job UI Server to receive notifications of jobs becoming available | ||
392 | QDBusInterface interface(QStringLiteral("org.kde.kuiserver"), QStringLiteral("/JobViewServer")/* object to connect to */, | 393 | OrgKdeKuiserverInterface ksmserver(QStringLiteral("org.kde.kuiserver"), QStringLiteral("/JobViewServer"), QDBusConnection::sessionBus()); | ||
393 | QLatin1String("")/* use the default interface */, QDBusConnection::sessionBus(), this); | 394 | ksmserver.registerService(QDBusConnection::sessionBus().baseService(), QStringLiteral("/DataEngine/applicationjobs/JobWatcher")); | ||
394 | interface.asyncCall(QLatin1String("registerService"), QDBusConnection::sessionBus().baseService(), "/DataEngine/applicationjobs/JobWatcher"); | | |||
395 | } | 395 | } | ||
396 | 396 | | |||
397 | K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(kuiserver, KuiserverEngine, "plasma-dataengine-applicationjobs.json") | 397 | K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(kuiserver, KuiserverEngine, "plasma-dataengine-applicationjobs.json") | ||
398 | 398 | | |||
399 | #include "kuiserverengine.moc" | 399 | #include "kuiserverengine.moc" |