File indexing completed on 2024-12-08 03:39:24

0001 /*
0002     SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "kglobalshortcutinfo.h"
0008 #include "kglobalshortcutinfo_p.h"
0009 
0010 KGlobalShortcutInfo::KGlobalShortcutInfo()
0011     : d(new KGlobalShortcutInfoPrivate)
0012 {
0013 }
0014 
0015 KGlobalShortcutInfo::KGlobalShortcutInfo(const KGlobalShortcutInfo &rhs)
0016     : QObject()
0017     , d(new KGlobalShortcutInfoPrivate)
0018 {
0019     d->contextUniqueName = rhs.d->contextUniqueName;
0020     d->contextFriendlyName = rhs.d->contextFriendlyName;
0021     d->componentFriendlyName = rhs.d->componentFriendlyName;
0022     d->componentUniqueName = rhs.d->componentUniqueName;
0023     d->friendlyName = rhs.d->friendlyName;
0024     d->uniqueName = rhs.d->uniqueName;
0025     d->keys = rhs.d->keys;
0026     d->defaultKeys = rhs.d->defaultKeys;
0027 }
0028 
0029 KGlobalShortcutInfo::~KGlobalShortcutInfo()
0030 {
0031     delete d;
0032 }
0033 
0034 KGlobalShortcutInfo &KGlobalShortcutInfo::operator=(const KGlobalShortcutInfo &rhs)
0035 {
0036     KGlobalShortcutInfo tmp(rhs);
0037     KGlobalShortcutInfoPrivate *swap;
0038     swap = d;
0039     d = tmp.d;
0040     tmp.d = swap;
0041     return *this;
0042 }
0043 
0044 QString KGlobalShortcutInfo::contextFriendlyName() const
0045 {
0046     return d->contextFriendlyName.isEmpty() ? d->contextUniqueName : d->contextFriendlyName;
0047 }
0048 
0049 QString KGlobalShortcutInfo::contextUniqueName() const
0050 {
0051     return d->contextUniqueName;
0052 }
0053 
0054 QString KGlobalShortcutInfo::componentFriendlyName() const
0055 {
0056     return d->componentFriendlyName.isEmpty() ? d->componentUniqueName : d->componentFriendlyName;
0057 }
0058 
0059 QString KGlobalShortcutInfo::componentUniqueName() const
0060 {
0061     return d->componentUniqueName;
0062 }
0063 
0064 QList<QKeySequence> KGlobalShortcutInfo::defaultKeys() const
0065 {
0066     return d->defaultKeys;
0067 }
0068 
0069 QString KGlobalShortcutInfo::friendlyName() const
0070 {
0071     return d->friendlyName;
0072 }
0073 
0074 QList<QKeySequence> KGlobalShortcutInfo::keys() const
0075 {
0076     return d->keys;
0077 }
0078 
0079 QString KGlobalShortcutInfo::uniqueName() const
0080 {
0081     return d->uniqueName;
0082 }
0083 
0084 #include "moc_kglobalshortcutinfo.cpp"