added an assert

This commit is contained in:
Patrick von Reth 2015-07-10 14:14:20 +02:00
parent b9620a1357
commit 8196e3a669
1 changed files with 3 additions and 1 deletions

View File

@ -99,7 +99,9 @@ void SnoreCore::loadPlugins(SnorePlugin::PluginTypes types)
}
snoreDebug(SNORE_DEBUG) << info->name() << "is a" << info->type();
d->m_pluginNames[info->type()].append(info->name());
d->m_plugins[qMakePair(type, info->name())] = plugin;
auto key = qMakePair(type, info->name());
Q_ASSERT_X(!d->m_plugins.contains(key), Q_FUNC_INFO, "Multiple plugins of the same type with the same name.");
d->m_plugins.insert(key, plugin);
}
if (d->m_pluginNames.contains(type)) {
qSort(d->m_pluginNames[type]);