[Kde-imaging] kdeextragear-libs-1

Gilles Caulier caulier.gilles at free.fr
Tue Jun 15 18:55:20 CEST 2004


CVS commit by cgilles: 

New plugin category identification method based on KAction identification 
required for RawConverter plugin.

CCMAIL: kde-imaging at kde.org


  M +12 -2     kipi-plugins/rawconverter/plugin_rawconverter.cpp   1.12
  M +3 -2      kipi-plugins/rawconverter/plugin_rawconverter.h   1.10
  M +20 -0     libkipi/libkipi/plugin.cpp   1.7
  M +4 -2      libkipi/libkipi/plugin.h   1.12


--- kdeextragear-libs-1/kipi-plugins/rawconverter/plugin_rawconverter.cpp  #1.11:1.12
@@ -104,4 +104,5 @@ bool Plugin_RawConverter::checkBinaries(
     process.clearArguments();
     process.addArgument("kipidcrawclient");
+    
     if (!process.start()) {
         KMessageBox::error(0, i18n("Failed to start Raw Converter Client\n"
@@ -112,4 +113,5 @@ bool Plugin_RawConverter::checkBinaries(
     process.clearArguments();
     process.addArgument("dcraw");
+    
     if (!process.start()) {
         KMessageBox::error(0, i18n("dcraw is required for Raw Image Conversion\n"
@@ -126,4 +128,5 @@ void Plugin_RawConverter::slotActivateSi
     KIPI::ImageCollection images;
     images = interface->currentSelection();
+    
     if ( !images.isValid() )
         return;
@@ -141,4 +144,5 @@ void Plugin_RawConverter::slotActivateBa
     KIPI::ImageCollection images;
     images = interface->currentScope();
+    
     if ( !images.isValid() )
         return;
@@ -166,4 +170,5 @@ void Plugin_RawConverter::slotSetActive(
     images = interface->currentSelection();
     bool single = images.isValid();
+    
     if ( !images.isValid() )
         images = interface->currentAlbum();
@@ -174,7 +179,12 @@ void Plugin_RawConverter::slotSetActive(
 }
 
-KIPI::Category Plugin_RawConverter::category() const
+KIPI::Category Plugin_RawConverter::category( KAction* action )
 {
+    if ( action == singleAction_ )
     return KIPI::TOOLSPLUGIN;
+    else if ( action == batchAction_ )
+       return KIPI::BATCHPLUGIN;
+    else 
+       return KIPI::UNDEFINEDPLUGIN;
 }
 

--- kdeextragear-libs-1/kipi-plugins/rawconverter/plugin_rawconverter.h  #1.9:1.10
@@ -36,6 +36,8 @@ public:
                         const QStringList &args);
     ~Plugin_RawConverter();
-    KIPI::Category category() const;
+    
+    KIPI::Category category( KAction* action );
     virtual void setup( QWidget* widget );
+    
 private:
 

--- kdeextragear-libs-1/libkipi/libkipi/plugin.cpp  #1.6:1.7
@@ -76,2 +76,22 @@ void KIPI::Plugin::setup( QWidget* widge
 }
 
+KIPI::Category KIPI::Plugin::category() const
+{
+    // If this method isn't re-implemented, the host must tested the category with 
+    // the category( KAction* action) method.
+    
+    return KIPI::UNDEFINEDPLUGIN;
+}
+
+KIPI::Category KIPI::Plugin::category( KAction* action )
+{
+    // By default, if this method isn't re-implemented, we use the 
+    // standard category identification method.
+    // A re-implementation of that must be used for differenciate the 
+    // plugins part intégrated in a same plugin (like RawConverter single
+    // and batch).
+    
+    return category();     
+}
+
+

--- kdeextragear-libs-1/libkipi/libkipi/plugin.h  #1.11:1.12
@@ -48,5 +48,6 @@ namespace KIPI
        EXPORTPLUGIN,
        BATCHPLUGIN,
-       COLLECTIONSPLUGIN
+       COLLECTIONSPLUGIN,
+       UNDEFINEDPLUGIN
        };
 
@@ -60,5 +61,6 @@ namespace KIPI
         KActionPtrList actions( QWidget* parent = 0 );
         KActionCollection* actionCollection( QWidget* parent = 0 );
-        virtual Category category() const = 0;
+        virtual Category category() const;
+        virtual Category category( KAction* action );
 
     protected:




More information about the Kde-imaging mailing list