Core: use FilePaths to notify files changed internally

Change-Id: I2fce65ad340f18292fc0286233e78aaf769a130d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-06-22 08:57:36 +02:00
parent 1955c82d5c
commit b6367b6359
10 changed files with 44 additions and 38 deletions

View File

@@ -1041,16 +1041,18 @@ void FindReferences::setPaused(bool paused)
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase)
{
const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);
const Utils::FilePaths filePaths = TextEditor::BaseFileFind::replaceAll(text,
items,
preserveCase);
// files that are opened in an editor are changed, but not saved
QStringList changedOnDisk;
QStringList changedUnsavedEditors;
foreach (const QString &fileName, fileNames) {
if (DocumentModel::documentForFilePath(Utils::FilePath::fromString(fileName)))
changedOnDisk += fileName;
for (const Utils::FilePath &filePath : filePaths) {
if (DocumentModel::documentForFilePath(filePath))
changedOnDisk += filePath.toString();
else
changedUnsavedEditors += fileName;
changedUnsavedEditors += filePath.toString();
}
if (!changedOnDisk.isEmpty())