forked from qt-creator/qt-creator
ProjectExplorer: Check if the project can rename a specific file
before renaming the file. This adds a new api: FolderNode::canRename(oldFileName, newFileName) that asks the project manager if a specific file renaming could be applied to the project file. Change-Id: I77bae56db06d81fd03e590285d6079abea2c514b Task-number: QTCREATORBUG-14521 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -357,6 +357,13 @@ bool FolderNode::deleteFiles(const QStringList &filePaths)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FolderNode::canRenameFile(const QString &filePath, const QString &newFilePath)
|
||||
{
|
||||
if (projectNode())
|
||||
return projectNode()->canRenameFile(filePath, newFilePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FolderNode::renameFile(const QString &filePath, const QString &newFilePath)
|
||||
{
|
||||
if (projectNode())
|
||||
@@ -629,6 +636,13 @@ bool ProjectNode::deleteFiles(const QStringList &filePaths)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProjectNode::canRenameFile(const QString &filePath, const QString &newFilePath)
|
||||
{
|
||||
Q_UNUSED(filePath);
|
||||
Q_UNUSED(newFilePath);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProjectNode::renameFile(const QString &filePath, const QString &newFilePath)
|
||||
{
|
||||
Q_UNUSED(filePath)
|
||||
|
||||
Reference in New Issue
Block a user