[Digikam-devel] extragear/graphics/digikam/utilities/setup

Francisco J. Cruz fj.cruz at supercable.es
Mon Feb 5 16:02:16 GMT 2007


SVN commit 630508 by fjcruz:

Fixed bug 141190: color profiles are tested now to avoid invalid files.

CCMAIL: digikam-devel at kde.org

 M  +25 -0     setupicc.cpp  


--- trunk/extragear/graphics/digikam/utilities/setup/setupicc.cpp #630507:630508
@@ -556,6 +556,31 @@
             { 
                 QString fileName = fileInfo->filePath();
                 tmpProfile       = cmsOpenProfileFromFile(QFile::encodeName(fileName), "r");
+
+                if (tmpProfile == NULL)
+                {
+                    DDebug() << "Error: Parsed profile  is NULL (invalid profile); " << QFile::encodeName(fileName) << endl;
+                    cmsCloseProfile(tmpProfile);
+                    it+=1;
+                    QString message = i18n("<p>The following profile is invalid:</p><p><b>");
+                    message.append(QFile::encodeName(fileName));
+                    message.append("</b></p><p>To avoid this message remove it from color profiles repository</p>");
+                    message.append("<p>Do you want digiKam do it for you?</p>");
+                    if (KMessageBox::warningYesNo(this, message, i18n("Invalid Profile")) == 3)
+                    {
+                        if (QFile::remove(QFile::encodeName(fileName)))
+                        {
+                            KMessageBox::information(this,  i18n("Invalid color profile has been removed"));
+                        }
+                        else
+                        {
+                            KMessageBox::information(this, i18n("<p>digiKam has failed to remove the invalid color profile</p><p>You have to do it manually</p>"));
+                        }
+                    }
+                    
+                    continue;
+                }
+                
                 QString profileDescription = QString((cmsTakeProductDesc(tmpProfile)));
     
                 switch ((int)cmsGetDeviceClass(tmpProfile))



More information about the Digikam-devel mailing list