summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/cdb/cdbengine.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2013-08-19 15:47:51 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2013-09-11 09:43:14 +0200
commitf7c68f6baf104729e8d2fb3a0693b3c59928f8d3 (patch)
treefc0b7227fb28425b65f194d1f6d58bb4d5f53299 /src/plugins/debugger/cdb/cdbengine.cpp
parenteebb1dfcf4d0d4a391a77ab9e095188f63b616e4 (diff)
downloadqt-creator-f7c68f6baf104729e8d2fb3a0693b3c59928f8d3.tar.gz
C++: change working-copy to work on UTF-8 encoded QByteArrays.
These not only take less space than UTF-16 encoded QStrings, but due to the caching in the CppEditorSupport also take less time to build. This patch also fixes a number of possible encoding issues, where files and constant strings were (falsely) assumed to be UTF-8. Change-Id: Ib6f91c9a94ebed5b5dfbd4eb2998825c62c72784 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/debugger/cdb/cdbengine.cpp')
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index c9e894a443..a77480e6f1 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -2702,13 +2702,13 @@ static CPlusPlus::Document::Ptr getParsedDocument(const QString &fileName,
const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy,
const CPlusPlus::Snapshot &snapshot)
{
- QString src;
+ QByteArray src;
if (workingCopy.contains(fileName)) {
src = workingCopy.source(fileName);
} else {
FileReader reader;
if (reader.fetch(fileName)) // ### FIXME error reporting
- src = QString::fromLocal8Bit(reader.data()); // ### FIXME encoding
+ src = QString::fromLocal8Bit(reader.data()).toUtf8();
}
CPlusPlus::Document::Ptr doc = snapshot.preprocessedDocument(src, fileName);