Commit ec1afd58 authored by Christoph Cullmann's avatar Christoph Cullmann

adapt to ApplicationPlugin => Plugin change

parent deaf3c90
......@@ -54,7 +54,7 @@
K_PLUGIN_FACTORY_WITH_JSON (KateKonsolePluginFactory, "katekonsoleplugin.json", registerPlugin<KateKonsolePlugin>();)
KateKonsolePlugin::KateKonsolePlugin( QObject* parent, const QList<QVariant>& ):
KTextEditor::ApplicationPlugin ( parent )
KTextEditor::Plugin ( parent )
{
m_previousEditorEnv=qgetenv("EDITOR");
if (!KAuthorized::authorizeKAction(QLatin1String("shell_access")))
......
......@@ -21,7 +21,7 @@
#ifndef __KATE_CONSOLE_H__
#define __KATE_CONSOLE_H__
#include <ktexteditor/applicationplugin.h>
#include <KTextEditor/Plugin>
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/configpageinterface.h>
#include <ktexteditor/configpage.h>
......@@ -41,7 +41,7 @@ namespace KParts
class KateConsole;
class KateKonsolePluginView;
class KateKonsolePlugin: public KTextEditor::ApplicationPlugin, public KTextEditor::ConfigPageInterface
class KateKonsolePlugin: public KTextEditor::Plugin, public KTextEditor::ConfigPageInterface
{
Q_OBJECT
Q_INTERFACES(KTextEditor::ConfigPageInterface)
......
[Desktop Entry]
Type=Service
ServiceTypes=KTextEditor/ApplicationPlugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katekonsoleplugin
Name=Terminal tool view
Name[ast]=Vista de la ferramienta de terminal
......
......@@ -42,7 +42,7 @@
#endif
KateProjectPlugin::KateProjectPlugin (QObject* parent, const QList<QVariant>&)
: KTextEditor::ApplicationPlugin (parent)
: KTextEditor::Plugin (parent)
, m_completion (this)
{
/**
......
[Desktop Entry]
Type=Service
ServiceTypes=KTextEditor/ApplicationPlugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=kateprojectplugin
Name=Project Plugin
Name[bg]=Приставка за проекти
......
......@@ -26,14 +26,14 @@
#include <ktexteditor/document.h>
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/applicationplugin.h>
#include <KTextEditor/Plugin>
#include <kxmlguiclient.h>
#include "kateproject.h"
#include "kateprojectcompletion.h"
class KateProjectPlugin : public KTextEditor::ApplicationPlugin
class KateProjectPlugin : public KTextEditor::Plugin
{
Q_OBJECT
......
[Desktop Entry]
Type=Service
ServiceTypes=KTextEditor/ApplicationPlugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katesearchplugin
Name=Search & Replace
Name[bg]=Търсене и &замяна
......
......@@ -120,7 +120,7 @@ Results::Results(QWidget *parent): QWidget(parent), matches(0)
K_PLUGIN_FACTORY_WITH_JSON (KatePluginSearchFactory, "katesearch.json", registerPlugin<KatePluginSearch>();)
KatePluginSearch::KatePluginSearch(QObject* parent, const QList<QVariant>&)
: KTextEditor::ApplicationPlugin (parent),
: KTextEditor::Plugin (parent),
m_searchCommand(0)
{
// FIXME KF5
......@@ -225,7 +225,7 @@ void KatePluginSearchView::nextFocus(QWidget *currentWidget, bool *found, bool n
}
}
KatePluginSearchView::KatePluginSearchView(KTextEditor::ApplicationPlugin *plugin, KTextEditor::MainWindow *mainWin, KTextEditor::Application* application)
KatePluginSearchView::KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin, KTextEditor::Application* application)
: QObject (mainWin),
m_kateApp(application),
m_curResults(0),
......
......@@ -22,7 +22,7 @@
#define _PLUGIN_SEARCH_H_
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/applicationplugin.h>
#include <KTextEditor/Plugin>
#include <ktexteditor/application.h>
#include <ktexteditor/commandinterface.h>
#include <ktexteditor/sessionconfiginterface.h>
......@@ -71,7 +71,7 @@ protected:
};
class KatePluginSearch : public KTextEditor::ApplicationPlugin
class KatePluginSearch : public KTextEditor::Plugin
{
Q_OBJECT
......@@ -93,7 +93,7 @@ class KatePluginSearchView : public QObject, public KXMLGUIClient, public KTextE
Q_INTERFACES(KTextEditor::SessionConfigInterface)
public:
KatePluginSearchView(KTextEditor::ApplicationPlugin *plugin, KTextEditor::MainWindow *mainWindow, KTextEditor::Application* application);
KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWindow, KTextEditor::Application* application);
~KatePluginSearchView();
void readSessionConfig (const KConfigGroup& config);
......
......@@ -36,7 +36,7 @@
K_PLUGIN_FACTORY_WITH_JSON (KateSnippetsPluginFactory, "katesnippetsplugin.json", registerPlugin<KateSnippetsPlugin>();)
KateSnippetsPlugin::KateSnippetsPlugin( QObject* parent, const QList<QVariant>& ):
KTextEditor::ApplicationPlugin ( parent )
KTextEditor::Plugin ( parent )
, m_snippetGlobal (new KateSnippetGlobal (this))
{
}
......
......@@ -21,7 +21,7 @@
#ifndef __KATE_SNIPPETS_H__
#define __KATE_SNIPPETS_H__
#include <KTextEditor/ApplicationPlugin>
#include <KTextEditor/Plugin>
#include <KTextEditor/MainWindow>
#include <KTextEditor/Application>
#include <KTextEditor/Editor>
......@@ -30,7 +30,7 @@
class KateSnippetsPluginView;
class KateSnippetsPlugin: public KTextEditor::ApplicationPlugin
class KateSnippetsPlugin: public KTextEditor::Plugin
{
Q_OBJECT
......
[Desktop Entry]
Type=Service
ServiceTypes=KTextEditor/ApplicationPlugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katesnippetsplugin
Name=Snippets tool view
Name[bs]=Pregledač isječaka
......
......@@ -438,7 +438,7 @@ void KateApp::emitDocumentClosed(const QString& token)
m_adaptor->emitDocumentClosed(token);
}
KTextEditor::ApplicationPlugin *KateApp::plugin (const QString &name)
KTextEditor::Plugin *KateApp::plugin (const QString &name)
{
return m_pluginManager->plugin (name);
}
......
......@@ -303,7 +303,7 @@ class KATE_TESTS_EXPORT KateApp : public QObject
* \param name the plugin's name
* \return pointer to the plugin if a plugin with \p name is loaded, otherwise nullptr
*/
KTextEditor::ApplicationPlugin *plugin (const QString &name);
KTextEditor::Plugin *plugin (const QString &name);
private:
/**
......
......@@ -246,7 +246,7 @@ void KateConfigDialog::addEditorPages() {
}
}
void KateConfigDialog::addPluginPage (KTextEditor::ApplicationPlugin *plugin)
void KateConfigDialog::addPluginPage (KTextEditor::Plugin *plugin)
{
if (!qobject_cast<KTextEditor::ConfigPageInterface*>(plugin))
return;
......@@ -286,7 +286,7 @@ void KateConfigDialog::slotCurrentPageChanged( KPageWidgetItem *current, KPageWi
connect( info->pluginPage, SIGNAL(changed()), this, SLOT(slotChanged()) );
}
void KateConfigDialog::removePluginPage (KTextEditor::ApplicationPlugin *plugin)
void KateConfigDialog::removePluginPage (KTextEditor::Plugin *plugin)
{
if (!qobject_cast<KTextEditor::ConfigPageInterface*>(plugin))
return;
......
......@@ -22,7 +22,7 @@
#ifndef __kate_configdialog_h__
#define __kate_configdialog_h__
#include <ktexteditor/applicationplugin.h>
#include <KTextEditor/Plugin>
#include <ktexteditor/configpageinterface.h>
#include <ktexteditor/editor.h>
......@@ -39,7 +39,7 @@ class KateMainWindow;
struct PluginPageListItem
{
KTextEditor::ApplicationPlugin *plugin;
KTextEditor::Plugin *plugin;
KTextEditor::ConfigPageInterface *configPageInterface;
uint idInPlugin;
KTextEditor::ConfigPage *pluginPage;
......@@ -56,8 +56,8 @@ class KateConfigDialog : public KPageDialog
~KateConfigDialog ();
public:
void addPluginPage (KTextEditor::ApplicationPlugin *plugin);
void removePluginPage (KTextEditor::ApplicationPlugin *plugin);
void addPluginPage (KTextEditor::Plugin *plugin);
void removePluginPage (KTextEditor::Plugin *plugin);
void showAppPluginPage(KTextEditor::ConfigPageInterface *configpageinterface,uint id);
protected Q_SLOTS:
void slotApply();
......
......@@ -1006,7 +1006,7 @@ bool KateMainWindow::event( QEvent *e )
QObject *KateMainWindow::pluginView (const QString &name)
{
KTextEditor::ApplicationPlugin *plugin = KateApp::self()->pluginManager()->plugin (name);
KTextEditor::Plugin *plugin = KateApp::self()->pluginManager()->plugin (name);
if (!plugin)
return 0;
......@@ -1042,7 +1042,7 @@ void KateMainWindow::slotQuickOpen ()
}
}
QWidget *KateMainWindow::createToolView (KTextEditor::ApplicationPlugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text)
QWidget *KateMainWindow::createToolView (KTextEditor::Plugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text)
{
// FIXME KF5
return KateMDI::MainWindow::createToolView (plugin, identifier, (KMultiTabBar::KMultiTabBarPosition) (pos), icon.pixmap(QSize (16, 16)), text);
......
......@@ -223,7 +223,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
public:
void openUrl (const QString &name = QString());
QHash<KTextEditor::ApplicationPlugin*, QObject*> &pluginViews ()
QHash<KTextEditor::Plugin*, QObject*> &pluginViews ()
{
return m_pluginViews;
}
......@@ -357,7 +357,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
* \param text translated text (i18n()) to use in addition to icon
* \return created toolview on success, otherwise NULL
*/
QWidget *createToolView (KTextEditor::ApplicationPlugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text);
QWidget *createToolView (KTextEditor::Plugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text);
/**
* Move the toolview \p widget to position \p pos.
......@@ -431,7 +431,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
bool m_modignore;
// all plugin views for this mainwindow, used by the pluginmanager
QHash<KTextEditor::ApplicationPlugin*, QObject*> m_pluginViews;
QHash<KTextEditor::Plugin*, QObject*> m_pluginViews;
// options: show statusbar + show path
KToggleAction *m_paShowPath;
......
......@@ -791,7 +791,7 @@ namespace KateMDI
return m_centralWidget;
}
ToolView *MainWindow::createToolView (KTextEditor::ApplicationPlugin* plugin, const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QPixmap &icon, const QString &text)
ToolView *MainWindow::createToolView (KTextEditor::Plugin* plugin, const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QPixmap &icon, const QString &text)
{
if (m_idToWidget[identifier])
return 0;
......
......@@ -21,7 +21,7 @@
#ifndef __KATE_MDI_H__
#define __KATE_MDI_H__
#include <KTextEditor/ApplicationPlugin>
#include <KTextEditor/Plugin>
#include <KParts/MainWindow>
......@@ -154,7 +154,7 @@ namespace KateMDI
Sidebar *m_sidebar;
///plugin this view belongs to, may be 0
QPointer<KTextEditor::ApplicationPlugin> plugin;
QPointer<KTextEditor::Plugin> plugin;
/**
* unique id
......@@ -293,7 +293,7 @@ namespace KateMDI
* @param text text to use in addition to icon
* @return created toolview on success or 0
*/
ToolView *createToolView (KTextEditor::ApplicationPlugin *plugin, const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QPixmap &icon, const QString &text);
ToolView *createToolView (KTextEditor::Plugin *plugin, const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QPixmap &icon, const QString &text);
/**
* give you handle to toolview for the given name, 0 if no toolview around
......
......@@ -58,7 +58,7 @@ KatePluginManager *KatePluginManager::self()
void KatePluginManager::setupPluginList ()
{
KService::List traderList = KServiceTypeTrader::self()->query(QLatin1String("KTextEditor/ApplicationPlugin"));
KService::List traderList = KServiceTypeTrader::self()->query(QLatin1String("KTextEditor/Plugin"));
KatePluginList alwaysLoad;
KatePluginList others;
......@@ -179,7 +179,7 @@ void KatePluginManager::disableAllPluginsGUI (KateMainWindow *win)
void KatePluginManager::loadPlugin (KatePluginInfo *item)
{
const QString pluginName = item->service->library();
item->load = (item->plugin = item->service->createInstance<KTextEditor::ApplicationPlugin>(this, QVariantList() << pluginName));
item->load = (item->plugin = item->service->createInstance<KTextEditor::Plugin>(this, QVariantList() << pluginName));
if (item->plugin)
emit KateApp::self ()->wrapper()->pluginCreated (pluginName, item->plugin);
}
......@@ -188,7 +188,7 @@ void KatePluginManager::unloadPlugin (KatePluginInfo *item)
{
disablePluginGUI (item);
delete item->plugin;
KTextEditor::ApplicationPlugin *plugin = item->plugin;
KTextEditor::Plugin *plugin = item->plugin;
item->plugin = 0L;
item->load=false;
emit KateApp::self ()->wrapper()->pluginDeleted (item->service->library(), plugin);
......@@ -262,7 +262,7 @@ void KatePluginManager::disablePluginGUI (KatePluginInfo *item)
disablePluginGUI (item, KateApp::self()->mainWindow(i));
}
KTextEditor::ApplicationPlugin *KatePluginManager::plugin (const QString &name)
KTextEditor::Plugin *KatePluginManager::plugin (const QString &name)
{
/**
* name known?
......@@ -281,7 +281,7 @@ bool KatePluginManager::pluginAvailable (const QString &name)
return m_name2Plugin.contains (name);
}
class KTextEditor::ApplicationPlugin *KatePluginManager::loadPlugin (const QString &name, bool permanent)
class KTextEditor::Plugin *KatePluginManager::loadPlugin (const QString &name, bool permanent)
{
/**
* name known?
......
......@@ -22,7 +22,7 @@
#ifndef __KATE_PLUGINMANAGER_H__
#define __KATE_PLUGINMANAGER_H__
#include <KTextEditor/ApplicationPlugin>
#include <KTextEditor/Plugin>
#include <KService>
#include <KConfigBase>
......@@ -38,7 +38,7 @@ class KatePluginInfo
bool load;
bool alwaysLoad;
KService::Ptr service;
KTextEditor::ApplicationPlugin *plugin;
KTextEditor::Plugin *plugin;
QString saveName() const;
};
......@@ -76,10 +76,10 @@ class KatePluginManager : public QObject
return m_pluginList;
}
KTextEditor::ApplicationPlugin *plugin (const QString &name);
KTextEditor::Plugin *plugin (const QString &name);
bool pluginAvailable (const QString &name);
KTextEditor::ApplicationPlugin *loadPlugin (const QString &name, bool permanent = true);
KTextEditor::Plugin *loadPlugin (const QString &name, bool permanent = true);
void unloadPlugin (const QString &name, bool permanent = true);
private:
......
......@@ -50,7 +50,7 @@ Q_LOGGING_CATEGORY(FILETREE, "kate-filetree")
//BEGIN KateFileTreePlugin
KateFileTreePlugin::KateFileTreePlugin(QObject* parent, const QList<QVariant>&)
: KTextEditor::ApplicationPlugin (parent),
: KTextEditor::Plugin (parent),
m_fileCommand(0)
{
// TODO: Remove once Qt allows an external app to change a debug category (ETA Qt 5.3)
......
[Desktop Entry]
Type=Service
ServiceTypes=KTextEditor/ApplicationPlugin
ServiceTypes=KTextEditor/Plugin
X-KDE-Library=katefiletreeplugin
Name=File Tree
Name[ar]=شجرة الملفات
......
......@@ -24,7 +24,7 @@
#include <ktexteditor/commandinterface.h>
#include <ktexteditor/document.h>
#include <ktexteditor/editor.h>
#include <ktexteditor/applicationplugin.h>
#include <KTextEditor/Plugin>
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/configpageinterface.h>
#include <ktexteditor/sessionconfiginterface.h>
......@@ -40,7 +40,7 @@ class KateFileTreeConfigPage;
class KateFileTreePluginView;
class KateFileTreeCommand;
class KateFileTreePlugin: public KTextEditor::ApplicationPlugin, public KTextEditor::ConfigPageInterface
class KateFileTreePlugin: public KTextEditor::Plugin, public KTextEditor::ConfigPageInterface
{
Q_OBJECT
Q_INTERFACES(KTextEditor::ConfigPageInterface)
......
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