forked from qt-creator/qt-creator
file manager: introduce saveFile() and remove blockFileChange() & unblockFileChange()
this replaces the ever-repeating idiom block/save/unblock with a single call.
This commit is contained in:
@@ -1466,10 +1466,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
|
||||
const QString fileName = handler->currentFileName();
|
||||
if (editor && editor->file()->fileName() == fileName) {
|
||||
// Handle that as a special case for nicer interaction with core
|
||||
Core::IFile *file = editor->file();
|
||||
Core::ICore::instance()->fileManager()->blockFileChange(file);
|
||||
file->save(fileName);
|
||||
Core::ICore::instance()->fileManager()->unblockFileChange(file);
|
||||
Core::ICore::instance()->fileManager()->saveFile(editor->file(), fileName);
|
||||
// Check result by reading back.
|
||||
QFile file3(fileName);
|
||||
file3.open(QIODevice::ReadOnly);
|
||||
|
||||
Reference in New Issue
Block a user