Commit 4f6a5b39 authored by Tobias Hunger's avatar Tobias Hunger

CPaster: Prefer ITextEditor over BaseTextEditor

Change-Id: I7441ec514cebae6a6a0166463a7362d9d9b178a8
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent f4cb1ae7
......@@ -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);
......
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