summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolseditorsupport.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-03-02 16:30:25 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2009-03-02 16:31:59 +0100
commitb74fcb77029245d0b7e49fc2e5b2d525496d99f9 (patch)
tree6669a0b52a539ea43d421024ab7029649026679f /src/plugins/cpptools/cpptoolseditorsupport.cpp
parenta8cfda0ddb56bb87f79809eb7b523b1fcfe574e3 (diff)
downloadqt-creator-b74fcb77029245d0b7e49fc2e5b2d525496d99f9.tar.gz
Cache the UTF-8 encoded contents of the text editors, and some cleanup in updateEditorSelections().
Diffstat (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 5eba9158e7..63c926dbfa 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -66,12 +66,12 @@ void CppEditorSupport::setTextEditor(TextEditor::ITextEditor *textEditor)
updateDocument();
}
-QString CppEditorSupport::contents()
+QByteArray CppEditorSupport::contents()
{
if (! _textEditor)
- return QString();
+ return QByteArray();
else if (! _cachedContents.isEmpty())
- _cachedContents = _textEditor->contents();
+ _cachedContents = _textEditor->contents().toUtf8();
return _cachedContents;
}
@@ -96,13 +96,15 @@ void CppEditorSupport::updateDocument()
void CppEditorSupport::updateDocumentNow()
{
+ qDebug() << "*** update document now";
+
if (_documentParser.isRunning()) {
_updateDocumentTimer->start(_updateDocumentInterval);
} else {
_updateDocumentTimer->stop();
QStringList sourceFiles(_textEditor->file()->fileName());
- _cachedContents = _textEditor->contents();
+ _cachedContents = _textEditor->contents().toUtf8();
_documentParser = _modelManager->refreshSourceFiles(sourceFiles);
}
}