Use FileChangeBlocker

Use FileChangeBlocker over expecting/unexpecting file changes manually.

Change-Id: I8428841f966d81be477260416c75e91dee795425
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2016-07-18 10:04:42 +02:00
parent 2ec82a2a93
commit 84f1466b01
5 changed files with 21 additions and 32 deletions

View File

@@ -649,7 +649,7 @@ bool PythonProject::saveRawFileList(const QStringList &rawFileList)
bool PythonProject::saveRawList(const QStringList &rawList, const QString &fileName)
{
DocumentManager::expectFileChange(fileName);
FileChangeBlocker changeGuarg(fileName);
// Make sure we can open the file for writing
FileSaver saver(fileName, QIODevice::Text);
if (!saver.hasError()) {
@@ -659,7 +659,6 @@ bool PythonProject::saveRawList(const QStringList &rawList, const QString &fileN
saver.setResult(&stream);
}
bool result = saver.finalize(ICore::mainWindow());
DocumentManager::unexpectFileChange(fileName);
return result;
}