From 4f6a5b390b1fc3ef9fc4e78800d290e11c5ab663 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Mon, 5 Mar 2012 12:32:26 +0100
Subject: [PATCH] CPaster: Prefer ITextEditor over BaseTextEditor

Change-Id: I7441ec514cebae6a6a0166463a7362d9d9b178a8
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
---
 src/plugins/cpaster/cpasterplugin.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index fc6fe11e919..94c943d578e 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -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);
-- 
GitLab