From a1e9b81cecede8b634ccead4f71a3071250f5171 Mon Sep 17 00:00:00 2001
From: Christian Kandeler <christian.kandeler@digia.com>
Date: Thu, 11 Jul 2013 16:04:14 +0200
Subject: [PATCH] Device support: Rename DeviceManager::deviceListChanged().

The name is misleading: A "change" could also mean a device was added or
removed, which is not what his signal tracks. The new name is
"deviceListReplaced", which should give a better hint.
In addition, add an explanatory comment.

Change-Id: I0a67c4caf20520df53f2d046905b7ac8da4c2972
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
---
 .../devicesupport/devicemanager.cpp              | 16 ++++++++--------
 .../devicesupport/devicemanager.h                |  2 +-
 .../devicesupport/devicemanagermodel.cpp         |  2 +-
 src/plugins/projectexplorer/kitinformation.cpp   |  2 +-
 .../qnx/blackberrydeviceconnectionmanager.cpp    |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
index 4e62e1e1dd1..83d813b25ce 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
@@ -97,7 +97,7 @@ int DeviceManager::deviceCount() const
 void DeviceManager::replaceInstance()
 {
     copy(DeviceManagerPrivate::clonedInstance, instance(), false);
-    emit instance()->deviceListChanged();
+    emit instance()->deviceListReplaced();
     emit instance()->updated();
 }
 
@@ -459,7 +459,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QSignalSpy deviceAddedSpy(mgr, SIGNAL(deviceAdded(Core::Id)));
     QSignalSpy deviceRemovedSpy(mgr, SIGNAL(deviceRemoved(Core::Id)));
     QSignalSpy deviceUpdatedSpy(mgr, SIGNAL(deviceUpdated(Core::Id)));
-    QSignalSpy deviceListChangedSpy(mgr, SIGNAL(deviceListChanged()));
+    QSignalSpy deviceListReplacedSpy(mgr, SIGNAL(deviceListReplaced()));
     QSignalSpy updatedSpy(mgr, SIGNAL(updated()));
 
     mgr->addDevice(dev);
@@ -469,7 +469,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 1);
     QCOMPARE(deviceRemovedSpy.count(), 0);
     QCOMPARE(deviceUpdatedSpy.count(), 0);
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 1);
     deviceAddedSpy.clear();
     updatedSpy.clear();
@@ -478,7 +478,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 0);
     QCOMPARE(deviceRemovedSpy.count(), 0);
     QCOMPARE(deviceUpdatedSpy.count(), 0);
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 0);
 
     mgr->setDeviceState(dev->id(), IDevice::DeviceReadyToUse);
@@ -486,7 +486,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 0);
     QCOMPARE(deviceRemovedSpy.count(), 0);
     QCOMPARE(deviceUpdatedSpy.count(), 1);
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 1);
     deviceUpdatedSpy.clear();
     updatedSpy.clear();
@@ -497,7 +497,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 0);
     QCOMPARE(deviceRemovedSpy.count(), 0);
     QCOMPARE(deviceUpdatedSpy.count(), 1);
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 1);
     deviceUpdatedSpy.clear();
     updatedSpy.clear();
@@ -512,7 +512,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 1);
     QCOMPARE(deviceRemovedSpy.count(), 0);
     QCOMPARE(deviceUpdatedSpy.count(), 0);
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 1);
     deviceAddedSpy.clear();
     updatedSpy.clear();
@@ -525,7 +525,7 @@ void ProjectExplorerPlugin::testDeviceManager()
     QCOMPARE(deviceAddedSpy.count(), 0);
     QCOMPARE(deviceRemovedSpy.count(), 2);
 //    QCOMPARE(deviceUpdatedSpy.count(), 0); Uncomment once the "default" stuff is gone.
-    QCOMPARE(deviceListChangedSpy.count(), 0);
+    QCOMPARE(deviceListReplacedSpy.count(), 0);
     QCOMPARE(updatedSpy.count(), 2);
 }
 
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h
index 0255b9699d7..a2a66561469 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanager.h
+++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h
@@ -76,7 +76,7 @@ signals:
     void deviceAdded(Core::Id id);
     void deviceRemoved(Core::Id id);
     void deviceUpdated(Core::Id id);
-    void deviceListChanged();
+    void deviceListReplaced(); // For bulk changes via the settings dialog.
     void updated(); // Emitted for all of the above.
 
     void devicesLoaded(); // Emitted once load() is done
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp
index c935d41af86..67c173f13e5 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp
@@ -54,7 +54,7 @@ DeviceManagerModel::DeviceManagerModel(const DeviceManager *deviceManager, QObje
     connect(deviceManager, SIGNAL(deviceAdded(Core::Id)), SLOT(handleDeviceAdded(Core::Id)));
     connect(deviceManager, SIGNAL(deviceRemoved(Core::Id)), SLOT(handleDeviceRemoved(Core::Id)));
     connect(deviceManager, SIGNAL(deviceUpdated(Core::Id)), SLOT(handleDeviceUpdated(Core::Id)));
-    connect(deviceManager, SIGNAL(deviceListChanged()), SLOT(handleDeviceListChanged()));
+    connect(deviceManager, SIGNAL(deviceListReplaced()), SLOT(handleDeviceListChanged()));
 }
 
 DeviceManagerModel::~DeviceManagerModel()
diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp
index 27ea9e3ff8a..fd24af2b623 100644
--- a/src/plugins/projectexplorer/kitinformation.cpp
+++ b/src/plugins/projectexplorer/kitinformation.cpp
@@ -447,7 +447,7 @@ void DeviceKitInformation::kitsWereLoaded()
         fix(k);
 
     DeviceManager *dm = DeviceManager::instance();
-    connect(dm, SIGNAL(deviceListChanged()), this, SLOT(devicesChanged()));
+    connect(dm, SIGNAL(deviceListReplaced()), this, SLOT(devicesChanged()));
     connect(dm, SIGNAL(deviceAdded(Core::Id)), this, SLOT(devicesChanged()));
     connect(dm, SIGNAL(deviceRemoved(Core::Id)), this, SLOT(devicesChanged()));
     connect(dm, SIGNAL(deviceUpdated(Core::Id)), this, SLOT(deviceUpdated(Core::Id)));
diff --git a/src/plugins/qnx/blackberrydeviceconnectionmanager.cpp b/src/plugins/qnx/blackberrydeviceconnectionmanager.cpp
index d351d660dbc..788f18d0611 100644
--- a/src/plugins/qnx/blackberrydeviceconnectionmanager.cpp
+++ b/src/plugins/qnx/blackberrydeviceconnectionmanager.cpp
@@ -59,7 +59,7 @@ void BlackBerryDeviceConnectionManager::initialize()
     ProjectExplorer::DeviceManager *deviceManager = ProjectExplorer::DeviceManager::instance();
     connect(deviceManager, SIGNAL(deviceAdded(Core::Id)), this, SLOT(connectDevice(Core::Id)));
     connect(deviceManager, SIGNAL(deviceRemoved(Core::Id)), this, SLOT(disconnectDevice(Core::Id)));
-    connect(deviceManager, SIGNAL(deviceListChanged()), this, SLOT(handleDeviceListChanged()));
+    connect(deviceManager, SIGNAL(deviceListReplaced()), this, SLOT(handleDeviceListChanged()));
 }
 
 void BlackBerryDeviceConnectionManager::killAllConnections()
-- 
GitLab