Commit 280488b1 authored by Christoph Cullmann's avatar Christoph Cullmann

fold commandinterface => editor

parent 5f215fac
......@@ -57,24 +57,14 @@ PluginViewKateOpenHeader::PluginViewKateOpenHeader(PluginKateOpenHeader *plugin,
mainwindow->guiFactory()->addClient (this);
KTextEditor::CommandInterface* cmdIface =
qobject_cast<KTextEditor::CommandInterface*>( KTextEditor::Editor::instance());
if( cmdIface ) {
cmdIface->registerCommand( this );
}
KTextEditor::Editor::instance()->registerCommand( this );
}
PluginViewKateOpenHeader::~PluginViewKateOpenHeader()
{
m_mainWindow->guiFactory()->removeClient (this);
KTextEditor::CommandInterface* cmdIface =
qobject_cast<KTextEditor::CommandInterface*>( KTextEditor::Editor::instance());
if( cmdIface ) {
cmdIface->unregisterCommand( this );
}
KTextEditor::Editor::instance()->unregisterCommand( this );
}
PluginKateOpenHeader::PluginKateOpenHeader( QObject* parent, const QList<QVariant>& )
......
......@@ -126,20 +126,14 @@ KatePluginSearch::KatePluginSearch(QObject* parent, const QList<QVariant>&)
// FIXME KF5
//KGlobal::locale()->insertCatalog("katesearch");
KTextEditor::CommandInterface* iface =
qobject_cast<KTextEditor::CommandInterface*>(KTextEditor::Editor::instance());
if (iface) {
m_searchCommand = new KateSearchCommand(this);
iface->registerCommand(m_searchCommand);
}
m_searchCommand = new KateSearchCommand(this);
KTextEditor::Editor::instance()->registerCommand(m_searchCommand);
}
KatePluginSearch::~KatePluginSearch()
{
KTextEditor::CommandInterface* iface =
qobject_cast<KTextEditor::CommandInterface*>(KTextEditor::Editor::instance());
if (iface && m_searchCommand) {
iface->unregisterCommand(m_searchCommand);
if (m_searchCommand) {
KTextEditor::Editor::instance()->unregisterCommand(m_searchCommand);
}
}
......
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