Commit 7a65e983 authored by Fabio Bolz's avatar Fabio Bolz Committed by Albert Astals Cid

Fix broken context menu after adding custom tea

BUG: 396448

Reviewers: #kde_applications, aacid

Reviewed By: #kde_applications, aacid

Subscribers: aacid, kde-utils-devel

Differential Revision: https://phabricator.kde.org/D14082
parent 067b5cc6
...@@ -97,6 +97,8 @@ TopLevel::TopLevel(const KAboutData *aboutData, const QString &icon, QWidget *pa ...@@ -97,6 +97,8 @@ TopLevel::TopLevel(const KAboutData *aboutData, const QString &icon, QWidget *pa
m_helpMenu = new KHelpMenu( nullptr, *aboutData, false ); m_helpMenu = new KHelpMenu( nullptr, *aboutData, false );
setContextMenu(new QMenu);
loadTeaMenuItems(); loadTeaMenuItems();
contextMenu()->addSeparator(); contextMenu()->addSeparator();
contextMenu()->addAction( m_actionCollection->action(QStringLiteral("stop")) ); contextMenu()->addAction( m_actionCollection->action(QStringLiteral("stop")) );
...@@ -185,7 +187,6 @@ void TopLevel::setTeaList(const QList<Tea> &tealist) { ...@@ -185,7 +187,6 @@ void TopLevel::setTeaList(const QList<Tea> &tealist) {
void TopLevel::loadTeaMenuItems() { void TopLevel::loadTeaMenuItems() {
int i=0; int i=0;
setContextMenu(new QMenu);
foreach(const Tea &t, m_tealist) { foreach(const Tea &t, m_tealist) {
QAction *a = contextMenu()->addAction( QAction *a = contextMenu()->addAction(
i18nc( "%1 - name of the tea, %2 - the predefined time for " i18nc( "%1 - name of the tea, %2 - the predefined time for "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment