unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 2dd39294ea29e1b6df512a64303284957499a694 3324 bytes (raw)
name: gnu/packages/patches/networkmanager-qt-activeconnection-test-1.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
From 61337983ba74361938b7d5323de5d2819a235fdc Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Mon, 3 Apr 2017 12:53:12 +0200
Subject: Fix unit test for active connections

Instead of sending PropertiesChanged signal for an active connection we
added recently we should set all properties initially and just advertise
that we have a new active connection once everything is set
---
 src/fakenetwork/fakenetwork.cpp | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/src/fakenetwork/fakenetwork.cpp b/src/fakenetwork/fakenetwork.cpp
index bc1144e..261fe8e 100644
--- a/src/fakenetwork/fakenetwork.cpp
+++ b/src/fakenetwork/fakenetwork.cpp
@@ -215,8 +215,14 @@ void FakeNetwork::unregisterService()
 
 QDBusObjectPath FakeNetwork::ActivateConnection(const QDBusObjectPath &connection, const QDBusObjectPath &device, const QDBusObjectPath &specific_object)
 {
-    ActiveConnection *newActiveConnection = new ActiveConnection(this);
     QString newActiveConnectionPath = QString("/org/kde/fakenetwork/ActiveConnection/") + QString::number(m_activeConnectionsCounter++);
+    ActiveConnection *newActiveConnection = new ActiveConnection(this);
+    newActiveConnection->addDevice(device);
+    newActiveConnection->setActiveConnectionPath(newActiveConnectionPath);
+    newActiveConnection->setConnection(connection);
+    newActiveConnection->setSpecificObject(specific_object);
+    newActiveConnection->setState(NetworkManager::ActiveConnection::Activating);
+
     m_activeConnections.insert(QDBusObjectPath(newActiveConnectionPath), newActiveConnection);
     QDBusConnection::sessionBus().registerObject(newActiveConnectionPath, newActiveConnection, QDBusConnection::ExportScriptableContents);
 
@@ -227,24 +233,6 @@ QDBusObjectPath FakeNetwork::ActivateConnection(const QDBusObjectPath &connectio
     map.insert(QLatin1Literal("ActivatingConnection"), QVariant::fromValue(QDBusObjectPath(newActiveConnectionPath)));
     Q_EMIT PropertiesChanged(map);
 
-    newActiveConnection->addDevice(device);
-    newActiveConnection->setActiveConnectionPath(newActiveConnectionPath);
-    newActiveConnection->setConnection(connection);
-    newActiveConnection->setSpecificObject(specific_object);
-    newActiveConnection->setState(NetworkManager::ActiveConnection::Activating);
-
-    map.clear();
-    const QList<QDBusObjectPath> deviceList { device };
-    map.insert(QLatin1Literal("Devices"), QVariant::fromValue<QList<QDBusObjectPath> >(deviceList));
-    map.insert(QLatin1Literal("Connection"), QVariant::fromValue<QDBusObjectPath>(connection));
-    if (!specific_object.path().isEmpty()) {
-        map.insert(QLatin1Literal("SpecificObject"), QVariant::fromValue<QDBusObjectPath>(connection));
-    }
-    map.insert(QLatin1Literal("State"), NetworkManager::ActiveConnection::Activating);
-    QDBusMessage message = QDBusMessage::createSignal(newActiveConnectionPath, QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("PropertiesChanged"));
-    message << map;
-    QDBusConnection::sessionBus().send(message);
-
     Device *usedDevice = static_cast<Device *>(QDBusConnection::sessionBus().objectRegisteredAt(device.path()));
     if (usedDevice) {
         m_activatedDevice = usedDevice->devicePath();
-- 
cgit v0.11.2


debug log:

solving 2dd3929 ...
found 2dd3929 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).