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

DeviceKitInformation: Fix Device selection.



Fix device selection when adding/removing devices. Also set a device
if the devicetype changes.

Change-Id: I92993f0b05d2c4cb3597eaf62a88d4f885ffd303
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 295ba2bb
...@@ -458,6 +458,11 @@ void DeviceKitInformation::kitsWereLoaded() ...@@ -458,6 +458,11 @@ void DeviceKitInformation::kitsWereLoaded()
this, SLOT(deviceRemoved(Core::Id))); this, SLOT(deviceRemoved(Core::Id)));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)), connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SLOT(deviceUpdated(Core::Id))); this, SLOT(deviceUpdated(Core::Id)));
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
this, SLOT(kitUpdated(ProjectExplorer::Kit*)));
connect(KitManager::instance(), SIGNAL(unmanagedKitUpdated(ProjectExplorer::Kit*)),
this, SLOT(kitUpdated(ProjectExplorer::Kit*)));
} }
void DeviceKitInformation::deviceUpdated(const Core::Id &id) void DeviceKitInformation::deviceUpdated(const Core::Id &id)
...@@ -468,19 +473,25 @@ void DeviceKitInformation::deviceUpdated(const Core::Id &id) ...@@ -468,19 +473,25 @@ void DeviceKitInformation::deviceUpdated(const Core::Id &id)
} }
} }
void DeviceKitInformation::kitUpdated(Kit *k)
{
setup(k); // Set default device if necessary
}
void DeviceKitInformation::deviceAdded(const Core::Id &id) void DeviceKitInformation::deviceAdded(const Core::Id &id)
{ {
Q_UNUSED(id); Q_UNUSED(id);
DeviceMatcher m; DeviceMatcher m;
foreach (Kit *k, KitManager::instance()->kits(&m)) foreach (Kit *k, KitManager::instance()->kits(&m)) {
fix(k); setup(k); // Set default device if necessary
}
} }
void DeviceKitInformation::deviceRemoved(const Core::Id &id) void DeviceKitInformation::deviceRemoved(const Core::Id &id)
{ {
DeviceMatcher m(id); DeviceMatcher m(id);
foreach (Kit *k, KitManager::instance()->kits(&m)) foreach (Kit *k, KitManager::instance()->kits(&m))
fix(k); setup(k); // Set default device if necessary
} }
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -220,6 +220,7 @@ private slots: ...@@ -220,6 +220,7 @@ private slots:
void deviceAdded(const Core::Id &id); void deviceAdded(const Core::Id &id);
void deviceRemoved(const Core::Id &id); void deviceRemoved(const Core::Id &id);
void deviceUpdated(const Core::Id &id); void deviceUpdated(const Core::Id &id);
void kitUpdated(ProjectExplorer::Kit *k);
}; };
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
......
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