[Kde-pim] dbus and pim 4.6 only on second try
Gerd Fleischer
gerdfleischer at gmx.de
Fri Apr 22 10:42:59 BST 2011
Hi,
I have a little problem with dbus and kdepim 4.6:
I try to call korganizer to open an event via dbus.
Works perfectly with the code below with kdepim 4.4.10 and KDE SC 4.6.
With pim 4.6 - if korganizer is not running already it is started but the event is not opened,
if korganizer is running already (like called via dbus for second time) the event is opened as
supposed?
Also tried Akonadi::ItemId or korganizer uid.
Any hints?
Thanks, Gerd
void KOrganizerAppletUtil::showEvent(const QString &uid)
{
checkAndLaunchKontact();
OrgKdeKorganizerKorganizerInterface interface("org.kde.korganizer",
"/Korganizer",
QDBusConnection::sessionBus());
interface.showIncidence(uid);
KOrganizerAppletUtil::showMainWindow();
}
void KOrganizerAppletUtil::showMainWindow()
{
QDBusInterface kontactInterface("org.kde.korganizer",
"/kontact/MainWindow_1",
"org.kde.KMainWindow",
QDBusConnection::sessionBus());
QDBusReply<long> kontactWinId = kontactInterface.call("winId");
KWindowSystem::forceActiveWindow (kontactWinId, 1);
}
void KOrganizerAppletUtil::checkAndLaunchKontact()
{
if(!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.korganizer"))
{
KToolInvocation::kdeinitExecWait("korganizer");
}
}
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list