[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/sysadmin/shaman
From:       Dario Freddi <drf () kde ! org>
Date:       2010-02-16 18:55:42
Message-ID: 1266346542.165042.12056.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1091129 by dafre:

First step in separating libshamancore. Compiles

Signed-off-by: Dario Freddi <drf@kde.org>

 M  +2 -14     libshaman/CMakeLists.txt  
 M  +1 -42     libshaman/PluginLoader.cpp  
 M  +1 -4      libshaman/PluginLoader_p.h  
 A             libshaman/includes/Shaman/Query  
 M  +0 -1      libshaman/scripting/CMakeLists.txt  
 D             libshaman/scripting/gui/CMakeLists.txt  
 D             libshaman/scripting/gui/ScriptGuiPlugin.cpp  
 D             libshaman/scripting/gui/ScriptGuiPlugin.h  
 D             libshaman/scripting/gui/ScriptGuiPluginExport.cpp  
 D             libshaman/scripting/gui/wrapper/PackageGroupWrapper.cpp  
 D             libshaman/scripting/gui/wrapper/PackageGroupWrapper.h  
 D             libshaman/scripting/gui/wrapper/RepositoryWrapper.cpp  
 D             libshaman/scripting/gui/wrapper/RepositoryWrapper.h  
 M  +2 -3      libshaman/shamanbackendinterface.cpp  
 M  +2 -44     libshaman/shamanbase.cpp  
 M  +3 -42     libshaman/shamanbase.h  
 M  +0 -6      libshaman/shamanbase_p.h  
 D             libshaman/shamanguiinterface.cpp  
 D             libshaman/shamanguiinterface.h  
 D             libshaman/shamanguiplugin.cpp  
 D             libshaman/shamanguiplugin.h  
 D             libshaman/shamanguiplugin_p.h  
 M  +1 -1      libshaman/shamanmacros.h.cmake  
 D             libshaman/shamanstatusbarinterface.cpp  
 D             libshaman/shamanstatusbarinterface.h  
 M  +4 -1      shaman/CMakeLists.txt  
 A             shaman/libshamangui (directory)  
 A             shaman/libshamangui/CMakeLists.txt  
 A             shaman/libshamangui/PluginLoader.cpp   \
libshaman/PluginLoader.cpp#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/PluginLoader_p.h   libshaman/PluginLoader_p.h#1090733 [License: \
GPL (v2+)]  A             shaman/libshamangui/scripting (directory)  
 A             shaman/libshamangui/scripting/CMakeLists.txt   \
libshaman/scripting/gui/CMakeLists.txt#1090733  A             \
shaman/libshamangui/scripting/ScriptGuiPlugin.cpp   \
libshaman/scripting/gui/ScriptGuiPlugin.cpp#1090733 [License: GPL (v2+)]  A           \
shaman/libshamangui/scripting/ScriptGuiPlugin.h   \
libshaman/scripting/gui/ScriptGuiPlugin.h#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/scripting/ScriptGuiPluginExport.cpp   \
libshaman/scripting/gui/ScriptGuiPluginExport.cpp#1090733 [License: UNKNOWN]  A       \
shaman/libshamangui/scripting/wrapper (directory)    A             \
shaman/libshamangui/scripting/wrapper/PackageGroupWrapper.cpp   \
libshaman/scripting/gui/wrapper/PackageGroupWrapper.cpp#1090733 [License: GPL (v2+)]  \
A             shaman/libshamangui/scripting/wrapper/PackageGroupWrapper.h   \
libshaman/scripting/gui/wrapper/PackageGroupWrapper.h#1090733 [License: GPL (v2+)]  A \
shaman/libshamangui/scripting/wrapper/RepositoryWrapper.cpp   \
libshaman/scripting/gui/wrapper/RepositoryWrapper.cpp#1090733 [License: GPL (v2+)]  A \
shaman/libshamangui/scripting/wrapper/RepositoryWrapper.h   \
libshaman/scripting/gui/wrapper/RepositoryWrapper.h#1090733 [License: GPL (v2+)]  A   \
shaman/libshamangui/shamanguiinterface.cpp   libshaman/shamanguiinterface.cpp#1090733 \
[License: GPL (v2+)]  A             shaman/libshamangui/shamanguiinterface.h   \
libshaman/shamanguiinterface.h#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/shamanguimacros.cpp   [License: GPL (v2+)]  A             \
shaman/libshamangui/shamanguimacros.h.cmake   libshaman/shamanmacros.h.cmake#1090733  \
A             shaman/libshamangui/shamanguiplugin.cpp   \
libshaman/shamanguiplugin.cpp#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/shamanguiplugin.h   libshaman/shamanguiplugin.h#1090733 [License: \
GPL (v2+)]  A             shaman/libshamangui/shamanguiplugin_p.h   \
libshaman/shamanguiplugin_p.h#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/shamanstatusbarinterface.cpp   \
libshaman/shamanstatusbarinterface.cpp#1090733 [License: GPL (v2+)]  A             \
shaman/libshamangui/shamanstatusbarinterface.h   \
libshaman/shamanstatusbarinterface.h#1090733 [License: GPL (v2+)]


