BareMetal: Do not add a duplicate entry for GDB server provider

In case the SDK settings contain some host which was imported, and the server
provider was modified to a different host, it is re-imported on next execution
of Creator.

Also fix a potential memory leak when registration fails.

Change-Id: I96d087ab35e0dc54975768c4bc697218080049ae
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-08-20 08:48:06 +03:00
committed by Orgad Shaneh
parent ced554aaab
commit 7a7813b1b8
3 changed files with 24 additions and 7 deletions

View File

@@ -172,6 +172,14 @@ GdbServerProvider *GdbServerProviderManager::findProvider(const QString &id) con
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::id, id));
}
GdbServerProvider *GdbServerProviderManager::findByDisplayName(const QString &displayName) const
{
if (displayName.isEmpty())
return 0;
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::displayName, displayName));
}
void GdbServerProviderManager::notifyAboutUpdate(GdbServerProvider *provider)
{
if (!provider || !m_providers.contains(provider))