forked from qt-creator/qt-creator
CPaster: Prefer ITextEditor over BaseTextEditor
Change-Id: I7441ec514cebae6a6a0166463a7362d9d9b178a8 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QDebug>
|
||||
@@ -206,12 +206,12 @@ void CodepasterPlugin::postEditor()
|
||||
{
|
||||
QString data;
|
||||
QString mimeType;
|
||||
if (const IEditor* editor = EditorManager::instance()->currentEditor()) {
|
||||
if (const BaseTextEditor *textEditor = qobject_cast<const BaseTextEditor *>(editor)) {
|
||||
if (IEditor* editor = EditorManager::instance()->currentEditor()) {
|
||||
if (ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor)) {
|
||||
data = textEditor->selectedText();
|
||||
if (data.isEmpty())
|
||||
data = textEditor->contents();
|
||||
mimeType = textEditor->editorWidget()->mimeType();
|
||||
mimeType = textEditor->document()->mimeType();
|
||||
}
|
||||
}
|
||||
post(data, mimeType);
|
||||
|
||||
Reference in New Issue
Block a user