Commit 890f7216 authored by Eike Ziller's avatar Eike Ziller

Rename QString ITextEditorDocument::contents --> plainText

To differentiate it from the byte array based IDocument::setContents

Change-Id: Icc9600732c2742fb79254a0697870bacce3a59ee
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 5f2fe51c
...@@ -211,7 +211,7 @@ void CodepasterPlugin::postEditor() ...@@ -211,7 +211,7 @@ void CodepasterPlugin::postEditor()
if (ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor)) { if (ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor)) {
data = textEditor->selectedText(); data = textEditor->selectedText();
if (data.isEmpty()) if (data.isEmpty())
data = textEditor->textDocument()->contents(); data = textEditor->textDocument()->plainText();
mimeType = textEditor->document()->mimeType(); mimeType = textEditor->document()->mimeType();
} }
} }
......
...@@ -186,7 +186,7 @@ QByteArray CppEditorSupport::contents() const ...@@ -186,7 +186,7 @@ QByteArray CppEditorSupport::contents() const
const int editorRev = editorRevision(); const int editorRev = editorRevision();
if (m_cachedContentsEditorRevision != editorRev && !m_fileIsBeingReloaded) { if (m_cachedContentsEditorRevision != editorRev && !m_fileIsBeingReloaded) {
m_cachedContentsEditorRevision = editorRev; m_cachedContentsEditorRevision = editorRev;
m_cachedContents = m_textEditor->textDocument()->contents().toUtf8(); m_cachedContents = m_textEditor->textDocument()->plainText().toUtf8();
} }
return m_cachedContents; return m_cachedContents;
......
...@@ -684,7 +684,7 @@ static bool currentTextEditorPosition(ContextData *data) ...@@ -684,7 +684,7 @@ static bool currentTextEditorPosition(ContextData *data)
data->fileName = document->filePath(); data->fileName = document->filePath();
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
int lineNumber = textEditor->currentLine(); int lineNumber = textEditor->currentLine();
QString line = textEditor->textDocument()->contents() QString line = textEditor->textDocument()->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
data->address = DisassemblerLine::addressFromDisassemblyLine(line); data->address = DisassemblerLine::addressFromDisassemblyLine(line);
} else { } else {
...@@ -1843,7 +1843,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor, ...@@ -1843,7 +1843,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
ITextEditorDocument *document = editor->textDocument(); ITextEditorDocument *document = editor->textDocument();
args.fileName = document->filePath(); args.fileName = document->filePath();
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
QString line = document->contents() QString line = document->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
BreakpointResponse needle; BreakpointResponse needle;
needle.type = BreakpointByAddress; needle.type = BreakpointByAddress;
...@@ -1956,7 +1956,7 @@ void DebuggerPluginPrivate::toggleBreakpoint() ...@@ -1956,7 +1956,7 @@ void DebuggerPluginPrivate::toggleBreakpoint()
QTC_ASSERT(textEditor, return); QTC_ASSERT(textEditor, return);
const int lineNumber = textEditor->currentLine(); const int lineNumber = textEditor->currentLine();
if (textEditor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) { if (textEditor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
QString line = textEditor->textDocument()->contents() QString line = textEditor->textDocument()->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line); quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address); toggleBreakpointByAddress(address);
...@@ -2013,7 +2013,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor, ...@@ -2013,7 +2013,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor,
return; return;
if (editor->property("DisassemblerView").toBool()) { if (editor->property("DisassemblerView").toBool()) {
QString line = editor->textDocument()->contents() QString line = editor->textDocument()->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1); .section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line); quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address); toggleBreakpointByAddress(address);
......
...@@ -350,7 +350,7 @@ static Document::Ptr addDefinition(const Snapshot &docTable, ...@@ -350,7 +350,7 @@ static Document::Ptr addDefinition(const Snapshot &docTable,
//! \todo use the InsertionPointLocator to insert at the correct place. //! \todo use the InsertionPointLocator to insert at the correct place.
// (we'll have to extend that class first to do definition insertions) // (we'll have to extend that class first to do definition insertions)
const QString contents = editable->textDocument()->contents(); const QString contents = editable->textDocument()->plainText();
int column; int column;
editable->convertPosition(contents.length(), line, &column); editable->convertPosition(contents.length(), line, &column);
editable->gotoLine(*line, column); editable->gotoLine(*line, column);
......
...@@ -329,7 +329,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopy() const ...@@ -329,7 +329,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopy() const
if (TextEditor::BaseTextDocument *textDocument = qobject_cast<TextEditor::BaseTextDocument *>(document)) { if (TextEditor::BaseTextDocument *textDocument = qobject_cast<TextEditor::BaseTextDocument *>(document)) {
// TODO the language should be a property on the document, not the editor // TODO the language should be a property on the document, not the editor
if (documentModel->editorsForDocument(document).first()->context().contains(ProjectExplorer::Constants::LANG_QMLJS)) if (documentModel->editorsForDocument(document).first()->context().contains(ProjectExplorer::Constants::LANG_QMLJS))
workingCopy.insert(key, textDocument->contents(), textDocument->document()->revision()); workingCopy.insert(key, textDocument->plainText(), textDocument->document()->revision());
} }
} }
......
...@@ -92,7 +92,7 @@ BaseTextDocument::~BaseTextDocument() ...@@ -92,7 +92,7 @@ BaseTextDocument::~BaseTextDocument()
delete d; delete d;
} }
QString BaseTextDocument::contents() const QString BaseTextDocument::plainText() const
{ {
return document()->toPlainText(); return document()->toPlainText();
} }
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
virtual ~BaseTextDocument(); virtual ~BaseTextDocument();
// ITextEditorDocument // ITextEditorDocument
QString contents() const; QString plainText() const;
QString textAt(int pos, int length) const; QString textAt(int pos, int length) const;
QChar characterAt(int pos) const; QChar characterAt(int pos) const;
......
...@@ -46,7 +46,7 @@ QMap<QString, QString> ITextEditor::openedTextDocumentContents() ...@@ -46,7 +46,7 @@ QMap<QString, QString> ITextEditor::openedTextDocumentContents()
if (!textEditorDocument) if (!textEditorDocument)
continue; continue;
QString fileName = textEditorDocument->filePath(); QString fileName = textEditorDocument->filePath();
workingCopy[fileName] = textEditorDocument->contents(); workingCopy[fileName] = textEditorDocument->plainText();
} }
return workingCopy; return workingCopy;
} }
......
...@@ -81,7 +81,7 @@ class TEXTEDITOR_EXPORT ITextEditorDocument : public Core::TextDocument ...@@ -81,7 +81,7 @@ class TEXTEDITOR_EXPORT ITextEditorDocument : public Core::TextDocument
public: public:
explicit ITextEditorDocument(QObject *parent = 0); explicit ITextEditorDocument(QObject *parent = 0);
virtual QString contents() const = 0; virtual QString plainText() const = 0;
virtual QString textAt(int pos, int length) const = 0; virtual QString textAt(int pos, int length) const = 0;
virtual QChar characterAt(int pos) const = 0; virtual QChar characterAt(int pos) const = 0;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment