Commit c29d2528 authored by David Edmundson's avatar David Edmundson

[kioslave/desktop] Remove more QDBusInterface

Summary:
No need to introspect the service and then call a method by a hardcooded
name.

Test Plan: Compiles

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D16657
parent c8ed48fc
......@@ -4,7 +4,15 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()
add_library(kio_desktop MODULE kio_desktop.cpp)
set(kio_desktop_SRCS kio_desktop.cpp)
qt5_add_dbus_interface( kio_desktop_SRCS ${KDED_DBUS_INTERFACE} kded_interface )
qt5_generate_dbus_interface( desktopnotifier.h ${CMAKE_CURRENT_BINARY_DIR}/desktopnotifier.xml )
qt5_add_dbus_interface( kio_desktop_SRCS ${CMAKE_CURRENT_BINARY_DIR}/desktopnotifier.xml desktopnotifier_interface )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_library(kio_desktop MODULE ${kio_desktop_SRCS})
target_link_libraries(kio_desktop Qt5::DBus Qt5::Gui KF5::KIOCore KF5::I18n Qt5::Network)
......
......@@ -28,10 +28,12 @@
#include <QCoreApplication>
#include <QFile>
#include <QDBusInterface>
#include <QDir>
#include <QStandardPaths>
#include "kded_interface.h"
#include "desktopnotifier_interface.h"
extern "C"
{
int Q_DECL_EXPORT kdemain(int argc, char **argv)
......@@ -52,8 +54,11 @@ DesktopProtocol::DesktopProtocol(const QByteArray& protocol, const QByteArray &p
{
checkLocalInstall();
QDBusInterface kded(QStringLiteral("org.kde.kded5"), QStringLiteral("/kded"), QStringLiteral("org.kde.kded5"));
kded.call(QStringLiteral("loadModule"), "desktopnotifier");
org::kde::kded5 kded(QStringLiteral("org.kde.kded5"),
QStringLiteral("/kded"),
QDBusConnection::sessionBus());
auto pending = kded.loadModule("desktopnotifier");
pending.waitForFinished();
}
DesktopProtocol::~DesktopProtocol()
......@@ -124,8 +129,8 @@ void DesktopProtocol::listDir(const QUrl &url)
QUrl actual;
rewriteUrl(url, actual);
QDBusInterface kded(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/desktopnotifier"), QStringLiteral("org.kde.DesktopNotifier"));
kded.call(QStringLiteral("watchDir"), actual.path());
org::kde::DesktopNotifier kded(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/desktopnotifier"), QDBusConnection::sessionBus());
kded.watchDir(actual.path());
}
QString DesktopProtocol::desktopFile(KIO::UDSEntry &entry) const
......
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