forked from qt-creator/qt-creator
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:
@@ -1335,13 +1335,15 @@ bool QmakePriFileNode::setProVariable(const QString &var, const QStringList &val
|
||||
|
||||
void QmakePriFileNode::save(const QStringList &lines)
|
||||
{
|
||||
Core::DocumentManager::expectFileChange(m_projectFilePath.toString());
|
||||
FileSaver saver(m_projectFilePath.toString(), QIODevice::Text);
|
||||
saver.write(lines.join(QLatin1Char('\n')).toLocal8Bit());
|
||||
saver.finalize(Core::ICore::mainWindow());
|
||||
{
|
||||
FileChangeBlocker changeGuard(m_projectFilePath.toString());
|
||||
FileSaver saver(m_projectFilePath.toString(), QIODevice::Text);
|
||||
saver.write(lines.join(QLatin1Char('\n')).toLocal8Bit());
|
||||
saver.finalize(Core::ICore::mainWindow());
|
||||
|
||||
m_project->projectManager()->notifyChanged(m_projectFilePath);
|
||||
}
|
||||
|
||||
m_project->projectManager()->notifyChanged(m_projectFilePath);
|
||||
Core::DocumentManager::unexpectFileChange(m_projectFilePath.toString());
|
||||
// This is a hack.
|
||||
// We are saving twice in a very short timeframe, once the editor and once the ProFile.
|
||||
// So the modification time might not change between those two saves.
|
||||
|
||||
Reference in New Issue
Block a user