[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/canvas

Francisco J. Cruz fj.cruz at supercable.es
Tue Jul 11 22:39:54 BST 2006


SVN commit 561335 by fjcruz:

Gilles's patch about RAW loading.


CCMAIL: digikam-devel at kde.org, caulier.gilles at kdemail.net

 M  +6 -2      canvas.cpp  
 M  +1 -0      canvas.h  
 M  +7 -2      dimginterface.cpp  
 M  +2 -0      dimginterface.h  
 M  +18 -0     imagepluginloader.cpp  
 M  +3 -1      imagepluginloader.h  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #561334:561335
@@ -154,6 +154,7 @@
       : QScrollView(parent)
 {
     viewport()->setBackgroundMode(Qt::NoBackground);
+    viewport()->setMouseTracking(false);
     setFrameStyle( QFrame::NoFrame );
 
     d = new CanvasPrivate;
@@ -206,6 +207,11 @@
 
     d->histoChannelType = ImageHistogram::ValueChannel;
 
+    // ------------------------------------------------------------
+    
+    connect(d->im, SIGNAL(signalColorManagementTool()),
+            this, SIGNAL(signalColorManagementTool()));
+            
     connect(d->im, SIGNAL(signalModified()),
             this, SLOT(slotModified()));
 
@@ -232,8 +238,6 @@
     
     connect(this, SIGNAL(contentsMoving(int, int)),
             this, SLOT(slotContentsMoving(int,int)));
-
-    viewport()->setMouseTracking(false);
 }
 
 void Canvas::customEvent(QCustomEvent *event)
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.h #561334:561335
@@ -166,6 +166,7 @@
     
 signals:
 
+    void signalColorManagementTool();
     void signalZoomChanged(float zoom);
     void signalMaxZoom();
     void signalMinZoom();
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/dimginterface.cpp #561334:561335
@@ -229,9 +229,14 @@
         
         if (d->cmSettings->enableCMSetting)
         {
-            if (QFile::exists(d->cmSettings->workspaceSetting) && 
-                QFile::exists(d->cmSettings->inputSetting))
+            if (d->image.attribute("format").toString() == QString("RAW"))
             {
+                // With RAW files, we load the Color Management image plugin.
+                emit signalColorManagementTool();        
+            }
+            else if (QFile::exists(d->cmSettings->workspaceSetting) && 
+                     QFile::exists(d->cmSettings->inputSetting))
+            {
                 IccTransform trans;
     
                 // First possibility: image has no embedded profile
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/dimginterface.h #561334:561335
@@ -151,6 +151,8 @@
 
 signals:
 
+    void   signalColorManagementTool();
+    
     void   signalModified();
     void   signalUndoStateChanged(bool moreUndo, bool moreRedo, bool canSave);
 
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/imagepluginloader.cpp #561334:561335
@@ -214,6 +214,24 @@
     return 0;
 }
 
+ImagePlugin* ImagePluginLoader::pluginInstance(const QString& libraryName)
+{
+    KTrader::OfferList offers = KTrader::self()->query("Digikam/ImagePlugin");
+    KTrader::OfferList::ConstIterator iter;
+    
+    for(iter = offers.begin(); iter != offers.end(); ++iter)
+    {
+        KService::Ptr service = *iter;
+
+        if(service->library() == libraryName)
+        {
+            return ( pluginIsLoaded(service->name()) );
+        }
+    }
+    
+    return 0;
+}
+
 bool ImagePluginLoader::pluginLibraryIsLoaded(const QString& libraryName)
 {
     KTrader::OfferList offers = KTrader::self()->query("Digikam/ImagePlugin");
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/imagepluginloader.h #561334:561335
@@ -57,6 +57,8 @@
     // Return true if plugin library is loaded in memory.
     // 'libraryName' is internal plugin library name not i18n.
     bool pluginLibraryIsLoaded(const QString& libraryName);
+    
+    ImagePlugin* pluginInstance(const QString& libraryName);
 
 private:
     
@@ -64,7 +66,7 @@
 
 private:
 
-    static ImagePluginLoader             *m_instance;
+    static ImagePluginLoader *m_instance;
 
     ImagePluginLoaderPrivate *d;
 };



More information about the Digikam-devel mailing list