[Kde-imaging] extragear/libs/kipi-plugins/rawconverter

Gilles Caulier caulier.gilles at free.fr
Thu Sep 14 11:11:06 CEST 2006


SVN commit 584176 by cgilles:

kipi-plugins from trunk : Raw Converter : dcraw version detection at startup. Code come from digiKam project

CCMAIL: kde-imaging at kde.org

CCBUGS: 107905, 128394

 M  +1 -1      Makefile.am  
 A             dcrawbinary.cpp   [License: GPL]
 A             dcrawbinary.h   [License: GPL]
 M  +31 -18    plugin_rawconverter.cpp  


--- trunk/extragear/libs/kipi-plugins/rawconverter/Makefile.am #584175:584176
@@ -12,7 +12,7 @@
 # Srcs for the plugin
 kipiplugin_rawconverter_la_SOURCES = plugin_rawconverter.cpp dcrawiface.cpp savesettingswidget.cpp \
 	                             batchdialog.cpp actionthread.cpp dcrawsettingswidget.cpp \
-	                             singledialog.cpp previewwidget.cpp iccjpeg.c 
+	                             singledialog.cpp previewwidget.cpp iccjpeg.c dcrawbinary.cpp 
 
 # Libs needed by the plugin
 kipiplugin_rawconverter_la_LIBADD = -ljpeg -lpng $(LIB_TIFF) $(LIBKIPI_LIBS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
--- trunk/extragear/libs/kipi-plugins/rawconverter/plugin_rawconverter.cpp #584175:584176
@@ -53,6 +53,7 @@
 // Local includes.
 
 #include "rawfiles.h"
+#include "dcrawbinary.h"
 #include "singledialog.h"
 #include "batchdialog.h"
 #include "plugin_rawconverter.h"
@@ -123,30 +124,42 @@
 
 bool Plugin_RawConverter::checkBinaries()
 {
-    QProcess process;
+    KIPIRawConverterPlugin::DcrawBinary dcrawBinary;
 
-    process.clearArguments();
-    process.addArgument("kipidcrawclient");
-
-    if (!process.start()) 
+    if (!dcrawBinary.isAvailable()) 
     {
-        KMessageBox::error(kapp->activeWindow(), i18n("Failed to start raw converter client.\n"
-                                                      "Please check your installation."));
+        KMessageBox::information(
+                     kapp->activeWindow(),
+                     i18n("<qt><p>Unable to find the dcraw executable:<br> "
+                          "This program is required by this plugin to support raw file decoding. "
+                          "Please install dcraw as a package from your distributor "
+                          "or <a href=\"%1\">download the source</a>.</p>"
+                          "<p>Note: at least, dcraw version %2 is required by this plugin.</p></qt>")
+                          .arg("http://www.cybercom.net/~dcoffin/dcraw")
+                          .arg(dcrawBinary.minimalVersion()),
+                     QString::null,
+                     QString::null,
+                     KMessageBox::Notify | KMessageBox::AllowLink);
         return false;
     }
 
-    process.clearArguments();
-    process.addArgument("dcraw");
-
-    if (!process.start()) 
+    if (!dcrawBinary.versionIsRight()) 
     {
-        KMessageBox::error(kapp->activeWindow(),
-                           i18n("<qt><p>Unable to find the dcraw executable:<br> "
-                                "This program is required to process Raw file formats conversion. "
-                                "Please install dcraw as a package from your distributor "
-                                "or <a href=\"%2\">download the source</a>.</p></qt>")
-                                .arg("http://www.cybercom.net/~dcoffin/dcraw/"));        
-
+        KMessageBox::information(
+                     kapp->activeWindow(),
+                     i18n("<qt><p>dcraw executable isn't up to date:<br> "
+                          "The version %1 of dcraw have been found on your computer. "
+                          "This version is too old to run properlly with this plugin. "
+                          "Please update dcraw as a package from your distributor "
+                          "or <a href=\"%2\">download the source</a>.</p>"
+                          "<p>Note: at least, dcraw version %3 is required by this "
+                          "plugin</p></qt>")
+                          .arg(dcrawBinary.version())
+                          .arg("http://www.cybercom.net/~dcoffin/dcraw")
+                          .arg(dcrawBinary.minimalVersion()),
+                     QString::null,
+                     QString::null,
+                     KMessageBox::Notify | KMessageBox::AllowLink);
         return false;
     }
 


More information about the Kde-imaging mailing list