forked from qt-creator/qt-creator
ProjectExplorer: Support moving to different dir when renaming
... files in the project tree. Fixes: QTCREATORBUG-15981 Change-Id: Id704ec0638046e2191638b59e0a597b984d4822a Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -170,8 +170,11 @@ bool FileUtils::renameFile(const FilePath &orgFilePath, const FilePath &newFileP
|
|||||||
if (orgFilePath == newFilePath)
|
if (orgFilePath == newFilePath)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FilePath dir = orgFilePath.absolutePath();
|
const FilePath dir = orgFilePath.absolutePath();
|
||||||
IVersionControl *vc = VcsManager::findVersionControlForDirectory(dir);
|
IVersionControl *vc = VcsManager::findVersionControlForDirectory(dir);
|
||||||
|
const FilePath newDir = newFilePath.absolutePath();
|
||||||
|
if (newDir != dir && !newDir.ensureWritableDir())
|
||||||
|
return false;
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (vc && vc->supportsOperation(IVersionControl::MoveOperation))
|
if (vc && vc->supportsOperation(IVersionControl::MoveOperation))
|
||||||
|
Reference in New Issue
Block a user