ProjectExplorer: Update header guards also on copying a file

... rather than only on renaming.

Fixes: QTCREATORBUG-26654
Change-Id: I5a723969a078d76cc2e833d5e505ff64a3063bbe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-12-08 16:26:32 +01:00
parent f1a5a1f716
commit f98a15d544
3 changed files with 35 additions and 14 deletions

View File

@@ -56,8 +56,15 @@ struct CORE_EXPORT FileUtils
static void removeFiles(const Utils::FilePaths &filePaths, bool deleteFromFS);
static bool renameFile(const Utils::FilePath &from, const Utils::FilePath &to,
HandleIncludeGuards handleGuards = HandleIncludeGuards::No);
static void updateHeaderFileGuardIfApplicable(const Utils::FilePath &oldFilePath,
const Utils::FilePath &newFilePath,
HandleIncludeGuards handleGuards);
private:
// This method is used to refactor the include guards in the renamed headers
static bool updateHeaderFileGuardAfterRename(const QString &headerPath, const QString &oldHeaderBaseName);
static bool updateHeaderFileGuardAfterRename(const QString &headerPath,
const QString &oldHeaderBaseName);
};
} // namespace Core