[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:       2009-12-26 13:51:06
Message-ID: 1261835466.152452.11814.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1066249 by dafre:

Adding tests

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

 M  +5 -0      libshaman/CMakeLists.txt  
 M  +3 -3      libshaman/PluginLoader.cpp  
 M  +13 -2     libshaman/shamanbase.cpp  
 A             libshaman/tests (directory)  
 A             libshaman/tests/CMakeLists.txt  
 A             libshaman/tests/reloadexample (directory)  
 A             libshaman/tests/reloadexample/CMakeLists.txt  
 A             libshaman/tests/reloadexample/main_reloadexample.cpp   [License: GPL \
(v3+)]  A             libshaman/tests/reloadexample/main_reloadexample.h   [License: \
GPL (v3+)]  A             libshaman/tests/unittests (directory)  
 A             libshaman/tests/unittests/CMakeLists.txt  
 M  +0 -4      shaman/src/MainWindow.cpp  


--- trunk/playground/sysadmin/shaman/libshaman/CMakeLists.txt #1066248:1066249
@@ -130,3 +130,8 @@
 install(FILES ${shamancore_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/shaman)
 install(FILES ${shamancore_capitalized_HDRS} DESTINATION \
${INCLUDE_INSTALL_DIR}/shaman/Shaman)  install(FILES shaman_plugin.desktop \
DESTINATION ${SERVICETYPES_INSTALL_DIR}) +
+option(BUILD_LIBSHAMAN_TESTS "Builds a bunch of examples and tests for LibShaman" \
OFF) +if (BUILD_LIBSHAMAN_TESTS)
+    add_subdirectory(tests)
+endif (BUILD_LIBSHAMAN_TESTS)
--- trunk/playground/sysadmin/shaman/libshaman/PluginLoader.cpp #1066248:1066249
@@ -216,13 +216,13 @@
     d->initBackend();
 
     if (types & Base::Core) {
-        loadPluginsByType(Base::Core);
+        d->loadAllPluginsOfType(Base::Core);
     }
     if (types & Base::Gui) {
-        loadPluginsByType(Base::Gui);
+        d->loadAllPluginsOfType(Base::Gui);
     }
     if (types & Base::Provider) {
-        loadPluginsByType(Base::Provider);
+        d->loadAllPluginsOfType(Base::Provider);
     }
 
     emit pluginsLoaded();
--- trunk/playground/sysadmin/shaman/libshaman/shamanbase.cpp #1066248:1066249
@@ -86,13 +86,21 @@
     connect(d->pluginLoader, SIGNAL(providerCreated(Shaman::Provider*)), \
                SLOT(__k__slotProviderCreated(Shaman::Provider*)));
     connect(d->pluginLoader, SIGNAL(pluginsLoaded()), \
                SLOT(__k__slotSetProviderPlugins()));
     connect(d->pluginLoader, SIGNAL(pluginsLoaded()), this, \
                SLOT(__k__initCompleted()));
-    
+
     // Load 'em up
     if (d->plugins.isEmpty() && d->pluginTypes == All) {
-        d->pluginLoader->loadAllPlugins();
+        if (!gui) {
+            // All except GUI plugins
+            d->pluginLoader->loadPluginsByType(Core | Provider);
+        } else {
+            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);
     }
 }
@@ -177,6 +185,9 @@
     // After doing that, happily start reloading the whole backend
     // Doing this we can start the GUI earlier
     coreInterface->backend()->reload();
+    foreach (Shaman::Provider *provider, coreInterface->providers()) {
+        provider->reload();
+    }
 }
 }
 
--- trunk/playground/sysadmin/shaman/shaman/src/MainWindow.cpp #1066248:1066249
@@ -309,10 +309,6 @@
             m_isFirstReload = false;
         }
         m_isReloading = false;
-        // TODO: Move reloading of providerplugins elsewhere
-        foreach (Shaman::Provider *provider, m_shaman->core()->providers()) {
-            provider->reload();
-        }
     }
 }
 


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

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