forked from qt-creator/qt-creator
TextEditor: Remove RefactoringChanges::createFile()
Dissolve into only caller. Change-Id: I2eaac8bf31c0ecd2dfb863b7fae79af557ccad95 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -166,7 +166,7 @@ public:
|
||||
const bool reindent = true;
|
||||
const bool openEditor = false;
|
||||
const Utils::FilePath newFilePath = newFileName;
|
||||
if (!refactoring.createFile(newFileName, newComponentSource, reindent, openEditor))
|
||||
if (!refactoring.file(newFileName)->create(newComponentSource, reindent, openEditor))
|
||||
return;
|
||||
|
||||
if (path.toString() == currentFileName.toFileInfo().path()) {
|
||||
|
||||
@@ -28,14 +28,6 @@ namespace TextEditor {
|
||||
|
||||
RefactoringChanges::~RefactoringChanges() = default;
|
||||
|
||||
bool RefactoringChanges::createFile(const FilePath &filePath,
|
||||
const QString &contents,
|
||||
bool reindent,
|
||||
bool openEditor) const
|
||||
{
|
||||
return file(filePath)->create(contents, reindent, openEditor);
|
||||
}
|
||||
|
||||
RefactoringFilePtr RefactoringChanges::file(const FilePath &filePath) const
|
||||
{
|
||||
return RefactoringFilePtr(new RefactoringFile(filePath));
|
||||
|
||||
@@ -118,11 +118,6 @@ public:
|
||||
// TODO: Make pure virtual and introduce dedicated subclass for generic refactoring,
|
||||
// so no one instantiates this one by mistake.
|
||||
virtual RefactoringFilePtr file(const Utils::FilePath &filePath) const;
|
||||
|
||||
bool createFile(const Utils::FilePath &filePath,
|
||||
const QString &contents,
|
||||
bool reindent = true,
|
||||
bool openEditor = true) const;
|
||||
};
|
||||
|
||||
} // namespace TextEditor
|
||||
|
||||
Reference in New Issue
Block a user