--- trunk/playground/sysadmin/shaman/libshaman/CMakeLists.txt #1091128:1091129
@@ -23,10 +23,7 @@
     shamanbackendpackage.cpp
     shamancoreplugin.cpp
     shamandistupgrade.cpp
-    shamanguiplugin.cpp
-    shamanguiinterface.cpp
     shamanmacros.cpp
-    shamanstatusbarinterface.cpp
     shamancoreinterface.cpp
     shamanbase.cpp
     shamanlocalpackage.cpp
@@ -45,10 +42,6 @@
     HooksEventLoop.cpp
     shamanwidgetfactory.cpp
     shamanquery.cpp
-
-    scripting/gui/ScriptGuiPlugin.cpp
-    scripting/gui/wrapper/PackageGroupWrapper.cpp
-    scripting/gui/wrapper/RepositoryWrapper.cpp
 )
 
 if (USE_SCRIPTED_BACKEND)
@@ -66,7 +59,7 @@
 
 kde4_add_library(shamancore SHARED ${shamancore_SRCS} ${BACKEND_SRCS})
 
-target_link_libraries(shamancore ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} \
${KDE4_KROSSCORE_LIBS} ${BACKEND_LIBS}) +target_link_libraries(shamancore \
${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KROSSCORE_LIBS} ${BACKEND_LIBS})  
 set_target_properties(shamancore PROPERTIES VERSION \
                ${CMAKE_LIBSHAMAN_VERSION_STRING}
                                             SOVERSION \
${CMAKE_LIBSHAMAN_VERSION_MAJOR}) @@ -86,8 +79,6 @@
     shamancoreinterface.h
     shamancoreplugin.h
     shamandistupgrade.h
-    shamanguiinterface.h
-    shamanguiplugin.h
     shamanlocalpackage.h
     shamanmetapackage.h
     shamanpackagegroup.h
@@ -97,7 +88,6 @@
     shamanproviderplugin.h
     shamanquery.h
     shamanrepository.h
-    shamanstatusbarinterface.h
     shamantransactioninterface.h
     shamantransactionquestion.h
     shamanwidgetfactory.h
@@ -114,16 +104,14 @@
     includes/Shaman/CoreInterface
     includes/Shaman/CorePlugin
     includes/Shaman/DistUpgrade
-    includes/Shaman/GuiInterface
-    includes/Shaman/GuiPlugin
     includes/Shaman/LocalPackage
     includes/Shaman/PackageGroup
     includes/Shaman/PluginConfig
     includes/Shaman/Provider
     includes/Shaman/ProviderPackage
     includes/Shaman/ProviderPlugin
+    includes/Shaman/Query
     includes/Shaman/Repository
-    includes/Shaman/StatusBarInterface
     includes/Shaman/TransactionInterface
     includes/Shaman/TransactionQuestion
     includes/Shaman/WidgetFactory
--- trunk/playground/sysadmin/shaman/libshaman/PluginLoader.cpp #1091128:1091129
@@ -14,7 +14,6 @@
 #include <config-shaman.h>
 #include "shamanabstractplugin_p.h"
 #include "shamancoreplugin_p.h"
-#include "shamanguiplugin_p.h"
 #include "shamanbackend_p.h"
 #include "shamanbackendinterface_p.h"
 #include "shamanproviderplugin_p.h"
@@ -22,7 +21,6 @@
 #ifdef USE_SCRIPTED_BACKEND
 #include "scripting/backend/ScriptBackendInterface.h"
 #endif
-#include "scripting/gui/ScriptGuiPlugin.h"
 
 #include <shamanmacros.h>
 
@@ -59,7 +57,6 @@
 
         KSharedConfig::Ptr config;
         QList<CorePlugin*> corePlugins;
-        QList<GuiPlugin*> guiPlugins;
         QList<Provider*> providerPlugins;
         QHash<QString, KConfigGroup> configInterfaces;
 
@@ -130,30 +127,6 @@
             plugin->d_func()->setPluginName(offer->name());
             emit q->corePluginCreated(plugin);
             continue;
-        } else if (ptype == "GUI" && type == Base::Gui) {
-            GuiPlugin * plugin = factory->create< GuiPlugin >(q->parent());
-
-            if ( !plugin ) {
-                // Troubles...
-                kWarning() << "failed to load" << offer->desktopEntryName();
-                continue;
-            }
-
-            if (offer->property("X-KDE-Shaman-plugin-script").isValid()) {
-                // FIXME: force cast
-                ScriptGuiPlugin * scriptPlugin = (ScriptGuiPlugin*)plugin;
-                QString scriptname = INSTALL_PREFIX;
-                scriptname.append("/share/shaman/plugins/");
-                scriptname.append(offer->property("X-KDE-Shaman-plugin-script").toString());
                
-                scriptPlugin->loadScript(scriptname);
-                kDebug() << "Gui-Plugin script" << scriptname;
-            }
-            guiPlugins.append(plugin);
-
-            plugin->init();
-            plugin->d_func()->setPluginName(offer->name());
-            emit q->guiPluginCreated(plugin);
-            continue;
         } else if (ptype == "Provider" && type == Base::Provider) {
             ProviderPlugin * plugin = factory->create< ProviderPlugin \
>(q->parent());  
@@ -187,7 +160,7 @@
         }
     }
 
-    kDebug() << "Plugins loaded. " << corePlugins.count() << "core, " << \
guiPlugins.count() << "gui, " << providerPlugins.count() +    kDebug() << "Plugins \
loaded. " << corePlugins.count() << "core, " << providerPlugins.count()  << \
"provider";  }
 
@@ -198,7 +171,6 @@
 
     // Then all the rest
     d->loadAllPluginsOfType(Base::Core);
-    d->loadAllPluginsOfType(Base::Gui);
     d->loadAllPluginsOfType(Base::Provider);
 
     // Done
@@ -218,9 +190,6 @@
     if (types & Base::Core) {
         d->loadAllPluginsOfType(Base::Core);
     }
-    if (types & Base::Gui) {
-        d->loadAllPluginsOfType(Base::Gui);
-    }
     if (types & Base::Provider) {
         d->loadAllPluginsOfType(Base::Provider);
     }
@@ -280,11 +249,6 @@
     return d->corePlugins;
 }
 
-QList<GuiPlugin*> PluginLoader::guiPlugins()
-{
-    return d->guiPlugins;
-}
-
 QList<Provider*> PluginLoader::providers()
 {
     return d->providerPlugins;
@@ -298,11 +262,6 @@
             rethash.insert(plugin, plugin->d_func()->memberForHook(hook));
         }
     }
-    foreach (GuiPlugin *plugin, d->guiPlugins) {
-        if (plugin->d_func()->memberForHook(hook)) {
-            rethash.insert(plugin, plugin->d_func()->memberForHook(hook));
-        }
-    }
 
     return rethash;
 }
--- trunk/playground/sysadmin/shaman/libshaman/PluginLoader_p.h #1091128:1091129
@@ -25,7 +25,6 @@
 class CorePlugin;
 class AbstractPlugin;
 class Backend;
-class GuiPlugin;
 class ProviderPlugin;
 
 class PluginLoader : public QObject
@@ -39,7 +38,6 @@
         void loadPluginsByType(Base::PluginTypes types);
         void loadPluginsByName(const QStringList &plugins);
 
-        QList<GuiPlugin*> guiPlugins();
         QList<Provider*> providers();
         QList<CorePlugin*> corePlugins();
 
@@ -48,8 +46,7 @@
 
     signals:
         void backendPluginCreated(Shaman::Backend *backend);
-        void corePluginCreated(CorePlugin *gui);
-        void guiPluginCreated(GuiPlugin *gui);
+        void corePluginCreated(CorePlugin *corePlugin);
         void providerCreated(Shaman::Provider *provider);
         void pluginsLoaded();
 
--- trunk/playground/sysadmin/shaman/libshaman/scripting/CMakeLists.txt \
#1091128:1091129 @@ -3,4 +3,3 @@
 #    add_subdirectory(backend)
 #endif (USE_SCRIPTED_BACKEND)
 
-add_subdirectory(gui)
--- trunk/playground/sysadmin/shaman/libshaman/shamanbackendinterface.cpp \
#1091128:1091129 @@ -11,7 +11,6 @@
 #include "shamanbackendinterface_p.h"
 #include "shamanbackend_p.h"
 #include "shamanbase.h"
-#include "shamanstatusbarinterface.h"
 #include "shamantransactioninterface_p.h"
 #include "shamancoreinterface_p.h"
 
@@ -206,7 +205,7 @@
 
 void BackendInterface::showOperationProgress(const QString& operation, int progress)
 {
-    if (Base::instance()->statusBar()) {
+    /*if (Base::instance()->statusBar()) {
         if (progress < 100) {
             Base::instance()->statusBar()->showMessage(operation, \
KIcon("system-software-update").pixmap(16,16), -1);  } else {
@@ -214,7 +213,7 @@
         }
 
         Base::instance()->statusBar()->setProgress(progress);
-    }
+    }*/
 
     // Now emit the signal from the Backend as well
     emit d->backend->operationProgress(operation, progress);
--- trunk/playground/sysadmin/shaman/libshaman/shamanbase.cpp #1091128:1091129
@@ -11,9 +11,7 @@
 #include "shamanbase.h"
 #include "shamanbase_p.h"
 
-#include "shamanguiinterface.h"
 #include "shamancoreinterface.h"
-#include "shamanstatusbarinterface.h"
 #include "PluginLoader_p.h"
 #include "shamanbackend.h"
 #include "shamanproviderplugin.h"
@@ -60,27 +58,13 @@
     delete d_ptr;
 }
 
-void Base::init(OperationMode mode, bool gui)
+void Base::init(OperationMode mode)
 {
     Q_D(Base);
     //Initialize CoreInterface
     d->coreInterface = new CoreInterface(this);
     d->mode = mode;
 
-    if (gui) {
-        if (!d->statusBarInterface) {
-            kWarning() << "No StatusBar set!";
-        }
-        //Initialize GuiInterface
-        d->guiInterface = new GuiInterface(this);
-        connect(d->guiInterface, SIGNAL(createMainWidget(QWidget *)), 
-                this, SIGNAL(createMainWidget(QWidget *)));
-        connect(d->guiInterface, SIGNAL(createDockWidget(Qt::DockWidgetArea, \
                QDockWidget *)),
-                this, SIGNAL(createDockWidget(Qt::DockWidgetArea, QDockWidget *)));
-        connect(d->guiInterface, SIGNAL(createAction(QAction *)),
-                this, SIGNAL(createAction(QAction *)));
-    }
-
     //Initialize PluginLoader
     d->pluginLoader = new PluginLoader(d->config, this);
     connect(d->pluginLoader, SIGNAL(backendPluginCreated(Shaman::Backend*)), \
SLOT(__k__slotBackendCreated(Shaman::Backend*))); @@ -90,18 +74,10 @@
 
     // Load 'em up
     if (d->plugins.isEmpty() && d->pluginTypes == All) {
-        if (!gui) {
-            // All except GUI plugins
-            d->pluginLoader->loadPluginsByType(Core | Provider);
-        } else {
-            d->pluginLoader->loadAllPlugins();
-        }
+        d->pluginLoader->loadAllPlugins();
     } else if (!d->plugins.isEmpty()) {
         d->pluginLoader->loadPluginsByName(d->plugins);
     } else {
-        if (!gui && d->pluginTypes & Gui) {
-            d->pluginTypes ^= Gui;
-        }
         d->pluginLoader->loadPluginsByType(d->pluginTypes);
     }
 }
@@ -132,30 +108,12 @@
     d->plugins = plugins;
 }
 
-void Base::setStatusBar(QStatusBar * bar)
-{
-    Q_D(Base);
-    d->statusBarInterface = new StatusBarInterface(bar, this);
-}
-
-GuiInterface * Base::gui()
-{
-    Q_D(Base);
-    return d->guiInterface;
-}
-
 CoreInterface * Base::core()
 {
     Q_D(Base);
     return d->coreInterface;
 }
 
-StatusBarInterface * Base::statusBar()
-{
-    Q_D(Base);
-    return d->statusBarInterface;
-}
-
 void Base::setConfigurationChanged()
 {
     emit configChanged();
--- trunk/playground/sysadmin/shaman/libshaman/shamanbase.h #1091128:1091129
@@ -68,8 +68,8 @@
         enum PluginType {
             None = 0,
             Core = 1,
-            Gui = 2,
-            Provider = 4,
+            Provider = 2,
+            /* =4 */
             /* =8 */
             /* =16 */
             /* =32 */
@@ -94,28 +94,11 @@
         ~Base();
 
         /**
-         * Sets a StatusBar which gets used by libshaman
-         * @param bar the StatusBar
-         */
-        void setStatusBar(QStatusBar * bar);
-
-        /**
-         * @returns the GuiInterface of the initialized libshaman
-         */
-        GuiInterface * gui();
-
-        /**
          * @returns the CoreInterface of the initialized libshaman
          */
         CoreInterface * core();
 
         /**
-         * @returns the StatusBarInterface of the initialized libshaman
-         * @see setStatusBar()
-         */
-        StatusBarInterface * statusBar();
-
-        /**
          * @returns the configuration file that is used by libshaman
          * @see setConfigurationFile()
          */
@@ -156,33 +139,11 @@
          * Initializes LibShaman. Calling this function will load all plugins \
                specified with
          * setPlugins() (defaults to all plugins available) and initialize the \
                library for being
          * ready to use.
-         *
-         * \param gui set to true if this is a Gui program. If \c false, \
                GuiInterface won't be
-         *            created
          */
-        void init(OperationMode mode = UncachedMode, bool gui = false);
+        void init(OperationMode mode = UncachedMode);
 
     Q_SIGNALS:
         /**
-         * This signals gets emitted every time the library wants to set a new \
                MainWidget of the Gui
-         * @param widget the new MainWidget
-         */
-        void createMainWidget(QWidget * widget);
-
-        /**
-         * This signal gets emitted every time the library wants to add a new \
                DockWidget to the Gui.
-         * @param area the QDockWidgetArea to be used
-         * @param widget the QDockWidget to be added
-         */
-        void createDockWidget(Qt::DockWidgetArea area, QDockWidget * widget);
-
-        /**
-         * This signal gets emitted every time the library wants to add a new Action \
                to the Gui
-         * @param action the new Action
-         */
-        void createAction(QAction * action);
-
-        /**
          * The configuration file changed
          */
         void configChanged();
--- trunk/playground/sysadmin/shaman/libshaman/shamanbase_p.h #1091128:1091129
@@ -14,9 +14,7 @@
 
 #include "shamanbase.h"
 
-#include "shamanguiinterface.h"
 #include "shamancoreinterface.h"
-#include "shamanstatusbarinterface.h"
 #include "shamanbackend.h"
 #include "shamanprovider.h"
 
@@ -28,9 +26,7 @@
     public:
         BasePrivate()
           : pluginLoader(0),
-            guiInterface(0),
             coreInterface(0),
-            statusBarInterface(0),
             config(KGlobal::config()),
             pluginTypes(Base::All)
         {}
@@ -41,9 +37,7 @@
         Base *q_ptr;
 
         PluginLoader * pluginLoader;
-        GuiInterface * guiInterface;
         CoreInterface * coreInterface;
-        StatusBarInterface * statusBarInterface;
         KSharedConfig::Ptr config;
         Base::PluginTypes pluginTypes;
         QStringList plugins;
--- trunk/playground/sysadmin/shaman/libshaman/shamanmacros.h.cmake #1091128:1091129
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
 
-   Copyright (C) 2008 Dario Freddi <drf@kde.org>
+   Copyright (C) 2008-2010 Dario Freddi <drf@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
--- trunk/playground/sysadmin/shaman/shaman/CMakeLists.txt #1091128:1091129
@@ -1,5 +1,8 @@
 project(shaman)
 
+# Compile libshamangui
+add_subdirectory(libshamangui)
+
 set(shaman_SRCS
     src/main.cpp
     src/MainWindow.cpp
@@ -27,7 +30,7 @@
 
 kde4_add_executable(shaman ${shaman_SRCS})
 
-target_link_libraries(shaman shamancore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS} \
${KDE4_KNOTIFYCONFIG_LIBRARY}) +target_link_libraries(shaman shamancore shamangui \
${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY})  
 macro_ensure_version(${KDE_VERSION} 4.3.67 \
SHAMAN_USE_EXPERIMENTAL_NOTIFICATION_ITEM)  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic