Commit a1e9b81c authored by Christian Kandeler's avatar Christian Kandeler
Browse files

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: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 794ea514
......@@ -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);
}
......
......@@ -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
......
......@@ -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()
......
......@@ -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)));
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment