Skip to content

Commit

Permalink
context:use restore() provided function
Browse files Browse the repository at this point in the history
containment() is not accessible during the containment
actions constructor. We now use the provided ::restore()
function in order to load the actions

BUG:441448
  • Loading branch information
psifidotos committed Aug 27, 2021
1 parent 5c9dc95 commit 5e55abb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions containmentactions/contextmenu/menu.cpp
Expand Up @@ -56,7 +56,6 @@ enum LatteConfigPage
Menu::Menu(QObject *parent, const QVariantList &args)
: Plasma::ContainmentActions(parent, args)
{
makeActions();
}

Menu::~Menu()
Expand All @@ -75,8 +74,12 @@ Menu::~Menu()
m_actions.clear();
}

void Menu::makeActions()
void Menu::restore(const KConfigGroup &config)
{
if (!m_actions.isEmpty()) {
return;
}

m_actions[Latte::Data::ContextMenu::SECTIONACTION] = new QAction(this);
m_actions[Latte::Data::ContextMenu::SECTIONACTION]->setSeparator(true);
m_actions[Latte::Data::ContextMenu::SECTIONACTION]->setText("Latte");
Expand Down
2 changes: 1 addition & 1 deletion containmentactions/contextmenu/menu.h
Expand Up @@ -30,10 +30,10 @@ class Menu : public Plasma::ContainmentActions
~Menu() override;

QList<QAction *> contextualActions() override;
void restore(const KConfigGroup &) override;

QAction *action(const QString &name);
private Q_SLOTS:
void makeActions();
void populateLayouts();
void populateMoveToLayouts();
void populateViewTemplates();
Expand Down

0 comments on commit 5e55abb

Please sign in to comment.