remove actionCollections and shortcut config dlg
This commit is contained in:
parent
9f6fbec2f3
commit
55add92bf8
@ -36,7 +36,6 @@
|
|||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
#include <klocalizedstring.h>
|
#include <klocalizedstring.h>
|
||||||
#include <kshortcutsdialog.h>
|
|
||||||
#include <kwindowsystem.h>
|
#include <kwindowsystem.h>
|
||||||
|
|
||||||
#include "containment.h"
|
#include "containment.h"
|
||||||
@ -383,54 +382,6 @@ void CoronaPrivate::init()
|
|||||||
//fake containment/applet actions
|
//fake containment/applet actions
|
||||||
KActionCollection *containmentActions = AppletPrivate::defaultActions(q); //containment has to start with applet stuff
|
KActionCollection *containmentActions = AppletPrivate::defaultActions(q); //containment has to start with applet stuff
|
||||||
ContainmentPrivate::addDefaultActions(containmentActions); //now it's really containment
|
ContainmentPrivate::addDefaultActions(containmentActions); //now it's really containment
|
||||||
actionCollections << &actions << AppletPrivate::defaultActions(q) << containmentActions;
|
|
||||||
|
|
||||||
//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()
|
|
||||||
{
|
|
||||||
//show a kshortcutsdialog with the actions
|
|
||||||
KShortcutsDialog *dlg = shortcutsDlg.data();
|
|
||||||
if (!dlg) {
|
|
||||||
dlg = new KShortcutsDialog();
|
|
||||||
dlg->setModal(false);
|
|
||||||
dlg->setAttribute(Qt::WA_DeleteOnClose, true);
|
|
||||||
QObject::connect(dlg, SIGNAL(saved()), q, SIGNAL(shortcutsChanged()));
|
|
||||||
|
|
||||||
dlg->addCollection(&actions);
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
dlg->addCollection(collection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
KWindowSystem::setOnDesktop(dlg->winId(), KWindowSystem::currentDesktop());
|
|
||||||
dlg->configure();
|
|
||||||
dlg->raise();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoronaPrivate::toggleImmutability()
|
void CoronaPrivate::toggleImmutability()
|
||||||
|
@ -311,7 +311,6 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
|
Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
|
||||||
Q_PRIVATE_SLOT(d, void syncConfig())
|
Q_PRIVATE_SLOT(d, void syncConfig())
|
||||||
Q_PRIVATE_SLOT(d, void toggleImmutability())
|
Q_PRIVATE_SLOT(d, void toggleImmutability())
|
||||||
Q_PRIVATE_SLOT(d, void showShortcutConfig())
|
|
||||||
|
|
||||||
friend class CoronaPrivate;
|
friend class CoronaPrivate;
|
||||||
friend class View;
|
friend class View;
|
||||||
|
@ -41,7 +41,6 @@ public:
|
|||||||
~CoronaPrivate();
|
~CoronaPrivate();
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void showShortcutConfig();
|
|
||||||
void toggleImmutability();
|
void toggleImmutability();
|
||||||
void saveLayout(KSharedConfigPtr cg) const;
|
void saveLayout(KSharedConfigPtr cg) const;
|
||||||
void updateContainmentImmutability();
|
void updateContainmentImmutability();
|
||||||
@ -64,9 +63,7 @@ public:
|
|||||||
QHash<uint, QGraphicsWidget*> offscreenWidgets;
|
QHash<uint, QGraphicsWidget*> offscreenWidgets;
|
||||||
KActionCollection actions;
|
KActionCollection actions;
|
||||||
QMap<Plasma::ContainmentType, QHash<QString, QString> > containmentActionsDefaults;
|
QMap<Plasma::ContainmentType, QHash<QString, QString> > containmentActionsDefaults;
|
||||||
QWeakPointer<KShortcutsDialog> shortcutsDlg;
|
|
||||||
QHash<Plasma::ContainmentType, QString> toolBoxPlugins;
|
QHash<Plasma::ContainmentType, QString> toolBoxPlugins;
|
||||||
QList<QWeakPointer<KActionCollection> > actionCollections;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user