Hi,
I am trying to retrieve the global keyboard shortcut of a KWin action. I
started doing
this but I am stuck with the error message "QDBusPendingReply: type
QList<KGlobalShortcutInfo> is not registered with QtDBus".
This is the code. Any idea where to look next? I am working under KDE4 with
environment
set for KF5.
```
QDBusConnection bus = QDBusConnection::sessionBus();
org::kde::KGlobalAccel kglobalaccel("org.kde.kglobalaccel",
"/kglobalaccel", bus);
QDBusReply< QList<QDBusObjectPath> > componentsRc =
kglobalaccel.allComponents();
QList<QDBusObjectPath> components = componentsRc;
// debug...
Q_FOREACH(const QDBusObjectPath &componentPath, components) {
qDebug() << componentPath.path();
}
// ...found "/component/kwin"
org::kde::kglobalaccel::Component component(
"org.kde.kglobalaccel", "/component/kwin", bus);
if (!component.isValid()) {
qDebug() << "Component not valid";
Q_ASSERT(false);
}
// Get the shortcut contexts.
QDBusReply<QStringList> shortcutContextsRc =
component.getShortcutContexts();
if (!shortcutContextsRc.isValid()) {
qDebug() << "Failed to get contexts for component ";
Q_ASSERT(false);
}
QStringList shortcutContexts = shortcutContextsRc;
Q_FOREACH (const QString &shortcutContext, shortcutContexts) {
qDebug() << "shortcutContext: " << shortcutContext;
qDebug() << "aaa";
QDBusReply< QList<KGlobalShortcutInfo> > shortcutsRc =
component.allShortcutInfos(shortcutContext);
// ...fails with: QDBusPendingReply: type QList<KGlobalShortcutInfo> is
not
registered with QtDBus
...
...
```
Regards
Gregor
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<