Merge lp:~phablet-team/indicator-network/remember-hotspot-uuid into lp:indicator-network

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 591
Merged at revision: 593
Proposed branch: lp:~phablet-team/indicator-network/remember-hotspot-uuid
Merge into: lp:indicator-network
Prerequisite: lp:~phablet-team/indicator-network/wait-for-hotspot-ready-lp1579221
Diff against target: 52 lines (+12/-5)
1 file modified
src/indicator/nmofono/hotspot-manager.cpp (+12/-5)
To merge this branch: bzr merge lp:~phablet-team/indicator-network/remember-hotspot-uuid
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+294270@code.launchpad.net

Commit message

Remember hotspot UUID

Description of the change

Remember hotspot UUID

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/nmofono/hotspot-manager.cpp'
2--- src/indicator/nmofono/hotspot-manager.cpp 2016-05-10 16:27:35 +0000
3+++ src/indicator/nmofono/hotspot-manager.cpp 2016-05-10 16:27:35 +0000
4@@ -355,10 +355,13 @@
5 QVariantDictMap connection;
6
7 QString s_ssid = QString::fromLatin1(ssid);
8- QString s_uuid = QUuid().createUuid().toString();
9- // Remove {} from the generated uuid.
10- s_uuid.remove(0, 1);
11- s_uuid.remove(s_uuid.size() - 1, 1);
12+
13+ if (m_uuid.isEmpty()) {
14+ m_uuid = QUuid().createUuid().toString();
15+ // Remove {} from the generated uuid.
16+ m_uuid.remove(0, 1);
17+ m_uuid.remove(m_uuid.size() - 1, 1);
18+ }
19
20 QVariantMap wireless;
21
22@@ -374,7 +377,7 @@
23 QVariantMap connsettings;
24 connsettings[QStringLiteral("autoconnect")] = QVariant(autoConnect);
25 connsettings[QStringLiteral("id")] = QVariant(s_ssid);
26- connsettings[QStringLiteral("uuid")] = QVariant(s_uuid);
27+ connsettings[QStringLiteral("uuid")] = QVariant(m_uuid);
28 connsettings[QStringLiteral("type")] = QVariant(QStringLiteral("802-11-wireless"));
29 connection["connection"] = connsettings;
30
31@@ -452,11 +455,13 @@
32 if (wifi_mode == m_mode)
33 {
34 m_hotspot = conn;
35+ m_uuid = connection_settings["connection"]["uuid"].toString();
36 return;
37 }
38 }
39 }
40 m_hotspot.reset();
41+ m_uuid = QString();
42 }
43
44 connection::ActiveConnection::SPtr getActiveConnection()
45@@ -581,6 +586,8 @@
46
47 shared_ptr<OrgFreedesktopNetworkManagerSettingsConnectionInterface> m_hotspot;
48
49+ QString m_uuid;
50+
51 connection::ActiveConnectionManager::SPtr m_activeConnectionManager;
52 };
53

Subscribers

People subscribed via source and target branches