[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/digikam/utilities/queuemanager
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2010-10-01 10:32:41
Message-ID: 20101001103241.7D7A2AC891 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181534 by cgilles:

add the capability to BQM tool to send a error string description to manager and \
display it to history


 M  +3 -0      actionthread.cpp  
 M  +5 -1      basetools/enhance/lensautofix.cpp  
 M  +11 -0     batchtool.cpp  
 M  +8 -0      batchtool.h  
 M  +3 -2      queuemgrwindow.cpp  
 M  +1 -1      queuemgrwindow.h  


--- trunk/extragear/graphics/digikam/utilities/queuemanager/actionthread.cpp \
#1181533:1181534 @@ -171,6 +171,7 @@
             KUrl inUrl;
             KUrl::List tmp2del;
             DImg tmpImage;
+            QString    errMsg;
 
             for (BatchToolMap::const_iterator it = t->item.m_toolsMap.constBegin();
                  !d->cancel && (it != t->item.m_toolsMap.constEnd()) ; ++it)
@@ -202,6 +203,7 @@
                 outUrl   = d->tool->outputUrl();
                 success  = d->tool->apply();
                 tmpImage = d->tool->imageData();
+                errMsg   = d->tool->errorDescription();
                 tmp2del.append(outUrl);
                 d->tool  = 0;
 
@@ -239,6 +241,7 @@
                     ActionData ad5;
                     ad5.fileUrl = t->item.m_itemUrl;
                     ad5.status  = ActionData::BatchFailed;
+                    if (!errMsg.isEmpty()) ad5.message = errMsg;
                     emit finished(ad5);
 
                     break;
--- trunk/extragear/graphics/digikam/utilities/queuemanager/basetools/enhance/lensautofix.cpp \
#1181533:1181534 @@ -193,8 +193,12 @@
         DMetadata    meta(image().getMetadata());
         LensFunIface::MetadataMatch ret = iface.findFromMetadata(meta);
         prm                             = iface.settings();
-        if (ret != LensFunIface::MetadataExactMatch) return false;
+        if (ret != LensFunIface::MetadataExactMatch)
+        {
+            setErrorDescription(i18n("Cannot find all lens information to process \
lens auto-corrections")); +            return false;
     }
+    }
     else
     {
         prm.filterCCA       = settings()["filterCCA"].toBool();
--- trunk/extragear/graphics/digikam/utilities/queuemanager/batchtool.cpp \
#1181533:1181534 @@ -66,6 +66,7 @@
     bool                      cancel;
     bool                      last;
 
+    QString                   errorMessage;
     QString                   toolTitle;          // User friendly tool title.
     QString                   toolDescription;    // User friendly tool description.
 
@@ -131,6 +132,16 @@
     delete d;
 }
 
+QString BatchTool::errorDescription() const
+{
+    return d->errorMessage;
+}
+
+void BatchTool::setErrorDescription(const QString& errmsg)
+{
+    d->errorMessage = errmsg;
+}
+
 BatchTool::BatchToolGroup BatchTool::toolGroup() const
 {
     return d->toolGroup;
--- trunk/extragear/graphics/digikam/utilities/queuemanager/batchtool.h \
#1181533:1181534 @@ -78,6 +78,10 @@
     BatchTool(const QString& name, BatchToolGroup group, QObject* parent=0);
     ~BatchTool();
 
+    /** Get description of an error which appear during apply() method.
+     */
+    QString errorDescription() const;
+
     /** Return group of tool. See BatchToolGroup enum for details.
      */
     BatchToolGroup toolGroup() const;
@@ -210,6 +214,10 @@
 
 protected:
 
+    /** Set string to describe an error which appear during apply() method.
+     */
+    void setErrorDescription(const QString& errmsg);
+
     /** Return a reference of internal DImg container used to modify image data.
      */
     DImg& image() const;
--- trunk/extragear/graphics/digikam/utilities/queuemanager/queuemgrwindow.cpp \
#1181533:1181534 @@ -946,7 +946,7 @@
         }
         case ActionData::BatchFailed:
         {
-            processingFailed(ad.fileUrl);
+            processingFailed(ad.fileUrl, ad.message);
             processOne();
             break;
         }
@@ -1109,12 +1109,13 @@
     d->currentProcessItem = 0;
 }
 
-void QueueMgrWindow::processingFailed(const KUrl&)
+void QueueMgrWindow::processingFailed(const KUrl&, const QString& errMsg)
 {
     if (d->currentProcessItem)
     {
         d->currentProcessItem->setCanceled();
         addHistoryMessage(i18n("Failed to process item..."), \
DHistoryView::ErrorEntry); +        addHistoryMessage(errMsg, \
DHistoryView::ErrorEntry);  }
 
     if (d->currentTaskItem)
--- trunk/extragear/graphics/digikam/utilities/queuemanager/queuemgrwindow.h \
#1181533:1181534 @@ -109,7 +109,7 @@
     void processOne();
     void processing(const KUrl& url);
     void processed(const KUrl& url, const KUrl& tmp);
-    void processingFailed(const KUrl& url);
+    void processingFailed(const KUrl& url, const QString& errMsg);
     void processingCanceled(const KUrl& url);
     void processingAborted();
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic