Fix activationAction connection
It was connecting to a deprecated signal, use QAction::changed instead. Since QAction::changed is more generic and modifying the shortcut seems expensive, actually check that the property is different from the previous value. Reviewed by Vishesh Handa.
This commit is contained in:
parent
333bd207ac
commit
9a305de76d
@ -587,7 +587,7 @@ void Applet::setGlobalShortcut(const QKeySequence &shortcut)
|
|||||||
d->activationAction->setText(i18n("Activate %1 Widget", title()));
|
d->activationAction->setText(i18n("Activate %1 Widget", title()));
|
||||||
d->activationAction->setObjectName(QString("activate widget %1").arg(id())); // NO I18N
|
d->activationAction->setObjectName(QString("activate widget %1").arg(id())); // NO I18N
|
||||||
connect(d->activationAction, SIGNAL(triggered()), this, SIGNAL(activated()));
|
connect(d->activationAction, SIGNAL(triggered()), this, SIGNAL(activated()));
|
||||||
connect(d->activationAction, SIGNAL(globalShortcutChanged(QKeySequence)),
|
connect(d->activationAction, SIGNAL(changed()),
|
||||||
this, SLOT(globalShortcutChanged()));
|
this, SLOT(globalShortcutChanged()));
|
||||||
} else if (d->activationAction->shortcut() == shortcut) {
|
} else if (d->activationAction->shortcut() == shortcut) {
|
||||||
return;
|
return;
|
||||||
|
@ -210,10 +210,13 @@ void AppletPrivate::globalShortcutChanged()
|
|||||||
if (!activationAction) {
|
if (!activationAction) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KConfigGroup shortcutConfig(mainConfigGroup(), "Shortcuts");
|
KConfigGroup shortcutConfig(mainConfigGroup(), "Shortcuts");
|
||||||
shortcutConfig.writeEntry("global", activationAction->shortcut().toString());
|
QString newShortCut = activationAction->shortcut().toString();
|
||||||
|
QString oldShortCut = shortcutConfig.readEntry("global", QString());
|
||||||
|
if(newShortCut != oldShortCut) {
|
||||||
|
shortcutConfig.writeEntry("global", newShortCut);
|
||||||
scheduleModificationNotification();
|
scheduleModificationNotification();
|
||||||
|
}
|
||||||
//qDebug() << "after" << shortcut.primary() << d->activationAction->globalShortcut().primary();
|
//qDebug() << "after" << shortcut.primary() << d->activationAction->globalShortcut().primary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user