Merge lp:~aacid/qtubuntu/honor_item_visibility into lp:qtubuntu

Proposed by Albert Astals Cid on 2017-03-27
Status: Merged
Approved by: Lukáš Tinkl on 2017-03-27
Approved revision: 386
Merged at revision: 388
Proposed branch: lp:~aacid/qtubuntu/honor_item_visibility
Merge into: lp:qtubuntu
Prerequisite: lp:~aacid/qtubuntu/remove_unused_signal
Diff against target: 45 lines (+6/-0)
3 files modified
src/ubuntuappmenu/gmenumodelexporter.cpp (+4/-0)
src/ubuntuappmenu/gmenumodelplatformmenu.cpp (+1/-0)
src/ubuntuappmenu/gmenumodelplatformmenu.h (+1/-0)
To merge this branch: bzr merge lp:~aacid/qtubuntu/honor_item_visibility
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2017-03-27 Approve on 2017-03-27
Unity8 CI Bot continuous-integration Approve on 2017-03-27
Review via email: mp+321042@code.launchpad.net

Commit message

Honor the menu item visibility

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:386
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/214/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4701
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4729
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4552/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4552/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4552/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4552/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4552/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4552
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4552/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/214/rebuild

review: Approve (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

Tested, worked fine; code makes sense too and CI passing

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntuappmenu/gmenumodelexporter.cpp'
2--- src/ubuntuappmenu/gmenumodelexporter.cpp 2017-03-20 17:30:26 +0000
3+++ src/ubuntuappmenu/gmenumodelexporter.cpp 2017-03-27 08:23:57 +0000
4@@ -305,6 +305,7 @@
5 if (gplatformMenuItem->menu()) {
6 connect(gplatformMenuItem, &UbuntuPlatformMenuItem::enabledChanged, gplatformMenu, &UbuntuPlatformMenu::structureChanged);
7 }
8+ connect(gplatformMenuItem, &UbuntuPlatformMenuItem::visibleChanged, gplatformMenu, &UbuntuPlatformMenu::structureChanged);
9 }
10
11 GMenuItem* gmenuItem = g_menu_item_new_submenu(label.constData(), G_MENU_MODEL(menu));
12@@ -379,6 +380,9 @@
13 UbuntuPlatformMenuItem* gplatformMenuItem = static_cast<UbuntuPlatformMenuItem*>(platformMenuItem);
14 if (!gplatformMenuItem) return nullptr;
15
16+ if (!UbuntuPlatformMenuItem::get_visible(gplatformMenuItem))
17+ return nullptr;
18+
19 QByteArray label(UbuntuPlatformMenuItem::get_text(gplatformMenuItem).toUtf8());
20 QByteArray actionLabel(getActionString(UbuntuPlatformMenuItem::get_text(gplatformMenuItem)).toUtf8());
21 QByteArray shortcut(UbuntuPlatformMenuItem::get_shortcut(gplatformMenuItem).toString(QKeySequence::NativeText).toUtf8());
22
23=== modified file 'src/ubuntuappmenu/gmenumodelplatformmenu.cpp'
24--- src/ubuntuappmenu/gmenumodelplatformmenu.cpp 2017-03-27 08:23:57 +0000
25+++ src/ubuntuappmenu/gmenumodelplatformmenu.cpp 2017-03-27 08:23:57 +0000
26@@ -417,6 +417,7 @@
27 ITEM_DEBUG_MSG << "(visible=" << isVisible << ")";
28 if (m_visible != isVisible) {
29 m_visible = isVisible;
30+ Q_EMIT visibleChanged(m_visible);
31 }
32 }
33
34
35=== modified file 'src/ubuntuappmenu/gmenumodelplatformmenu.h'
36--- src/ubuntuappmenu/gmenumodelplatformmenu.h 2017-03-27 08:23:57 +0000
37+++ src/ubuntuappmenu/gmenumodelplatformmenu.h 2017-03-27 08:23:57 +0000
38@@ -159,6 +159,7 @@
39 Q_SIGNALS:
40 void checkedChanged(bool);
41 void enabledChanged(bool);
42+ void visibleChanged(bool);
43
44 private:
45 MENU_PROPERTY(UbuntuPlatformMenuItem, separator, bool, false)

Subscribers

People subscribed via source and target branches