summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppfindreferences.cpp
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/cpptools/cppfindreferences.cpp
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/cpptools/cppfindreferences.cpp')
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 4d31f954fa..c3cc29a986 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -38,6 +38,7 @@
#include <find/searchresultwindow.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/filesearch.h>
+#include <utils/fileutils.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -76,11 +77,11 @@ static QString getSource(const QString &fileName,
if (workingCopy.contains(fileName)) {
return workingCopy.source(fileName);
} else {
- QFile file(fileName);
- if (! file.open(QFile::ReadOnly))
+ Utils::FileReader reader;
+ if (!reader.fetch(fileName)) // ### FIXME error reporting
return QString();
- return QTextStream(&file).readAll(); // ### FIXME
+ return QString::fromLocal8Bit(reader.data()); // ### FIXME encoding
}
}