add/unify i/o error handling

lots of use of Utils::FileSaver and Utils::FileReader

Task-number: QTCREATORBUG-1619
This commit is contained in:
Oswald Buddenhagen
2011-03-30 15:15:15 +02:00
parent fae7dc9584
commit 45c9cf7a12
70 changed files with 632 additions and 710 deletions

View File

@@ -39,6 +39,7 @@
#include <vcsbase/vcsbaseeditorparameterwidget.h>
#include <vcsbase/vcsjobrunner.h>
#include <utils/synchronousprocess.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QtCore/QDir>
@@ -105,10 +106,12 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
}
// By now, there is no hgrc file -> create it
QFile hgrc(workingDirectory.path()+"/.hg/hgrc");
hgrc.open(QIODevice::WriteOnly);
hgrc.write(QString("[paths]\ndefault = %1\n").arg(dstLocation).toUtf8());
hgrc.close();
Utils::FileSaver saver(workingDirectory.path()+"/.hg/hgrc");
saver.write(QString("[paths]\ndefault = %1\n").arg(dstLocation).toUtf8());
if (!saver.finalize()) {
VCSBase::VCSBaseOutputWindow::instance()->appendError(saver.errorString());
return false;
}
// And last update repository
arguments.clear();