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()
if (ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor)) {
data = textEditor->selectedText();
if (data.isEmpty())
data = textEditor->textDocument()->contents();
data = textEditor->textDocument()->plainText();
mimeType = textEditor->document()->mimeType();
}
}
......
......@@ -186,7 +186,7 @@ QByteArray CppEditorSupport::contents() const
const int editorRev = editorRevision();
if (m_cachedContentsEditorRevision != editorRev && !m_fileIsBeingReloaded) {
m_cachedContentsEditorRevision = editorRev;
m_cachedContents = m_textEditor->textDocument()->contents().toUtf8();
m_cachedContents = m_textEditor->textDocument()->plainText().toUtf8();
}
return m_cachedContents;
......
......@@ -684,7 +684,7 @@ static bool currentTextEditorPosition(ContextData *data)
data->fileName = document->filePath();
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
int lineNumber = textEditor->currentLine();
QString line = textEditor->textDocument()->contents()
QString line = textEditor->textDocument()->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
data->address = DisassemblerLine::addressFromDisassemblyLine(line);
} else {
......@@ -1843,7 +1843,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
ITextEditorDocument *document = editor->textDocument();
args.fileName = document->filePath();
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
QString line = document->contents()
QString line = document->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
BreakpointResponse needle;
needle.type = BreakpointByAddress;
......@@ -1956,7 +1956,7 @@ void DebuggerPluginPrivate::toggleBreakpoint()
QTC_ASSERT(textEditor, return);
const int lineNumber = textEditor->currentLine();
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);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
......@@ -2013,7 +2013,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor,
return;
if (editor->property("DisassemblerView").toBool()) {
QString line = editor->textDocument()->contents()
QString line = editor->textDocument()->plainText()
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
......
......@@ -350,7 +350,7 @@ static Document::Ptr addDefinition(const Snapshot &docTable,
//! \todo use the InsertionPointLocator to insert at the correct place.
// (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;
editable->convertPosition(contents.length(), line, &column);
editable->gotoLine(*line, column);
......
......@@ -329,7 +329,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopy() const
if (TextEditor::BaseTextDocument *textDocument = qobject_cast<TextEditor::BaseTextDocument *>(document)) {
// TODO the language should be a property on the document, not the editor
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()
delete d;
}
QString BaseTextDocument::contents() const
QString BaseTextDocument::plainText() const
{
return document()->toPlainText();
}
......
......@@ -58,7 +58,7 @@ public:
virtual ~BaseTextDocument();
// ITextEditorDocument
QString contents() const;
QString plainText() const;
QString textAt(int pos, int length) const;
QChar characterAt(int pos) const;
......
......@@ -46,7 +46,7 @@ QMap<QString, QString> ITextEditor::openedTextDocumentContents()
if (!textEditorDocument)
continue;
QString fileName = textEditorDocument->filePath();
workingCopy[fileName] = textEditorDocument->contents();
workingCopy[fileName] = textEditorDocument->plainText();
}
return workingCopy;
}
......
......@@ -81,7 +81,7 @@ class TEXTEDITOR_EXPORT ITextEditorDocument : public Core::TextDocument
public:
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 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