forked from qt-creator/qt-creator
ExtensionSystem: Avoid using iterators from temporaries
Doing it can lead to unexpected results Change-Id: I602cf6a4692c9e0c0adb4564679478ea25bf8829 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -442,7 +442,7 @@ QString PluginManager::systemInformation() const
|
|||||||
if (response.result == SynchronousProcessResponse::Finished)
|
if (response.result == SynchronousProcessResponse::Finished)
|
||||||
result += response.allOutput() + "\n";
|
result += response.allOutput() + "\n";
|
||||||
result += "Plugin information:\n\n";
|
result += "Plugin information:\n\n";
|
||||||
auto longestSpec = std::max_element(plugins().cbegin(), plugins().cend(),
|
auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(),
|
||||||
[](const PluginSpec *left, const PluginSpec *right) {
|
[](const PluginSpec *left, const PluginSpec *right) {
|
||||||
return left->name().size() < right->name().size();
|
return left->name().size() < right->name().size();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -421,8 +421,9 @@ void PluginView::updatePlugins()
|
|||||||
|
|
||||||
|
|
||||||
QList<CollectionItem *> collections;
|
QList<CollectionItem *> collections;
|
||||||
auto end = PluginManager::pluginCollections().cend();
|
const QHash<QString, QList<PluginSpec *>> pluginCollections = PluginManager::pluginCollections();
|
||||||
for (auto it = PluginManager::pluginCollections().cbegin(); it != end; ++it) {
|
const auto end = pluginCollections.cend();
|
||||||
|
for (auto it = pluginCollections.cbegin(); it != end; ++it) {
|
||||||
const QString name = it.key().isEmpty() ? tr("Utilities") : it.key();
|
const QString name = it.key().isEmpty() ? tr("Utilities") : it.key();
|
||||||
collections.append(new CollectionItem(name, it.value(), this));
|
collections.append(new CollectionItem(name, it.value(), this));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user