Commit 4f146f65 authored by Tobias Hunger's avatar Tobias Hunger

Use Core::FileChangeBlocker

Remove class that does something similar.

Reviewed-by: Christian Kandeler
Change-Id: I7acfa119cf18d96c22d1873a464b1c004c78e132
parent 72e01313
......@@ -36,6 +36,7 @@
#include "qt4maemotarget.h"
#include <coreplugin/icore.h>
#include <coreplugin/filemanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
......@@ -299,7 +300,7 @@ QString MaemoDeployableListModel::remoteIconFilePath() const
bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines)
{
MaemoGlobal::FileUpdate update(m_proFilePath);
Core::FileChangeBlocker update(m_proFilePath);
const QLatin1String separator("\n ");
const QString proFileString = QString(QLatin1Char('\n') + proFileScope()
......
......@@ -426,16 +426,5 @@ MaemoGlobal::PackagingSystem MaemoGlobal::packagingSystem(MaemoDeviceConfig::OsV
return static_cast<PackagingSystem>(-1);
}
MaemoGlobal::FileUpdate::FileUpdate(const QString &fileName)
: m_fileName(fileName)
{
Core::FileManager::instance()->expectFileChange(fileName);
}
MaemoGlobal::FileUpdate::~FileUpdate()
{
Core::FileManager::instance()->unexpectFileChange(m_fileName);
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -65,14 +65,6 @@ class MaemoGlobal
public:
enum PackagingSystem { Dpkg, Rpm, Tar };
class FileUpdate {
public:
FileUpdate(const QString &fileName);
~FileUpdate();
private:
const QString m_fileName;
};
static bool isMaemoTargetId(const QString &id);
static bool isFremantleTargetId(const QString &id);
static bool isHarmattanTargetId(const QString &id);
......
......@@ -38,6 +38,7 @@
#include "maemotoolchain.h"
#include "qt4maemodeployconfiguration.h"
#include <coreplugin/filemanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
......@@ -420,7 +421,7 @@ bool AbstractDebBasedQt4MaemoTarget::setProjectVersionInternal(const QString &ve
QString content = QString::fromUtf8(reader.data());
content.replace(QRegExp(QLatin1String("\\([a-zA-Z0-9_\\.]+\\)")),
QLatin1Char('(') + version + QLatin1Char(')'));
MaemoGlobal::FileUpdate update(filePath);
Core::FileChangeBlocker update(filePath);
Utils::FileSaver saver(filePath);
saver.write(content.toUtf8());
return saver.finalize(error);
......@@ -488,7 +489,7 @@ bool AbstractDebBasedQt4MaemoTarget::setPackageManagerIconInternal(const QString
contents.replace(oldIconStartPos, nextEolPos - oldIconStartPos,
' ' + iconAsBase64);
}
MaemoGlobal::FileUpdate update(filePath);
Core::FileChangeBlocker update(filePath);
Utils::FileSaver saver(filePath);
saver.write(contents);
return saver.finalize(error);
......@@ -646,7 +647,7 @@ bool AbstractDebBasedQt4MaemoTarget::setControlFieldValue(const QByteArray &fiel
return false;
QByteArray contents = reader.data();
if (adaptControlFileField(contents, fieldName, fieldValue)) {
MaemoGlobal::FileUpdate update(controlFilePath());
Core::FileChangeBlocker update(controlFilePath());
Utils::FileSaver saver(controlFilePath());
saver.write(contents);
return saver.finalize();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment