summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-23 14:57:55 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-23 14:57:55 (GMT)
commit87d5a0fdb44a5569db573f45fcff54b3791143eb (patch)
tree512bfdf96a767eafb68bebfdcf53babd9c4a9226
parentcea1d82d5793bd8b64b59792058bc7973bf58396 (diff)
cleanup internal API
-rw-r--r--kate/app/kateapp.cpp2
-rw-r--r--kate/app/kateconfigdialog.cpp2
-rw-r--r--kate/app/kateconfigplugindialogpage.cpp10
-rw-r--r--kate/app/katemainwindow.cpp10
-rw-r--r--kate/app/katepluginmanager.cpp5
-rw-r--r--kate/app/katepluginmanager.h3
-rw-r--r--kate/session/katesessionmanager.cpp4
7 files changed, 15 insertions, 21 deletions
diff --git a/kate/app/kateapp.cpp b/kate/app/kateapp.cpp
index 99b2ae5..0857306 100644
--- a/kate/app/kateapp.cpp
+++ b/kate/app/kateapp.cpp
@@ -132,7 +132,7 @@ void KateApp::restoreKate()
sessionManager()->activateSession(lastSession, false, false);
// plugins
- KatePluginManager::self()->loadConfig(sessionConfig);
+ KateApp::self()->pluginManager()->loadConfig(sessionConfig);
// restore the files we need
m_docManager->restoreDocumentList(sessionConfig);
diff --git a/kate/app/kateconfigdialog.cpp b/kate/app/kateconfigdialog.cpp
index 784b18f..896f71a 100644
--- a/kate/app/kateconfigdialog.cpp
+++ b/kate/app/kateconfigdialog.cpp
@@ -203,7 +203,7 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
item->setHeader(i18n("Plugin Manager"));
item->setIcon(QIcon::fromTheme(QStringLiteral("preferences-plugin")));
- KatePluginList &pluginList(KatePluginManager::self()->pluginList());
+ KatePluginList &pluginList(KateApp::self()->pluginManager()->pluginList());
foreach(const KatePluginInfo & plugin, pluginList) {
if (plugin.load
&& qobject_cast<KTextEditor::ConfigPageInterface *>(plugin.plugin)) {
diff --git a/kate/app/kateconfigplugindialogpage.cpp b/kate/app/kateconfigplugindialogpage.cpp
index ec2460d..984d37f 100644
--- a/kate/app/kateconfigplugindialogpage.cpp
+++ b/kate/app/kateconfigplugindialogpage.cpp
@@ -20,8 +20,10 @@
#include "kateconfigplugindialogpage.h"
+#include "kateapp.h"
#include "katepluginmanager.h"
#include "kateconfigdialog.h"
+
#include <KLocalizedString>
#include <QVBoxLayout>
@@ -79,7 +81,7 @@ KateConfigPluginPage::KateConfigPluginPage(QWidget *parent, KateConfigDialog *di
listView->setHeaderLabels(headers);
listView->setWhatsThis(i18n("Here you can see all available Kate plugins. Those with a check mark are loaded, and will be loaded again the next time Kate is started."));
- KatePluginList &pluginList(KatePluginManager::self()->pluginList());
+ KatePluginList &pluginList(KateApp::self()->pluginManager()->pluginList());
for (KatePluginList::iterator it = pluginList.begin(); it != pluginList.end(); ++it) {
if (it->alwaysLoad) {
continue;
@@ -108,8 +110,8 @@ void KateConfigPluginPage::stateChange(KatePluginListItem *item, bool b)
void KateConfigPluginPage::loadPlugin(KatePluginListItem *item)
{
- KatePluginManager::self()->loadPlugin(item->info());
- KatePluginManager::self()->enablePluginGUI(item->info());
+ KateApp::self()->pluginManager()->loadPlugin(item->info());
+ KateApp::self()->pluginManager()->enablePluginGUI(item->info());
myDialog->addPluginPage(item->info()->plugin);
item->setCheckState(0, Qt::Checked);
@@ -118,7 +120,7 @@ void KateConfigPluginPage::loadPlugin(KatePluginListItem *item)
void KateConfigPluginPage::unloadPlugin(KatePluginListItem *item)
{
myDialog->removePluginPage(item->info()->plugin);
- KatePluginManager::self()->unloadPlugin(item->info());
+ KateApp::self()->pluginManager()->unloadPlugin(item->info());
item->setCheckState(0, Qt::Unchecked);
}
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index 3f789b4..cc9ba0e 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -180,7 +180,7 @@ KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
KateApp::self()->addMainWindow(this);
// enable plugin guis
- KatePluginManager::self()->enableAllPluginsGUI(this, sconfig);
+ KateApp::self()->pluginManager()->enableAllPluginsGUI(this, sconfig);
// caption update
for (uint i = 0; i < KateDocManager::self()->documents(); i++) {
@@ -219,7 +219,7 @@ KateMainWindow::~KateMainWindow()
KateApp::self()->removeMainWindow(this);
// disable all plugin guis, delete all pluginViews
- KatePluginManager::self()->disableAllPluginsGUI(this);
+ KateApp::self()->pluginManager()->disableAllPluginsGUI(this);
// delete the view manager, before KateMainWindow's wrapper is dead
delete m_viewManager;
@@ -350,7 +350,7 @@ void KateMainWindow::setupActions()
QAction *settingsConfigure = KStandardAction::preferences(this, SLOT(slotConfigure()), actionCollection());
settingsConfigure->setWhatsThis(i18n("Configure various aspects of this application and the editing component."));
- if (KatePluginManager::self()->pluginList().count() > 0) {
+ if (KateApp::self()->pluginManager()->pluginList().count() > 0) {
a = actionCollection()->addAction(QStringLiteral("help_plugins_contents"));
a->setText(i18n("&Plugins Handbook"));
connect(a, SIGNAL(triggered()), this, SLOT(pluginHelp()));
@@ -910,7 +910,7 @@ void KateMainWindow::saveProperties(KConfigGroup &config)
// store all plugin view states
int id = KateApp::self()->mainWindowID(this);
- foreach(const KatePluginInfo & item, KatePluginManager::self()->pluginList()) {
+ foreach(const KatePluginInfo & item, KateApp::self()->pluginManager()->pluginList()) {
if (item.plugin && pluginViews().contains(item.plugin)) {
if (auto interface = qobject_cast<KTextEditor::SessionConfigInterface *> (pluginViews().value(item.plugin))) {
KConfigGroup group(config.config(), QString::fromLatin1("Plugin:%1:MainWindow:%2").arg(item.saveName()).arg(id));
@@ -931,7 +931,7 @@ void KateMainWindow::readProperties(const KConfigGroup &config)
startRestore(configBase, config.name());
// perhaps enable plugin guis
- KatePluginManager::self()->enableAllPluginsGUI(this, configBase);
+ KateApp::self()->pluginManager()->enableAllPluginsGUI(this, configBase);
finishRestore();
diff --git a/kate/app/katepluginmanager.cpp b/kate/app/katepluginmanager.cpp
index 72a9c32..15536b8 100644
--- a/kate/app/katepluginmanager.cpp
+++ b/kate/app/katepluginmanager.cpp
@@ -50,11 +50,6 @@ KatePluginManager::~KatePluginManager()
unloadAllPlugins();
}
-KatePluginManager *KatePluginManager::self()
-{
- return KateApp::self()->pluginManager();
-}
-
void KatePluginManager::setupPluginList()
{
KService::List traderList = KServiceTypeTrader::self()->query(QStringLiteral("KTextEditor/Plugin"));
diff --git a/kate/app/katepluginmanager.h b/kate/app/katepluginmanager.h
index a5b14f5..df15854 100644
--- a/kate/app/katepluginmanager.h
+++ b/kate/app/katepluginmanager.h
@@ -52,8 +52,6 @@ public:
KatePluginManager(QObject *parent);
~KatePluginManager();
- static KatePluginManager *self();
-
void unloadAllPlugins();
void enableAllPluginsGUI(KateMainWindow *win, KConfigBase *config = 0);
@@ -97,4 +95,3 @@ private:
};
#endif
-
diff --git a/kate/session/katesessionmanager.cpp b/kate/session/katesessionmanager.cpp
index db833c7..05911b6 100644
--- a/kate/session/katesessionmanager.cpp
+++ b/kate/session/katesessionmanager.cpp
@@ -178,7 +178,7 @@ void KateSessionManager::loadSession(const KateSession::Ptr &session) const
// if we have no session config object, try to load the default
// (anonymous/unnamed sessions)
// load plugin config + plugins
- KatePluginManager::self()->loadConfig(sc);
+ KateApp::self()->pluginManager()->loadConfig(sc);
if (loadDocs) {
KateApp::self()->documentManager()->restoreDocumentList(sc);
@@ -299,7 +299,7 @@ bool KateSessionManager::renameSession(KateSession::Ptr session, const QString &
void KateSessionManager::saveSessionTo(KConfig *sc) const
{
// save plugin configs and which plugins to load
- KatePluginManager::self()->writeConfig(sc);
+ KateApp::self()->pluginManager()->writeConfig(sc);
// save document configs + which documents to load
KateDocManager::self()->saveDocumentList(sc);