Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:Test
kdepim4
r893626.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File r893626.diff of Package kdepim4
Subject: kalarm: Copying alarm to KOrganizer fails when embedded in Kontact From: wstephenson@suse.de Bug: kde#176759 Patch-upstream: 893626 --- kalarm/Changelog (revision 893625) +++ kalarm/Changelog (revision 893626) @@ -1,5 +1,9 @@ KAlarm Change Log +=== Version 2.0.7 --- 7 December 2008 === +- Fix failure to update alarms in KOrganizer when Kontact is running. +- Fix toolbar configuration being lost after quitting KAlarm. + === Version 2.0.6 (KDE 4.1.3) --- 22 October 2008 === - Fix alarms not triggering correctly after laptop wakes from hibernation. - Fix inability to change or cancel alarm deferral times. --- kalarm/functions.cpp (revision 893625) +++ kalarm/functions.cpp (revision 893626) @@ -44,6 +44,7 @@ #include <kaction.h> #include <ktoggleaction.h> #include <kactioncollection.h> +#include <kdbusservicestarter.h> #include <kglobal.h> #include <klocale.h> #include <kstandarddirs.h> @@ -76,7 +77,9 @@ const char* KMAIL_DBUS_SERVICE = const char* KMAIL_DBUS_WINDOW_PATH = "/kmail/kmail_mainwindow_1"; const char* KORG_DBUS_SERVICE = "org.kde.korganizer"; const char* KORG_DBUS_IFACE = "org.kde.korganizer.Korganizer"; -const char* KORG_DBUS_PATH = "/Korganizer"; // D-Bus object path of KOrganizer's notification interface +// D-Bus object path of KOrganizer's notification interface +#define KORG_DBUS_PATH "/Korganizer" +#define KORG_DBUS_LOAD_PATH "/korganizer_PimApplication" const char* KORG_DBUS_WINDOW_PATH = "/korganizer/MainWindow_1"; const QString KORGANIZER_UID = QString::fromLatin1("-korg"); @@ -1754,20 +1757,48 @@ bool deleteFromKOrganizer(const QString& } /****************************************************************************** -* Start KOrganizer if not already running, and create its D-Bus interface. +* Start KOrganizer if not already running, and create its D-Bus interface. */ bool runKOrganizer() { - QString dbusService = KORG_DBUS_SERVICE; - if (!KAlarm::runProgram(QLatin1String("korganizer"), dbusService, KORG_DBUS_WINDOW_PATH, korgStartError)) + QString error, dbusService; + int result = KDBusServiceStarter::self()->findServiceFor("DBUS/Organizer", QString(), &error, &dbusService); + if (result) + { + kWarning() << "Unable to start DBUS/Organizer:" << dbusService << error; return false; - if (korgInterface && !korgInterface->isValid()) + } + // If Kontact is running, there is be a load() method which needs to be called + // to load KOrganizer into Kontact. But if KOrganizer is running independently, + // the load() method doesn't exist. + QDBusInterface iface(KORG_DBUS_SERVICE, KORG_DBUS_LOAD_PATH, "org.kde.KUniqueApplication"); + if (!iface.isValid()) { - delete korgInterface; - korgInterface = 0; + kWarning() << "Unable to access "KORG_DBUS_LOAD_PATH" D-Bus interface:" << iface.lastError().message(); + return false; + } + QDBusReply<bool> reply = iface.call("load"); + if ((!reply.isValid() || !reply.value()) + && iface.lastError().type() != QDBusError::UnknownMethod) + { + kWarning() << "Loading KOrganizer failed:" << iface.lastError().message(); + return false; } - if (!korgInterface) + + // KOrganizer has been started, but it may not have the necessary + // D-Bus interface available yet. + if (!korgInterface || !korgInterface->isValid()) + { + delete korgInterface; korgInterface = new QDBusInterface(KORG_DBUS_SERVICE, KORG_DBUS_PATH, KORG_DBUS_IFACE); + if (!korgInterface->isValid()) + { + kWarning() << "Unable to access "KORG_DBUS_PATH" D-Bus interface:" << korgInterface->lastError().message(); + delete korgInterface; + korgInterface = 0; + return false; + } + } return true; } Index: kalarm/Changelog =================================================================== Index: kalarm/functions.cpp ===================================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor