forked from qt-creator/qt-creator
DocumentManager: Follow clazy's suggestion to use QHash instead of QMap
Change-Id: Icdae5e06db43c75408522d6331b4c56433a09ca9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -614,7 +614,7 @@ static bool saveModifiedFilesHelper(const QList<IDocument *> &documents,
|
|||||||
(*cancelled) = false;
|
(*cancelled) = false;
|
||||||
|
|
||||||
QList<IDocument *> notSaved;
|
QList<IDocument *> notSaved;
|
||||||
QMap<IDocument *, QString> modifiedDocumentsMap;
|
QHash<IDocument *, QString> modifiedDocumentsMap;
|
||||||
QList<IDocument *> modifiedDocuments;
|
QList<IDocument *> modifiedDocuments;
|
||||||
|
|
||||||
foreach (IDocument *document, documents) {
|
foreach (IDocument *document, documents) {
|
||||||
@@ -1023,7 +1023,7 @@ void DocumentManager::checkForReload()
|
|||||||
FileDeletedPromptAnswer previousDeletedAnswer = FileDeletedSave;
|
FileDeletedPromptAnswer previousDeletedAnswer = FileDeletedSave;
|
||||||
|
|
||||||
QList<IDocument *> documentsToClose;
|
QList<IDocument *> documentsToClose;
|
||||||
QMap<IDocument*, QString> documentsToSave;
|
QHash<IDocument*, QString> documentsToSave;
|
||||||
|
|
||||||
// collect file information
|
// collect file information
|
||||||
QMap<QString, FileStateItem> currentStates;
|
QMap<QString, FileStateItem> currentStates;
|
||||||
@@ -1243,7 +1243,7 @@ void DocumentManager::checkForReload()
|
|||||||
|
|
||||||
// handle deleted files
|
// handle deleted files
|
||||||
EditorManager::closeDocuments(documentsToClose, false);
|
EditorManager::closeDocuments(documentsToClose, false);
|
||||||
QMapIterator<IDocument *, QString> it(documentsToSave);
|
QHashIterator<IDocument *, QString> it(documentsToSave);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
saveDocument(it.key(), it.value());
|
saveDocument(it.key(), it.value());
|
||||||
|
|||||||
Reference in New Issue
Block a user