forked from qt-creator/qt-creator
Utils: Remove Utils::FileUtils::renameFile()
There's FilePath::renameFile() nowadays. Change-Id: Id37f24910f0c608ccfa6e52c5608c6707353a073 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -417,13 +417,6 @@ FilePath FileUtils::homePath()
|
|||||||
return FilePath::fromString(QDir::cleanPath(QDir::homePath()));
|
return FilePath::fromString(QDir::cleanPath(QDir::homePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileUtils::renameFile(const FilePath &srcFilePath, const FilePath &tgtFilePath)
|
|
||||||
{
|
|
||||||
QTC_ASSERT(!srcFilePath.needsDevice(), return false);
|
|
||||||
QTC_ASSERT(srcFilePath.scheme() == tgtFilePath.scheme(), return false);
|
|
||||||
return QFile::rename(srcFilePath.path(), tgtFilePath.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*! \class Utils::FilePath
|
/*! \class Utils::FilePath
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ public:
|
|||||||
static FilePath commonPath(const FilePath &oldCommonPath, const FilePath &fileName);
|
static FilePath commonPath(const FilePath &oldCommonPath, const FilePath &fileName);
|
||||||
static QByteArray fileId(const FilePath &fileName);
|
static QByteArray fileId(const FilePath &fileName);
|
||||||
static FilePath homePath();
|
static FilePath homePath();
|
||||||
static bool renameFile(const FilePath &srcFilePath, const FilePath &tgtFilePath);
|
|
||||||
|
|
||||||
static void setDeviceFileHooks(const DeviceFileHooks &hooks);
|
static void setDeviceFileHooks(const DeviceFileHooks &hooks);
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ bool FileUtils::renameFile(const FilePath &orgFilePath, const FilePath &newFileP
|
|||||||
if (vc && vc->supportsOperation(IVersionControl::MoveOperation))
|
if (vc && vc->supportsOperation(IVersionControl::MoveOperation))
|
||||||
result = vc->vcsMove(orgFilePath, newFilePath);
|
result = vc->vcsMove(orgFilePath, newFilePath);
|
||||||
if (!result) // The moving via vcs failed or the vcs does not support moving, fall back
|
if (!result) // The moving via vcs failed or the vcs does not support moving, fall back
|
||||||
result = Utils::FileUtils::renameFile(orgFilePath, newFilePath);
|
result = orgFilePath.renameFile(newFilePath);
|
||||||
if (result) {
|
if (result) {
|
||||||
// yeah we moved, tell the filemanager about it
|
// yeah we moved, tell the filemanager about it
|
||||||
DocumentManager::renamedFile(orgFilePath, newFilePath);
|
DocumentManager::renamedFile(orgFilePath, newFilePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user