Commit d141af16 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Kit: Handle device changes

Fix the updating of kits as devices are added/removed. This never
worked as intended due to the DeviceManager not sending the signals
I expected it to send, but masked by the Kits options page doing
the right thing for us.

Change-Id: I2d42ff7c1b8f6d795e20aebd114d723304904d4b
Reviewed-by: default avatarChristian Kandeler <>
parent 3eacb444
......@@ -446,12 +446,11 @@ void DeviceKitInformation::kitsWereLoaded()
foreach (Kit *k, KitManager::instance()->kits())
connect(DeviceManager::instance(), SIGNAL(deviceAdded(Core::Id)),
this, SLOT(deviceAdded(Core::Id)));
connect(DeviceManager::instance(), SIGNAL(deviceRemoved(Core::Id)),
this, SLOT(deviceRemoved(Core::Id)));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SLOT(deviceUpdated(Core::Id)));
DeviceManager *dm = DeviceManager::instance();
connect(dm, SIGNAL(deviceListChanged()), 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)));
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
this, SLOT(kitUpdated(ProjectExplorer::Kit*)));
......@@ -472,19 +471,9 @@ void DeviceKitInformation::kitUpdated(Kit *k)
setup(k); // Set default device if necessary
void DeviceKitInformation::deviceAdded(const Core::Id &id)
void DeviceKitInformation::devicesChanged()
DeviceMatcher m;
foreach (Kit *k, KitManager::instance()->kits(&m)) {
setup(k); // Set default device if necessary
void DeviceKitInformation::deviceRemoved(const Core::Id &id)
DeviceMatcher m(id);
foreach (Kit *k, KitManager::instance()->kits(&m))
foreach (Kit *k, KitManager::instance()->kits())
setup(k); // Set default device if necessary
......@@ -215,9 +215,8 @@ public:
private slots:
void kitsWereLoaded();
void deviceAdded(const Core::Id &id);
void deviceRemoved(const Core::Id &id);
void deviceUpdated(const Core::Id &id);
void devicesChanged();
void kitUpdated(ProjectExplorer::Kit *k);
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