1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

context:Preferences action in hash

This commit is contained in:
Michail Vourlakos 2021-06-08 20:22:12 +03:00
parent a4cc972a3c
commit eeafa17f17
2 changed files with 4 additions and 8 deletions

View File

@ -70,7 +70,6 @@ Menu::~Menu()
m_moveToLayoutMenu->deleteLater();
//! actions
m_preferenceAction->deleteLater();
m_printAction->deleteLater();
m_removeAction->deleteLater();
m_quitApplication->deleteLater();
@ -151,9 +150,9 @@ void Menu::makeActions()
connect(m_moveToLayoutMenu, &QMenu::triggered, this, &Menu::moveToLayout);
//! Configure Latte
m_preferenceAction = new QAction(QIcon::fromTheme("configure"), i18nc("global settings window", "&Configure Latte..."), this);
this->containment()->actions()->addAction(Latte::Data::ContextMenu::PREFERENCESACTION, m_preferenceAction);
connect(m_preferenceAction, &QAction::triggered, [=](){
m_actions[Latte::Data::ContextMenu::PREFERENCESACTION] = new QAction(QIcon::fromTheme("configure"), i18nc("global settings window", "&Configure Latte..."), this);
this->containment()->actions()->addAction(Latte::Data::ContextMenu::PREFERENCESACTION, m_actions[Latte::Data::ContextMenu::PREFERENCESACTION]);
connect(m_actions[Latte::Data::ContextMenu::PREFERENCESACTION], &QAction::triggered, [=](){
QDBusInterface iface("org.kde.lattedock", "/Latte", "", QDBusConnection::sessionBus());
if (iface.isValid()) {
@ -221,7 +220,7 @@ QList<QAction *> Menu::contextualActions()
actions << m_actions[Latte::Data::ContextMenu::SECTIONACTION];
//actions << m_printAction;
actions << m_layoutsAction;
actions << m_preferenceAction;
actions << m_actions[Latte::Data::ContextMenu::PREFERENCESACTION];
actions << m_quitApplication;
actions << m_actions[Latte::Data::ContextMenu::SEPARATOR1ACTION];
@ -280,8 +279,6 @@ QAction *Menu::action(const QString &name)
return m_layoutsAction;
} else if (name == Latte::Data::ContextMenu::MOVEVIEWACTION) {
return m_moveAction;
} else if (name == Latte::Data::ContextMenu::PREFERENCESACTION) {
return m_preferenceAction;
} else if (name == Latte::Data::ContextMenu::QUITLATTEACTION) {
return m_quitApplication;
} else if (name == Latte::Data::ContextMenu::REMOVEVIEWACTION) {

View File

@ -55,7 +55,6 @@ private:
QHash<QString, QAction *> m_actions;
QAction *m_preferenceAction{nullptr};
QAction *m_printAction{nullptr};
QAction *m_removeAction{nullptr};
QAction *m_quitApplication{nullptr};