Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5452 - in /branches/work/updater-kde-refactoring/updater-kde/updater: UpdaterApplication.cpp zypp/ZYppUpdater.cpp zypp/ZYppUpdater.h zypp/opensuseupdater_zypp.desktop
  • From: tgoettlicher@xxxxxxxxxxxxxxxx
  • Date: Thu, 26 Apr 2007 10:17:24 -0000
  • Message-id: <20070426101724.4DC03592DD@xxxxxxxxxxxxxxxx>
Author: tgoettlicher
Date: Thu Apr 26 12:17:23 2007
New Revision: 5452

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5452&view=rev
Log:
Rudimentary plugin support: Hard-coded selection of ZYppUpdater backend


Modified:
    branches/work/updater-kde-refactoring/updater-kde/updater/UpdaterApplication.cpp
    branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.cpp
    branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.h
    branches/work/updater-kde-refactoring/updater-kde/updater/zypp/opensuseupdater_zypp.desktop

Modified: branches/work/updater-kde-refactoring/updater-kde/updater/UpdaterApplication.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/branches/work/updater-kde-refactoring/updater-kde/updater/UpdaterApplication.cpp?rev=5452&r1=5451&r2=5452&view=diff
==============================================================================
--- branches/work/updater-kde-refactoring/updater-kde/updater/UpdaterApplication.cpp (original)
+++ branches/work/updater-kde-refactoring/updater-kde/updater/UpdaterApplication.cpp Thu Apr 26 12:17:23 2007
@@ -58,6 +58,7 @@
        //main = new MainWindow(updater->capabilities());
   _main = new MainWindow(UpdaterCapabilities());
        setMainWidget(_main);
+  setupUpdater(_updater);
        _main->checkUpdates();
 
 }
@@ -73,37 +74,42 @@
   for(iter = offers.begin(); iter != offers.end(); ++iter )
   {
     KService::Ptr service = *iter;
-    kdDebug() << " - Plugin: " << service->name() << endl;
+    kdDebug() << "Found plugin: " << service->name() << endl;
 
     int errCode = 0;
     Updater* plugin = KParts::ComponentFactory::createInstanceFromService<Updater> ( service, 0, 0, QStringList(), &errCode);
 
-    if (plugin) {
-      //guiFactory()->addClient(plugin);
-      kdDebug() << "PluginDemo: Loaded plugin " << plugin->name() << endl;
+    // only ZYpp backend supported till now
+    if (plugin && errCode == 0 && service->name() == "ZYpp backend") {
+      _updater = plugin;
+      kdDebug() << "Loaded plugin " << service->name() << endl;
     }
     else 
     {
       switch (errCode)
       {
         case KParts::ComponentFactory::ErrNoServiceFound :
-          kdDebug() << " ! ErrNoServiceFound" << endl;
+          kdDebug() << "Unable to load plugin. ErrNoServiceFound" << endl;
           break;
 
         case KParts::ComponentFactory::ErrServiceProvidesNoLibrary :
-          kdDebug() << " ! ErrServiceProvidesNoLibrary" << endl;
+          kdDebug() << "Unable to load plugin. ErrServiceProvidesNoLibrary" << endl;
           break;
 
         case KParts::ComponentFactory::ErrNoLibrary : 
-          kdDebug() << " ! ErrNoLibrary: " <<  KLibLoader::self()->lastErrorMessage() << endl;
+          kdDebug() << "Unable to load plugin. ErrNoLibrary: " <<  KLibLoader::self()->lastErrorMessage() << endl;
           break;
 
         case KParts::ComponentFactory::ErrNoFactory :         
-          kdDebug() << " ! ErrNoFactory" << endl;
+          kdDebug() << "Unable to load plugin. ErrNoFactory" << endl;
           break;
 
         case KParts::ComponentFactory::ErrNoComponent :        
-          kdDebug() << " ! ErrNoComponent" << endl;
+          kdDebug() << "Unable to load plugin. ErrNoComponent" << endl;
+          break;
+
+        default:
+          kdDebug() << "Unable to load plugin. Unknown Error" << errCode << endl;
           break;
       }
     }

Modified: branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.cpp?rev=5452&r1=5451&r2=5452&view=diff
==============================================================================
--- branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.cpp (original)
+++ branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.cpp Thu Apr 26 12:17:23 2007
@@ -83,7 +83,7 @@
   //setXMLFile("plugindemo_capitalizeui.rc");
 
   // For ease announce that we have been loaded.
-  kdDebug() << "ZmdUpdater plugin loaded" << endl;
+  kdDebug() << "ZyppUpdater plugin loaded" << endl;
 
   kdDebug() << "Initializing zypp backend" << endl;
   doCheckForUpdates();

Modified: branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.h?rev=5452&r1=5451&r2=5452&view=diff
==============================================================================
--- branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.h (original)
+++ branches/work/updater-kde-refactoring/updater-kde/updater/zypp/ZYppUpdater.h Thu Apr 26 12:17:23 2007
@@ -22,7 +22,6 @@
 
 #include "Updater.h"
 #include <qxml.h>
-#include <kdemacros.h>
 
 /**
        @file
@@ -61,7 +60,7 @@
   Error,
 } XmlState;
 
-class KDE_EXPORT ZYppUpdater : public Updater, public QXmlDefaultHandler
+class ZYppUpdater : public Updater, public QXmlDefaultHandler
 {
 Q_OBJECT
  public:

Modified: branches/work/updater-kde-refactoring/updater-kde/updater/zypp/opensuseupdater_zypp.desktop
URL: http://svn.opensuse.org/viewcvs/zypp/branches/work/updater-kde-refactoring/updater-kde/updater/zypp/opensuseupdater_zypp.desktop?rev=5452&r1=5451&r2=5452&view=diff
==============================================================================
--- branches/work/updater-kde-refactoring/updater-kde/updater/zypp/opensuseupdater_zypp.desktop (original)
+++ branches/work/updater-kde-refactoring/updater-kde/updater/zypp/opensuseupdater_zypp.desktop Thu Apr 26 12:17:23 2007
@@ -1,6 +1,6 @@
 [Desktop Entry]
-Name=ZYpp backend.
+Name=ZYpp backend
 Comment=ZYpp backend for openSUSE updater
 ServiceTypes=openSUSEUpdater/Backend
 Type=Service
-X-KDE-Library=opensuseupdater_zypp
\ No newline at end of file
+X-KDE-Library=opensuseupdater_zypp

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages