Revert "Revert "Merge remote-tracking branch 'origin/4.15'""

This reverts commit f0a86d4510.

Reverting a merge doesn't "undo" it - the changes would be lost
forever even with subsequent merges.
So we need to revert the revert to get the changes.

Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Eike Ziller
2021-05-07 09:19:39 +02:00
parent 635993fbdc
commit bf5b1d714c
42 changed files with 415 additions and 335 deletions

View File

@@ -49,6 +49,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/editormanager/documentmodel.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/kitmanager.h>
@@ -1073,6 +1074,23 @@ QStringList Project::availableQmlPreviewTranslations(QString *errorMessage)
});
}
QList<Core::IDocument *> Project::modifiedDocuments() const
{
QList<Core::IDocument *> modifiedProjectDocuments;
for (Core::IDocument *doc : Core::DocumentModel::openedDocuments()) {
if (doc->isModified() && isKnownFile(doc->filePath()))
modifiedProjectDocuments.append(doc);
}
return modifiedProjectDocuments;
}
bool Project::isModified() const
{
return !modifiedDocuments().isEmpty();
}
#if defined(WITH_TESTS)
} // namespace ProjectExplorer