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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Gilles Caulier
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: [hidden email]


 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))));
 
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel