TextEditor: Merge PlainTextEditor into Base

Same patter. Plain is fully merged now, so remove the files, too.

Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-07-30 13:13:24 +02:00
parent 068462e52d
commit 1924fdb90f
16 changed files with 45 additions and 155 deletions

View File

@@ -28,7 +28,7 @@
****************************************************************************/
#include "plaintexteditorfactory.h"
#include "plaintexteditor.h"
#include "basetexteditor.h"
#include "basetextdocument.h"
#include "normalindenter.h"
#include "texteditoractionhandler.h"
@@ -80,15 +80,15 @@ Core::IEditor *PlainTextEditorFactory::createEditor()
*/
void PlainTextEditorFactory::updateEditorInfoBar(Core::IEditor *editor)
{
PlainTextEditor *editorEditable = qobject_cast<PlainTextEditor *>(editor);
if (editorEditable) {
BaseTextDocument *file = qobject_cast<BaseTextDocument *>(editor->document());
BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(editor);
if (textEditor) {
Core::IDocument *file = editor->document();
if (!file)
return;
BaseTextEditorWidget *textEditor = editorEditable->editorWidget();
BaseTextEditorWidget *widget = textEditor->editorWidget();
Core::Id infoSyntaxDefinition(Constants::INFO_SYNTAX_DEFINITION);
Core::InfoBar *infoBar = file->infoBar();
if (!textEditor->isMissingSyntaxDefinition()) {
if (!widget->isMissingSyntaxDefinition()) {
infoBar->removeInfo(infoSyntaxDefinition);
} else if (infoBar->canInfoBeAdded(infoSyntaxDefinition)) {
Core::InfoBarEntry info(infoSyntaxDefinition,
@@ -96,7 +96,7 @@ void PlainTextEditorFactory::updateEditorInfoBar(Core::IEditor *editor)
"Would you like to try to find one?"),
Core::InfoBarEntry::GlobalSuppressionEnabled);
info.setCustomButtonInfo(tr("Show Highlighter Options..."),
textEditor, SLOT(acceptMissingSyntaxDefinitionInfo()));
widget, SLOT(acceptMissingSyntaxDefinitionInfo()));
infoBar->addInfo(info);
}
}