From: Ivailo Monev Date: Sun, 2 Oct 2022 14:47:40 +0000 (+0300) Subject: kdeplasma-addons: deal with TODO related to KSMServer suspend/resume in virus wallaper X-Git-Tag: 4.22.0~108 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ff553621d7bafbf4b11e612b37a88b82458404e3;p=kde%2Fkde-extraapps.git kdeplasma-addons: deal with TODO related to KSMServer suspend/resume in virus wallaper Signed-off-by: Ivailo Monev --- diff --git a/kdeplasma-addons/wallpapers/virus/CMakeLists.txt b/kdeplasma-addons/wallpapers/virus/CMakeLists.txt index 80d59108..7293e863 100644 --- a/kdeplasma-addons/wallpapers/virus/CMakeLists.txt +++ b/kdeplasma-addons/wallpapers/virus/CMakeLists.txt @@ -8,11 +8,24 @@ set(virus_SRCS itemsview.cpp ) -set(ksmserver_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml) -qt4_add_dbus_interface(image_SRCS ${ksmserver_xml} ksmserver_interface) +if(KDE4WORKSPACE_FOUND) + add_definitions(-DHAVE_KWORKSPACE) + set(ksmserver_xml ${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.KSMServerInterface.xml) + qt4_add_dbus_interface(virus_SRCS ${ksmserver_xml} ksmserver_interface) +endif() kde4_add_plugin(plasma_wallpaper_virus ${virus_SRCS}) -target_link_libraries(plasma_wallpaper_virus ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS}) +target_link_libraries(plasma_wallpaper_virus + ${KDE4_PLASMA_LIBS} + ${KDE4_KIO_LIBS} + ${KDE4_KFILE_LIBS} +) -install(TARGETS plasma_wallpaper_virus DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}) -install(FILES plasma-wallpaper-virus.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}) +install( + TARGETS plasma_wallpaper_virus + DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} +) +install( + FILES plasma-wallpaper-virus.desktop + DESTINATION ${KDE4_SERVICES_INSTALL_DIR} +) diff --git a/kdeplasma-addons/wallpapers/virus/virus.cpp b/kdeplasma-addons/wallpapers/virus/virus.cpp index 0eb2a820..17acb520 100644 --- a/kdeplasma-addons/wallpapers/virus/virus.cpp +++ b/kdeplasma-addons/wallpapers/virus/virus.cpp @@ -25,7 +25,10 @@ #include #include "backgroundlistmodel.h" #include "backgrounddelegate.h" -//#include "ksmserver_interface.h" + +#if defined(HAVE_KWORKSPACE) +# include "ksmserver_interface.h" +#endif K_EXPORT_PLASMA_WALLPAPER(virus, Virus) @@ -421,20 +424,22 @@ void Virus::updateBackground(const QImage &img) void Virus::suspendStartup(bool suspend) { - Q_UNUSED(suspend); - //TODO: find out how to compile with that ksmserver - /*if (m_startupResumed) { +#if defined(HAVE_KWORKSPACE) + if (m_startupResumed) { return; } org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus()); - const QString startupID("desktop wallaper"); + const QString startupID("desktop wallpaper"); if (suspend) { ksmserver.suspendStartup(startupID); } else { m_startupResumed = true; ksmserver.resumeStartup(startupID); - }*/ + } +#else + Q_UNUSED(suspend); +#endif // HAVE_KWORKSPACE } void Virus::updateScreenshot(QPersistentModelIndex index)