Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 0d3ffccb authored by David Edmundson's avatar David Edmundson

Remove expensive blocking call on plasmashell startup

Summary:
QDBusInterface is a blocking call that calls introspect. We don't need
to introspect.

As this is called on startup this call starts kuiserver, which means
plasma is blocked whilst a whole process spawns, this is a lot worse
than just a regular, ~100ms on my system

Also using the generated versions is generally neater to read.

Test Plan:
Restarted plasmashell
Copied a file
Still had a spinny wheel
Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS=0 doesn't list kuiserver

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D15815
parent f307f5e2
......@@ -6,6 +6,7 @@ set(kuiserver_engine_SRCS
jobaction.cpp
)
qt5_add_dbus_interface(kuiserver_engine_SRCS ${CMAKE_SOURCE_DIR}/kuiserver/org.kde.kuiserver.xml kuiserverinterface)
qt5_add_dbus_adaptor(kuiserver_engine_SRCS ${CMAKE_SOURCE_DIR}/kuiserver/org.kde.JobView.xml kuiserverengine.h JobView jobviewadaptor )
qt5_add_dbus_adaptor(kuiserver_engine_SRCS ${KJOBWIDGETS_DBUS_INTERFACES_DIR}/kf5_org.kde.JobViewServer.xml kuiserverengine.h KuiserverEngine jobviewserveradaptor )
......
......@@ -18,6 +18,7 @@
#include "jobviewadaptor.h"
#include "jobviewserveradaptor.h"
#include "kuiserverinterface.h"
#include "kuiserverengine.h"
#include "jobcontrol.h"
......@@ -388,10 +389,9 @@ Plasma::Service* KuiserverEngine::serviceForSource(const QString& source)
void KuiserverEngine::init()
{
// register with the Job UI Serer to receive notifications of jobs becoming available
QDBusInterface interface(QStringLiteral("org.kde.kuiserver"), QStringLiteral("/JobViewServer")/* object to connect to */,
QLatin1String("")/* use the default interface */, QDBusConnection::sessionBus(), this);
interface.asyncCall(QLatin1String("registerService"), QDBusConnection::sessionBus().baseService(), "/DataEngine/applicationjobs/JobWatcher");
// register with the Job UI Server to receive notifications of jobs becoming available
OrgKdeKuiserverInterface ksmserver(QStringLiteral("org.kde.kuiserver"), QStringLiteral("/JobViewServer"), QDBusConnection::sessionBus());
ksmserver.registerService(QDBusConnection::sessionBus().baseService(), QStringLiteral("/DataEngine/applicationjobs/JobWatcher"));
}
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(kuiserver, KuiserverEngine, "plasma-dataengine-applicationjobs.json")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment