summaryrefslogtreecommitdiff
path: root/src/plugins/designer
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-03-30 15:15:15 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-04-18 14:10:14 +0200
commit45c9cf7a1298feed925d18596c30ac9c6cd1dac5 (patch)
tree6f484122011b76a5f3a2f1915b7b308b1f5058ea /src/plugins/designer
parentfae7dc9584b4e2f2192f8b7a71c428fcaa2ddb70 (diff)
downloadqt-creator-45c9cf7a1298feed925d18596c30ac9c6cd1dac5.tar.gz
add/unify i/o error handling
lots of use of Utils::FileSaver and Utils::FileReader Task-number: QTCREATORBUG-1619
Diffstat (limited to 'src/plugins/designer')
-rw-r--r--src/plugins/designer/qtcreatorintegration.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp
index 138e4e942e..368dcdc381 100644
--- a/src/plugins/designer/qtcreatorintegration.cpp
+++ b/src/plugins/designer/qtcreatorintegration.cpp
@@ -60,6 +60,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <utils/qtcassert.h>
+#include <utils/fileutils.h>
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
@@ -488,9 +489,9 @@ static Document::Ptr getParsedDocument(const QString &fileName, CppModelManagerI
if (workingCopy.contains(fileName)) {
src = workingCopy.source(fileName);
} else {
- QFile file(fileName);
- if (file.open(QFile::ReadOnly))
- src = QTextStream(&file).readAll(); // ### FIXME
+ Utils::FileReader reader;
+ if (reader.fetch(fileName)) // ### FIXME error reporting
+ src = QString::fromLocal8Bit(reader.data()); // ### FIXME encoding
}
QByteArray source = snapshot.preprocessedCode(src, fileName);