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

List:       kde-commits
Subject:    branches/KDE/4.3/kdeutils/ark/kerfuffle
From:       Raphael Kubo da Costa <kubito () gmail ! com>
Date:       2009-07-30 16:21:51
Message-ID: 1248970911.576922.21771.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1004628 by rkcosta:

Backport r1003374 and parts of r1001726.

Use destinationFolder() instead of directly accessing m_destinationFolder and return \
the current directory if none has been set.


 M  +12 -14    batchextract.cpp  
 M  +1 -0      batchextract.h  


--- branches/KDE/4.3/kdeutils/ark/kerfuffle/batchextract.cpp #1004627:1004628
@@ -117,14 +117,7 @@
     }
 
     foreach(Kerfuffle::Archive *archive, m_inputs) {
-        QString finalDestination;
-        if (m_destinationFolder.isEmpty()) {
-            finalDestination = QDir::currentPath();
-        } else {
-            finalDestination = m_destinationFolder;
-        }
-
-        addExtraction(archive, m_preservePaths, finalDestination);
+        addExtraction(archive, m_preservePaths, destinationFolder());
     }
 
     KIO::getJobTracker()->registerJob(this);
@@ -166,7 +159,7 @@
 
     if (!subjobs().size()) {
         if (openDestinationAfterExtraction()) {
-            KUrl destination(m_destinationFolder);
+            KUrl destination(destinationFolder());
             destination.cleanPath();
             KRun::runUrl(destination, "inode/directory", 0);
         }
@@ -210,6 +203,15 @@
     return m_openDestinationAfterExtraction;
 }
 
+QString BatchExtract::destinationFolder()
+{
+    if (m_destinationFolder.isEmpty()) {
+        return QDir::currentPath();
+    } else {
+        return m_destinationFolder;
+    }
+}
+
 void BatchExtract::setDestinationFolder(QString folder)
 {
     if (QFileInfo(folder).isDir()) {
@@ -236,12 +238,8 @@
         dialog->batchModeOption();
     }
 
-    if (m_destinationFolder.isEmpty())
-        dialog->setCurrentUrl(QDir::currentPath());
-    else
-        dialog->setCurrentUrl(m_destinationFolder);
-
     dialog->setAutoSubfolder(m_autoSubfolders);
+    dialog->setCurrentUrl(destinationFolder());
     dialog->setPreservePaths(m_preservePaths);
 
     if (m_inputs.size() == 1) {
--- branches/KDE/4.3/kdeutils/ark/kerfuffle/batchextract.h #1004627:1004628
@@ -50,6 +50,7 @@
     void start();
     void setAutoSubfolder(bool value);
     bool addInput(const KUrl& url);
+    QString destinationFolder();
     bool openDestinationAfterExtraction();
     bool showExtractDialog();
     void setDestinationFolder(QString folder);


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

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