remove updateShortcuts() and addShortcut()
This commit is contained in:
parent
bc3c23187d
commit
9f6fbec2f3
@ -333,33 +333,6 @@ KActionCollection *Corona::actions() const
|
||||
return &d->actions;
|
||||
}
|
||||
|
||||
void Corona::updateShortcuts()
|
||||
{
|
||||
QMutableListIterator<QWeakPointer<KActionCollection> > it(d->actionCollections);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
KActionCollection *collection = it.value().data();
|
||||
if (!collection) {
|
||||
// get rid of KActionCollections that have been deleted behind our backs
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
collection->readSettings();
|
||||
if (d->shortcutsDlg) {
|
||||
d->shortcutsDlg.data()->addCollection(collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Corona::addShortcuts(KActionCollection *newShortcuts)
|
||||
{
|
||||
d->actionCollections << newShortcuts;
|
||||
if (d->shortcutsDlg) {
|
||||
d->shortcutsDlg.data()->addCollection(newShortcuts);
|
||||
}
|
||||
}
|
||||
|
||||
QHash<QString, QString> Corona::defaultContainmentActionsPlugins(ContainmentType containmentType) const
|
||||
{
|
||||
//FIXME: need to read these out of the package
|
||||
@ -407,23 +380,27 @@ void CoronaPrivate::init()
|
||||
lockAction->setShortcut(KShortcut("alt+d, l"));
|
||||
lockAction->setShortcutContext(Qt::ApplicationShortcut);
|
||||
|
||||
//FIXME this doesn't really belong here. desktop KCM maybe?
|
||||
//but should the shortcuts be per-app or really-global?
|
||||
//I don't know how to make kactioncollections use plasmarc
|
||||
KAction *action = actions.add<KAction>("configure shortcuts");
|
||||
QObject::connect(action, SIGNAL(triggered()), q, SLOT(showShortcutConfig()));
|
||||
action->setText(i18n("Shortcut Settings"));
|
||||
action->setIcon(KDE::icon("configure-shortcuts"));
|
||||
action->setAutoRepeat(false);
|
||||
action->setData(Plasma::ConfigureAction);
|
||||
//action->setShortcut(KShortcut("ctrl+h"));
|
||||
action->setShortcutContext(Qt::ApplicationShortcut);
|
||||
|
||||
//fake containment/applet actions
|
||||
KActionCollection *containmentActions = AppletPrivate::defaultActions(q); //containment has to start with applet stuff
|
||||
ContainmentPrivate::addDefaultActions(containmentActions); //now it's really containment
|
||||
actionCollections << &actions << AppletPrivate::defaultActions(q) << containmentActions;
|
||||
q->updateShortcuts();
|
||||
|
||||
//Update the shortcuts
|
||||
QMutableListIterator<QWeakPointer<KActionCollection> > it(actionCollections);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
KActionCollection *collection = it.value().data();
|
||||
if (!collection) {
|
||||
// get rid of KActionCollections that have been deleted behind our backs
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
collection->readSettings();
|
||||
if (shortcutsDlg) {
|
||||
shortcutsDlg.data()->addCollection(collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CoronaPrivate::showShortcutConfig()
|
||||
|
@ -136,22 +136,6 @@ public:
|
||||
*/
|
||||
QList<Plasma::Location> freeEdges(int screen) const;
|
||||
|
||||
/**
|
||||
* @since 4.3
|
||||
* Updates keyboard shortcuts for all the Corona's actions.
|
||||
* If you've added actions to the Corona you'll need to
|
||||
* call this for them to be configurable.
|
||||
*/
|
||||
void updateShortcuts();
|
||||
|
||||
/**
|
||||
* @since 4.3
|
||||
* Adds a set of actions to the shortcut config dialog.
|
||||
* don't use this on actions in the Corona's own actioncollection,
|
||||
* those are handled automatically. this is for stuff outside of that.
|
||||
*/
|
||||
void addShortcuts(KActionCollection *newShortcuts);
|
||||
|
||||
/**
|
||||
* The actions assocated with this Corona
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user