[Digikam-devel] extragear/graphics/digikam/libs/widgets/common

Gilles Caulier caulier.gilles at free.fr
Mon May 22 12:58:03 BST 2006


SVN commit 543546 by cgilles:

digikam from trunk: bugfix in iccpreviewwidget : if a non ICC profile file is selected in KFile dialog, check if the profile handle returned by lcms is valid to prevent a crash.
CCMAIL: digikam-devel at kde.org


 M  +8 -5      iccpreviewwidget.cpp  


--- trunk/extragear/graphics/digikam/libs/widgets/common/iccpreviewwidget.cpp #543545:543546
@@ -116,17 +116,17 @@
 
 void ICCPreviewWidget::showPreview( const KURL &url)
 {
+    clearPreview();
+    
     if (url.isLocalFile())
     {
-        kdDebug() << "Is Local file" << endl;
+        kdDebug() << url << "Is a local file" << endl;
         d->currentURL = url;
         getICCData(d->currentURL);
     }
     else
     {
-        kdDebug() << "Not Local file" << endl;
-        clearPreview();
-        return;
+        kdDebug() << url << "Not a local file" << endl;
     }
 }
 
@@ -152,8 +152,11 @@
     if (!QFileInfo::QFileInfo(url.path()).isFile())
         return;
     
+    cmsErrorAction(LCMS_ERROR_SHOW);    
     tmpProfile = cmsOpenProfileFromFile(QFile::encodeName(url.path()), "r");
-    
+    if (!tmpProfile)
+        return;
+
     d->name->setText(QString("<b>%1</b>").arg(QString(cmsTakeProductName(tmpProfile))));
     d->description->setText(QString("<b>%1</b>").arg(QString(cmsTakeProductDesc(tmpProfile))));
 



More information about the Digikam-devel mailing list