KDEUI
kglobalshortcutinfo_dbus.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kglobalshortcutinfo.h"
00020 #include "kglobalshortcutinfo_p.h"
00021
00022
00023
00024 QDBusArgument &operator<< (QDBusArgument &argument, const KGlobalShortcutInfo &shortcut)
00025 {
00026 argument.beginStructure();
00027 argument << shortcut.uniqueName()
00028 << shortcut.friendlyName()
00029 << shortcut.componentUniqueName()
00030 << shortcut.componentFriendlyName()
00031 << shortcut.contextUniqueName()
00032 << shortcut.contextFriendlyName();
00033 argument.beginArray(qMetaTypeId<int>());
00034 Q_FOREACH(const QKeySequence &key, shortcut.keys())
00035 {
00036 argument << key.operator int();
00037 }
00038 argument.endArray();
00039 argument.beginArray(qMetaTypeId<int>());
00040 Q_FOREACH(const QKeySequence &key, shortcut.defaultKeys())
00041 {
00042 argument << key.operator int();
00043 }
00044 argument.endArray();
00045 argument.endStructure();
00046 return argument;
00047 }
00048
00049
00050 const QDBusArgument &operator>> (const QDBusArgument &argument, KGlobalShortcutInfo &shortcut)
00051 {
00052 argument.beginStructure();
00053 argument >> shortcut.d->uniqueName
00054 >> shortcut.d->friendlyName
00055 >> shortcut.d->componentUniqueName
00056 >> shortcut.d->componentFriendlyName
00057 >> shortcut.d->contextUniqueName
00058 >> shortcut.d->contextFriendlyName;
00059 argument.beginArray();
00060 while (!argument.atEnd())
00061 {
00062 int key;
00063 argument >> key;
00064 shortcut.d->keys.append(QKeySequence(key));
00065 }
00066 argument.endArray();
00067 argument.beginArray();
00068 while (!argument.atEnd())
00069 {
00070 int key;
00071 argument >> key;
00072 shortcut.d->defaultKeys.append(QKeySequence(key));
00073 }
00074 argument.endArray();
00075 argument.endStructure();
00076 return argument;
00077 }
00078