summaryrefslogtreecommitdiff
path: root/src/plugins/designer/qtcreatorintegration.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/designer/qtcreatorintegration.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/designer/qtcreatorintegration.cpp')
-rw-r--r--src/plugins/designer/qtcreatorintegration.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp
index d792a25928..1297a7f4ac 100644
--- a/src/plugins/designer/qtcreatorintegration.cpp
+++ b/src/plugins/designer/qtcreatorintegration.cpp
@@ -493,13 +493,13 @@ static Document::Ptr getParsedDocument(const QString &fileName,
CppTools::CppModelManagerInterface::WorkingCopy &workingCopy,
Snapshot &snapshot)
{
- QString src;
+ QByteArray src;
if (workingCopy.contains(fileName)) {
src = workingCopy.source(fileName);
} else {
Utils::FileReader reader;
if (reader.fetch(fileName)) // ### FIXME error reporting
- src = QString::fromLocal8Bit(reader.data()); // ### FIXME encoding
+ src = QString::fromLocal8Bit(reader.data()).toUtf8();
}
Document::Ptr doc = snapshot.preprocessedDocument(src, fileName);
@@ -547,7 +547,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
} else {
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy =
CppTools::CppModelManagerInterface::instance()->workingCopy();
- QHashIterator<QString, QPair<QString, unsigned> > it = workingCopy.iterator();
+ QHashIterator<QString, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
while (it.hasNext()) {
it.next();
const QString fileName = it.key();