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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Lukáš Tinkl
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) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+321042@code.launchpad.net

Commit message

Honor the menu item visibility

To post a comment you must log in.
Revision history for this message
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)
Revision history for this message
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
=== modified file 'src/ubuntuappmenu/gmenumodelexporter.cpp'
--- src/ubuntuappmenu/gmenumodelexporter.cpp 2017-03-20 17:30:26 +0000
+++ src/ubuntuappmenu/gmenumodelexporter.cpp 2017-03-27 08:23:57 +0000
@@ -305,6 +305,7 @@
305 if (gplatformMenuItem->menu()) {305 if (gplatformMenuItem->menu()) {
306 connect(gplatformMenuItem, &UbuntuPlatformMenuItem::enabledChanged, gplatformMenu, &UbuntuPlatformMenu::structureChanged);306 connect(gplatformMenuItem, &UbuntuPlatformMenuItem::enabledChanged, gplatformMenu, &UbuntuPlatformMenu::structureChanged);
307 }307 }
308 connect(gplatformMenuItem, &UbuntuPlatformMenuItem::visibleChanged, gplatformMenu, &UbuntuPlatformMenu::structureChanged);
308 }309 }
309310
310 GMenuItem* gmenuItem = g_menu_item_new_submenu(label.constData(), G_MENU_MODEL(menu));311 GMenuItem* gmenuItem = g_menu_item_new_submenu(label.constData(), G_MENU_MODEL(menu));
@@ -379,6 +380,9 @@
379 UbuntuPlatformMenuItem* gplatformMenuItem = static_cast<UbuntuPlatformMenuItem*>(platformMenuItem);380 UbuntuPlatformMenuItem* gplatformMenuItem = static_cast<UbuntuPlatformMenuItem*>(platformMenuItem);
380 if (!gplatformMenuItem) return nullptr;381 if (!gplatformMenuItem) return nullptr;
381382
383 if (!UbuntuPlatformMenuItem::get_visible(gplatformMenuItem))
384 return nullptr;
385
382 QByteArray label(UbuntuPlatformMenuItem::get_text(gplatformMenuItem).toUtf8());386 QByteArray label(UbuntuPlatformMenuItem::get_text(gplatformMenuItem).toUtf8());
383 QByteArray actionLabel(getActionString(UbuntuPlatformMenuItem::get_text(gplatformMenuItem)).toUtf8());387 QByteArray actionLabel(getActionString(UbuntuPlatformMenuItem::get_text(gplatformMenuItem)).toUtf8());
384 QByteArray shortcut(UbuntuPlatformMenuItem::get_shortcut(gplatformMenuItem).toString(QKeySequence::NativeText).toUtf8());388 QByteArray shortcut(UbuntuPlatformMenuItem::get_shortcut(gplatformMenuItem).toString(QKeySequence::NativeText).toUtf8());
385389
=== modified file 'src/ubuntuappmenu/gmenumodelplatformmenu.cpp'
--- src/ubuntuappmenu/gmenumodelplatformmenu.cpp 2017-03-27 08:23:57 +0000
+++ src/ubuntuappmenu/gmenumodelplatformmenu.cpp 2017-03-27 08:23:57 +0000
@@ -417,6 +417,7 @@
417 ITEM_DEBUG_MSG << "(visible=" << isVisible << ")";417 ITEM_DEBUG_MSG << "(visible=" << isVisible << ")";
418 if (m_visible != isVisible) {418 if (m_visible != isVisible) {
419 m_visible = isVisible;419 m_visible = isVisible;
420 Q_EMIT visibleChanged(m_visible);
420 }421 }
421}422}
422423
423424
=== modified file 'src/ubuntuappmenu/gmenumodelplatformmenu.h'
--- src/ubuntuappmenu/gmenumodelplatformmenu.h 2017-03-27 08:23:57 +0000
+++ src/ubuntuappmenu/gmenumodelplatformmenu.h 2017-03-27 08:23:57 +0000
@@ -159,6 +159,7 @@
159Q_SIGNALS:159Q_SIGNALS:
160 void checkedChanged(bool);160 void checkedChanged(bool);
161 void enabledChanged(bool);161 void enabledChanged(bool);
162 void visibleChanged(bool);
162163
163private:164private:
164 MENU_PROPERTY(UbuntuPlatformMenuItem, separator, bool, false)165 MENU_PROPERTY(UbuntuPlatformMenuItem, separator, bool, false)

Subscribers

People subscribed via source and target branches