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 #include #include -#include +#include #include #include @@ -206,12 +206,12 @@ void CodepasterPlugin::postEditor() { QString data; QString mimeType; - if (const IEditor* editor = EditorManager::instance()->currentEditor()) { - if (const BaseTextEditor *textEditor = qobject_cast(editor)) { + if (IEditor* editor = EditorManager::instance()->currentEditor()) { + if (ITextEditor *textEditor = qobject_cast(editor)) { data = textEditor->selectedText(); if (data.isEmpty()) data = textEditor->contents(); - mimeType = textEditor->editorWidget()->mimeType(); + mimeType = textEditor->document()->mimeType(); } } post(data, mimeType);