Merge lp:~unity-api-team/indicator-network/modem-switch-depends-on-having-modem into lp:indicator-network

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 641
Merged at revision: 607
Proposed branch: lp:~unity-api-team/indicator-network/modem-switch-depends-on-having-modem
Merge into: lp:indicator-network
Prerequisite: lp:~unity-api-team/indicator-network/lp1597615
Diff against target: 29 lines (+8/-1)
1 file modified
src/indicator/sections/wwan-section.cpp (+8/-1)
To merge this branch: bzr merge lp:~unity-api-team/indicator-network/modem-switch-depends-on-having-modem
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+299120@code.launchpad.net

Commit message

Only include the mobile data switch when we have modems

Description of the change

Only include the mobile data switch when we have modems

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator/sections/wwan-section.cpp'
2--- src/indicator/sections/wwan-section.cpp 2016-05-05 14:15:23 +0000
3+++ src/indicator/sections/wwan-section.cpp 2016-07-05 10:49:44 +0000
4@@ -92,7 +92,6 @@
5 m_menuMerger->append(m_linkMenuMerger);
6 m_menuMerger->append(m_bottomMenu);
7
8- m_upperMenu->append(m_mobileDataSwitch->menuItem());
9 m_actionGroupMerger->add(m_mobileDataSwitch->actionGroup());
10
11 // have the modem list in their own section.
12@@ -154,9 +153,17 @@
13 if (modems.size() == 0)
14 {
15 m_bottomMenu->clear();
16+ m_upperMenu->clear();
17 }
18 else
19 {
20+ // Check if the switch is already present
21+ if (m_upperMenu->find(m_mobileDataSwitch->menuItem()) == m_upperMenu->end())
22+ {
23+ // If not, add it
24+ m_upperMenu->insert(m_mobileDataSwitch->menuItem(), m_upperMenu->begin());
25+ }
26+
27 // Add the hotspot button if we have configuration stored
28 if (m_manager->hotspotStored())
29 {

Subscribers

People subscribed via source and target branches