kdeui: format and indent

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-27 07:08:35 +03:00
parent 97b1ea46c1
commit 2bf47096e8
10 changed files with 316 additions and 315 deletions

View file

@ -75,12 +75,18 @@ ShortcutEditWidget::ShortcutEditWidget(QWidget *viewport, const QKeySequence &de
setKeySequence(activeSeq);
connect(m_defaultRadio, SIGNAL(toggled(bool)),
this, SLOT(defaultToggled(bool)));
connect(m_customEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(setCustom(QKeySequence)));
connect(m_customEditor, SIGNAL(stealShortcut(QKeySequence,KAction*)),
this, SIGNAL(stealShortcut(QKeySequence,KAction*)));
connect(
m_defaultRadio, SIGNAL(toggled(bool)),
this, SLOT(defaultToggled(bool))
);
connect(
m_customEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(setCustom(QKeySequence))
);
connect(
m_customEditor, SIGNAL(stealShortcut(QKeySequence,KAction*)),
this, SIGNAL(stealShortcut(QKeySequence,KAction*))
);
}
@ -92,8 +98,9 @@ KKeySequenceWidget::ShortcutTypes ShortcutEditWidget::checkForConflictsAgainst()
//slot
void ShortcutEditWidget::defaultToggled(bool checked)
{
if (m_isUpdating)
if (m_isUpdating) {
return;
}
m_isUpdating = true;
if (checked) {
@ -116,8 +123,7 @@ void ShortcutEditWidget::defaultToggled(bool checked)
}
void ShortcutEditWidget::setCheckActionCollections(
const QList<KActionCollection*> checkActionCollections)
void ShortcutEditWidget::setCheckActionCollections(const QList<KActionCollection*> &checkActionCollections)
{
// We just forward them to out KKeySequenceWidget.
m_customEditor->setCheckActionCollections(checkActionCollections);
@ -130,7 +136,7 @@ void ShortcutEditWidget::setCheckForConflictsAgainst(KKeySequenceWidget::Shortcu
}
void ShortcutEditWidget::setComponentName(const QString componentName)
void ShortcutEditWidget::setComponentName(const QString &componentName)
{
m_customEditor->setComponentName(componentName);
}
@ -169,7 +175,6 @@ void ShortcutEditWidget::setCustom(const QKeySequence &seq)
m_isUpdating = false;
}
void ShortcutEditWidget::setKeySequence(const QKeySequence &activeSeq)
{
if (activeSeq == m_defaultLabel->text()) {
@ -184,4 +189,3 @@ void ShortcutEditWidget::setKeySequence(const QKeySequence &activeSeq)
}
}
}

View file

@ -95,23 +95,26 @@ KShortcutSchemesEditor::KShortcutSchemesEditor(KShortcutsDialog *parent)
void KShortcutSchemesEditor::newScheme()
{
bool ok;
const QString newName = KInputDialog::getText(i18n("Name for New Scheme"),
i18n("Name for new scheme:"), i18n("New Scheme"), &ok,this);
if (!ok )
bool ok = false;
const QString newName = KInputDialog::getText(
i18n("Name for New Scheme"),
i18n("Name for new scheme:"), i18n("New Scheme"),
&ok, this
);
if (!ok) {
return;
}
if (m_schemesList->findText(newName) != -1)
{
if (m_schemesList->findText(newName) != -1) {
KMessageBox::sorry(this, i18n("A scheme with this name already exists."));
return;
}
const QString newSchemeFileName = KShortcutSchemesHelper::applicationShortcutSchemeFileName(newName);
QFile schemeFile(newSchemeFileName);
if (!schemeFile.open(QFile::WriteOnly | QFile::Truncate))
if (!schemeFile.open(QFile::WriteOnly | QFile::Truncate)) {
return;
}
QDomDocument doc;
QDomElement docElem = doc.createElement("kpartgui");
@ -142,8 +145,9 @@ Note that this will not remove any system wide shortcut schemes.", currentScheme
foreach (KActionCollection *collection, m_dialog->actionCollections())
{
const KXMLGUIClient *client = collection->parentGUIClient();
if (!client)
if (!client) {
continue;
}
QFile::remove(KShortcutSchemesHelper::shortcutSchemeFileName(client, currentScheme()));
}
@ -161,15 +165,16 @@ void KShortcutSchemesEditor::exportShortcutsScheme()
{
// ask user about dir, it is not possible to use KFileDialog here because kfile links against
// kdeui. the dialog gets replaced anyway with the KDE one at runtime
QString exportTo = QFileDialog::getExistingDirectory(this, i18n("Export to Location"),
QDir::currentPath());
QString exportTo = QFileDialog::getExistingDirectory(
this, i18n("Export to Location"),
QDir::currentPath()
);
if (exportTo.isEmpty())
return;
QDir schemeRoot(exportTo);
if (!schemeRoot.exists(exportTo))
{
if (!schemeRoot.exists(exportTo)) {
KMessageBox::error(this, i18n("Could not export shortcuts scheme because the location is invalid."));
return;
}
@ -177,17 +182,19 @@ void KShortcutSchemesEditor::exportShortcutsScheme()
foreach (KActionCollection *collection, m_dialog->actionCollections())
{
const KXMLGUIClient *client = collection->parentGUIClient();
if (!client) continue;
KShortcutSchemesHelper::exportActionCollection(collection,
currentScheme(), exportTo + '/');
if (!client) {
continue;
}
KShortcutSchemesHelper::exportActionCollection(collection, currentScheme(), exportTo + '/');
}
}
void KShortcutSchemesEditor::saveAsDefaultsForScheme()
{
foreach (KActionCollection *collection, m_dialog->actionCollections())
foreach (KActionCollection *collection, m_dialog->actionCollections()) {
KShortcutSchemesHelper::exportActionCollection(collection, currentScheme());
}
}
void KShortcutSchemesEditor::updateDeleteButton()

View file

@ -55,8 +55,10 @@ class KShortcutsDialog::KShortcutsDialogPrivate
{
public:
KShortcutsDialogPrivate(KShortcutsDialog *q): q(q), m_keyChooser(0), m_schemeEditor(0)
{}
KShortcutsDialogPrivate(KShortcutsDialog *q)
: q(q), m_keyChooser(0), m_schemeEditor(0)
{
}
QList<KActionCollection*> m_collections;
@ -128,8 +130,10 @@ KShortcutsDialog::KShortcutsDialog( KShortcutsEditor::ActionTypes types, KShortc
setButtonText(Reset,i18n("Reset to Defaults"));
d->m_schemeEditor = new KShortcutSchemesEditor(this);
connect( d->m_schemeEditor, SIGNAL(shortcutsSchemeChanged(QString)),
this, SLOT(changeShortcutScheme(QString)) );
connect(
d->m_schemeEditor, SIGNAL(shortcutsSchemeChanged(QString)),
this, SLOT(changeShortcutScheme(QString))
);
setDetailsWidget(d->m_schemeEditor);
connect(this, SIGNAL(resetClicked()), d->m_keyChooser, SLOT(allDefault()));
@ -155,7 +159,6 @@ void KShortcutsDialog::addCollection(KActionCollection *collection, const QStrin
d->m_collections << collection;
}
QList<KActionCollection*> KShortcutsDialog::actionCollections() const
{
return d->m_collections;
@ -193,5 +196,3 @@ int KShortcutsDialog::configure(KActionCollection *collection, KShortcutsEditor:
#include "moc_kshortcutsdialog.cpp"
#include "moc_kshortcutsdialog_p.cpp"
//kate: space-indent on; indent-width 4; replace-tabs on;tab-width 4;

View file

@ -69,7 +69,6 @@
class KDEUI_EXPORT KShortcutsDialog : public KDialog
{
Q_OBJECT
public:
/**
* Constructs a KShortcutsDialog as a child of @p parent.
@ -143,5 +142,3 @@ private:
};
#endif // KSHORTCUTSDIALOG_H
//kate: space-indent off; indent-width 4; replace-tabs off;tab-width 4;

View file

@ -163,7 +163,7 @@ public:
bool allowLetterShortcuts);
//! @see KKeySequenceWidget::setCheckActionCollections()
void setCheckActionCollections( const QList<KActionCollection*> checkActionCollections);
void setCheckActionCollections(const QList<KActionCollection*> &checkActionCollections);
//@{
@ -179,7 +179,7 @@ public:
//@}
//! @see KKeySequenceWidget::setComponentName
void setComponentName(const QString componentName);
void setComponentName(const QString &componentName);
public Q_SLOTS:
@ -380,9 +380,6 @@ public:
};
Q_DECLARE_METATYPE(KShortcutsEditorItem*)
#endif /* KSHORTCUTSDIALOG_P_H */
//kate: space-indent on; indent-width 4; replace-tabs on;tab-width 4;

View file

@ -56,28 +56,25 @@
KShortcutsEditor::KShortcutsEditor(KActionCollection *collection, QWidget *parent, ActionTypes actionType,
LetterShortcuts allowLetterShortcuts )
: QWidget( parent )
, d(new KShortcutsEditorPrivate(this))
: QWidget(parent),
d(new KShortcutsEditorPrivate(this))
{
d->initGUI(actionType, allowLetterShortcuts);
addCollection(collection);
}
KShortcutsEditor::KShortcutsEditor(QWidget *parent, ActionTypes actionType, LetterShortcuts allowLetterShortcuts)
: QWidget(parent)
, d(new KShortcutsEditorPrivate(this))
: QWidget(parent),
d(new KShortcutsEditorPrivate(this))
{
d->initGUI(actionType, allowLetterShortcuts);
}
KShortcutsEditor::~KShortcutsEditor()
{
delete d;
}
bool KShortcutsEditor::isModified() const
{
// Iterate over all items
@ -167,23 +164,16 @@ void KShortcutsEditor::addCollection(KActionCollection *collection, const QStrin
QTimer::singleShot(0, this, SLOT(resizeColumns()));
}
void KShortcutsEditor::clearConfiguration()
{
d->clearConfiguration();
}
void KShortcutsEditor::importConfiguration(KConfigBase *config)
{
d->importConfiguration(config);
}
void KShortcutsEditor::exportConfiguration(KConfigBase *config) const
{
Q_ASSERT(config);
@ -205,7 +195,6 @@ void KShortcutsEditor::exportConfiguration( KConfigBase *config) const
}
}
void KShortcutsEditor::writeConfiguration(KConfigGroup *config) const
{
foreach (KActionCollection* collection, d->actionCollections)
@ -230,7 +219,6 @@ void KShortcutsEditor::commit()
}
}
void KShortcutsEditor::save()
{
writeConfiguration();
@ -241,7 +229,6 @@ void KShortcutsEditor::save()
commit();
}
// KDE5 : rename to undo()
void KShortcutsEditor::undoChanges()
{
@ -264,13 +251,11 @@ void KShortcutsEditor::allDefault()
d->allDefault();
}
void KShortcutsEditor::printShortcuts() const
{
d->printShortcuts();
}
//---------------------------------------------------------------------
// KShortcutsEditorPrivate
//---------------------------------------------------------------------
@ -278,9 +263,11 @@ void KShortcutsEditor::printShortcuts() const
KShortcutsEditorPrivate::KShortcutsEditorPrivate(KShortcutsEditor *q)
: q(q),
delegate(0)
{}
{
}
void KShortcutsEditorPrivate::initGUI( KShortcutsEditor::ActionTypes types, KShortcutsEditor::LetterShortcuts allowLetterShortcuts )
void KShortcutsEditorPrivate::initGUI(KShortcutsEditor::ActionTypes types,
KShortcutsEditor::LetterShortcuts allowLetterShortcuts)
{
actionTypes = types;
@ -300,7 +287,8 @@ void KShortcutsEditorPrivate::initGUI( KShortcutsEditor::ActionTypes types, KSho
// really change the shortcuts.
delegate = new KShortcutsEditorDelegate(
ui.list,
allowLetterShortcuts == KShortcutsEditor::LetterShortcutsAllowed);
allowLetterShortcuts == KShortcutsEditor::LetterShortcutsAllowed
);
ui.list->setItemDelegate(delegate);
ui.list->setSelectionBehavior(QAbstractItemView::SelectItems);
@ -310,16 +298,19 @@ void KShortcutsEditorPrivate::initGUI( KShortcutsEditor::ActionTypes types, KSho
ui.list->setAlternatingRowColors(true);
//TODO listen to changes to global shortcuts
QObject::connect(delegate, SIGNAL(shortcutChanged(QVariant,QModelIndex)),
q, SLOT(capturedShortcut(QVariant,QModelIndex)));
QObject::connect(
delegate, SIGNAL(shortcutChanged(QVariant,QModelIndex)),
q, SLOT(capturedShortcut(QVariant,QModelIndex))
);
//hide the editor widget chen its item becomes hidden
QObject::connect(ui.searchFilter->searchLine(), SIGNAL(hiddenChanged(QTreeWidgetItem*,bool)),
delegate, SLOT(hiddenBySearchLine(QTreeWidgetItem*,bool)));
QObject::connect(
ui.searchFilter->searchLine(), SIGNAL(hiddenChanged(QTreeWidgetItem*,bool)),
delegate, SLOT(hiddenBySearchLine(QTreeWidgetItem*,bool))
);
ui.searchFilter->setFocus();
}
bool KShortcutsEditorPrivate::addAction(QAction *action, QTreeWidgetItem *hier[], hierarchyLevel level)
{
// If the action name starts with unnamed- spit out a warning and ignore
@ -345,8 +336,9 @@ bool KShortcutsEditorPrivate::addAction(QAction *action, QTreeWidgetItem *hier[]
void KShortcutsEditorPrivate::allDefault()
{
for (QTreeWidgetItemIterator it(ui.list); (*it); ++it) {
if (!(*it)->parent() || (*it)->type() != ActionItem)
if (!(*it)->parent() || (*it)->type() != ActionItem) {
continue;
}
KShortcutsEditorItem *item = static_cast<KShortcutsEditorItem *>(*it);
KAction *act = item->m_action;
@ -379,9 +371,10 @@ QTreeWidgetItem *KShortcutsEditorPrivate::findOrMakeItem(QTreeWidgetItem *parent
{
for (int i = 0; i < parent->childCount(); i++) {
QTreeWidgetItem *child = parent->child(i);
if (child->text(0) == name)
if (child->text(0) == name) {
return child;
}
}
QTreeWidgetItem *ret = new QTreeWidgetItem(parent, NonActionItem);
ret->setText(0, name);
ui.list->expandItem(ret);
@ -394,15 +387,17 @@ QTreeWidgetItem *KShortcutsEditorPrivate::findOrMakeItem(QTreeWidgetItem *parent
void KShortcutsEditorPrivate::capturedShortcut(const QVariant &newShortcut, const QModelIndex &index)
{
//dispatch to the right handler
if (!index.isValid())
if (!index.isValid()) {
return;
}
int column = index.column();
KShortcutsEditorItem *item = itemFromIndex(ui.list, index);
Q_ASSERT(item);
if (column >= LocalPrimary && column <= GlobalAlternate)
if (column >= LocalPrimary && column <= GlobalAlternate) {
changeKeyShortcut(item, column, newShortcut.value<QKeySequence>());
}
}
void KShortcutsEditorPrivate::changeKeyShortcut(KShortcutsEditorItem *item, uint column, const QKeySequence &capture)
@ -422,8 +417,9 @@ void KShortcutsEditorPrivate::changeKeyShortcut(KShortcutsEditorItem *item, uint
void KShortcutsEditorPrivate::clearConfiguration()
{
for (QTreeWidgetItemIterator it(ui.list); (*it); ++it) {
if (!(*it)->parent())
if (!(*it)->parent()) {
continue;
}
KShortcutsEditorItem *item = static_cast<KShortcutsEditorItem *>(*it);
@ -445,12 +441,11 @@ void KShortcutsEditorPrivate::importConfiguration(KConfigBase *config)
if ((actionTypes & KShortcutsEditor::GlobalAction) && globalShortcutsGroup.exists()) {
for (QTreeWidgetItemIterator it(ui.list); (*it); ++it) {
if (!(*it)->parent())
if (!(*it)->parent()) {
continue;
}
KShortcutsEditorItem *item = static_cast<KShortcutsEditorItem *>(*it);
QString actionName = item->data(Id).toString();
KShortcut sc(globalShortcutsGroup.readEntry(actionName, QString()));
changeKeyShortcut(item, GlobalPrimary, sc.primary());
@ -459,14 +454,12 @@ void KShortcutsEditorPrivate::importConfiguration(KConfigBase *config)
KConfigGroup localShortcutsGroup(config, QLatin1String("Shortcuts"));
if (actionTypes & ~KShortcutsEditor::GlobalAction) {
for (QTreeWidgetItemIterator it(ui.list); (*it); ++it) {
if (!(*it)->parent())
if (!(*it)->parent()) {
continue;
}
KShortcutsEditorItem *item = static_cast<KShortcutsEditorItem *>(*it);
QString actionName = item->data(Name).toString();
KShortcut sc(localShortcutsGroup.readEntry(actionName, QString()));
changeKeyShortcut(item, LocalPrimary, sc.primary());
@ -504,9 +497,13 @@ void KShortcutsEditorPrivate::printShortcuts() const
QTextCharFormat headerFormat;
headerFormat.setProperty(QTextFormat::FontSizeAdjustment, 3);
headerFormat.setFontWeight(QFont::Bold);
cursor.insertText(i18nc("header for an applications shortcut list","Shortcuts for %1",
KGlobal::mainComponent().aboutData()->programName()),
headerFormat);
cursor.insertText(
i18nc(
"header for an applications shortcut list","Shortcuts for %1",
KGlobal::mainComponent().aboutData()->programName()
),
headerFormat
);
QTextCharFormat componentFormat;
componentFormat.setProperty(QTextFormat::FontSizeAdjustment, 2);
componentFormat.setFontWeight(QFont::Bold);
@ -551,8 +548,9 @@ void KShortcutsEditorPrivate::printShortcuts() const
currow++;
for (QTreeWidgetItemIterator it(item); *it; ++it) {
if ((*it)->type() != ActionItem)
if ((*it)->type() != ActionItem) {
continue;
}
KShortcutsEditorItem* editoritem = static_cast<KShortcutsEditorItem*>(*it);
table->insertRows(table->rows(),1);

View file

@ -61,7 +61,6 @@ class KShortcutsEditorPrivate;
class KDEUI_EXPORT KShortcutsEditor : public QWidget
{
Q_OBJECT
public:
enum ActionType {
/// Actions which are triggered by any keypress in a widget which has the action added to it
@ -96,7 +95,9 @@ public:
* @param allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric
* keys ('A', '1', etc.) are not permissible shortcuts.
*/
KShortcutsEditor(KActionCollection *collection, QWidget *parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
KShortcutsEditor(KActionCollection *collection, QWidget *parent,
ActionTypes actionTypes = AllActions,
LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
/**
* \overload
@ -108,7 +109,8 @@ public:
* @param allowLetterShortcuts set to LetterShortcutsDisallowed if unmodified alphanumeric
* keys ('A', '1', etc.) are not permissible shortcuts.
*/
explicit KShortcutsEditor( QWidget* parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed );
explicit KShortcutsEditor(QWidget* parent, ActionTypes actionTypes = AllActions,
LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
/// Destructor
virtual ~KShortcutsEditor();
@ -155,7 +157,6 @@ public:
*/
void commit();
/**
* Removes all configured shortcuts.
*/

View file

@ -35,11 +35,11 @@
#include <QtGui/qtreewidget.h>
KShortcutsEditorItem::KShortcutsEditorItem(QTreeWidgetItem *parent, KAction *action)
: QTreeWidgetItem(parent, ActionItem)
, m_action(action)
, m_isNameBold(false)
, m_oldLocalShortcut(0)
, m_oldGlobalShortcut(0)
: QTreeWidgetItem(parent, ActionItem),
m_action(action),
m_isNameBold(false),
m_oldLocalShortcut(0),
m_oldGlobalShortcut(0)
{
// Filtering message requested by translators (scripting).
m_id = m_action->objectName();
@ -234,19 +234,21 @@ bool KShortcutsEditorItem::isModified(uint column) const
return false;
case LocalPrimary:
case LocalAlternate:
if (!m_oldLocalShortcut)
if (!m_oldLocalShortcut) {
return false;
if (column == LocalPrimary)
}
if (column == LocalPrimary) {
return m_oldLocalShortcut->primary() != m_action->shortcut().primary();
else
}
return m_oldLocalShortcut->alternate() != m_action->shortcut().alternate();
case GlobalPrimary:
case GlobalAlternate:
if (!m_oldGlobalShortcut)
if (!m_oldGlobalShortcut) {
return false;
if (column == GlobalPrimary)
}
if (column == GlobalPrimary) {
return m_oldGlobalShortcut->primary() != m_action->globalShortcut().primary();
else
}
return m_oldGlobalShortcut->alternate() != m_action->globalShortcut().alternate();
default:
return false;
@ -268,8 +270,7 @@ void KShortcutsEditorItem::undo()
}
if (m_oldGlobalShortcut) {
m_action->setGlobalShortcut(*m_oldGlobalShortcut, KAction::ActiveShortcut,
KAction::NoAutoloading);
m_action->setGlobalShortcut(*m_oldGlobalShortcut, KAction::ActiveShortcut, KAction::NoAutoloading);
}
updateModified();

View file

@ -53,14 +53,14 @@ const QDBusArgument &operator>> (const QDBusArgument &argument, KGlobalShortcutI
>> shortcut.d->contextFriendlyName;
argument.beginArray();
while (!argument.atEnd()) {
int key;
int key = 0;
argument >> key;
shortcut.d->keys.append(QKeySequence(key));
}
argument.endArray();
argument.beginArray();
while (!argument.atEnd()) {
int key;
int key = 0;
argument >> key;
shortcut.d->defaultKeys.append(QKeySequence(key));
}

View file

@ -44,10 +44,14 @@ KShortcutWidget::KShortcutWidget(QWidget *parent)
{
d->holdChangedSignal = false;
d->ui.setupUi(this);
connect(d->ui.priEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(priKeySequenceChanged(QKeySequence)));
connect(d->ui.altEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(altKeySequenceChanged(QKeySequence)));
connect(
d->ui.priEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(priKeySequenceChanged(QKeySequence))
);
connect(
d->ui.altEditor, SIGNAL(keySequenceChanged(QKeySequence)),
this, SLOT(altKeySequenceChanged(QKeySequence))
);
}
@ -56,7 +60,6 @@ KShortcutWidget::~KShortcutWidget()
delete d;
}
void KShortcutWidget::setModifierlessAllowed(bool allow)
{
d->ui.priEditor->setModifierlessAllowed(allow);
@ -69,14 +72,12 @@ bool KShortcutWidget::isModifierlessAllowed()
return d->ui.priEditor->isModifierlessAllowed();
}
void KShortcutWidget::setClearButtonsShown(bool show)
{
d->ui.priEditor->setClearButtonShown(show);
d->ui.altEditor->setClearButtonShown(show);
}
KShortcut KShortcutWidget::shortcut() const
{
KShortcut ret;
@ -85,26 +86,23 @@ KShortcut KShortcutWidget::shortcut() const
return ret;
}
void KShortcutWidget::setCheckActionCollections(const QList<KActionCollection *> &actionCollections)
{
d->ui.priEditor->setCheckActionCollections(actionCollections);
d->ui.altEditor->setCheckActionCollections(actionCollections);
}
//slot
void KShortcutWidget::applyStealShortcut()
{
d->ui.priEditor->applyStealShortcut();
d->ui.altEditor->applyStealShortcut();
}
//slot
void KShortcutWidget::setShortcut(const KShortcut &newSc)
{
if (newSc == d->cut)
if (newSc == d->cut) {
return;
}
d->holdChangedSignal = true;
d->ui.priEditor->setKeySequence(newSc.primary());
@ -114,29 +112,26 @@ void KShortcutWidget::setShortcut(const KShortcut &newSc)
emit shortcutChanged(d->cut);
}
//slot
void KShortcutWidget::clearShortcut()
{
setShortcut(KShortcut());
}
//private slot
void KShortcutWidgetPrivate::priKeySequenceChanged(const QKeySequence &seq)
{
cut.setPrimary(seq);
if (!holdChangedSignal)
if (!holdChangedSignal) {
emit q->shortcutChanged(cut);
}
}
//private slot
void KShortcutWidgetPrivate::altKeySequenceChanged(const QKeySequence &seq)
{
cut.setAlternate(seq);
if (!holdChangedSignal)
if (!holdChangedSignal) {
emit q->shortcutChanged(cut);
}
}
#include "moc_kshortcutwidget.cpp"