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

List:       kde-commits
Subject:    KDE/kdeutils/ark
From:       Raphael Kubo da Costa <kubito () gmail ! com>
Date:       2011-07-18 22:50:05
Message-ID: 20110718225005.90751AC861 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1242114 by rkcosta:

Move destination directory retrieval to ExtractJob.

Part::m_destinationDirectory was only set when the files were
extracted using the extraction dialog.

This meant that if the user had chosen to open the destination
directory after an extraction he would always have his home directory
open when the extraction was done via quick extract or drag'n'drop, as
KRun::runUrl would have an empty KUrl as its parameter.

We now make the destination directory passed to ExtractJob publicly
available, and retrieve it from there.

Forwardport of r1242112.

CCBUG: 188857

 M  +5 -0      kerfuffle/jobs.cpp  
 M  +2 -0      kerfuffle/jobs.h  
 M  +8 -6      part/part.cpp  
 M  +0 -1      part/part.h  


--- trunk/KDE/kdeutils/ark/kerfuffle/jobs.cpp #1242113:1242114
@@ -264,6 +264,11 @@
     }
 }
 
+QString ExtractJob::destinationDirectory() const
+{
+    return m_destinationDir;
+}
+
 AddJob::AddJob(const QStringList& files, const CompressionOptions& options , \
ReadWriteArchiveInterface *interface, QObject *parent)  : Job(interface, parent)
     , m_files(files)
--- trunk/KDE/kdeutils/ark/kerfuffle/jobs.h #1242113:1242114
@@ -119,6 +119,8 @@
 public:
     ExtractJob(const QVariantList& files, const QString& destinationDir, \
ExtractionOptions options, ReadOnlyArchiveInterface *interface, QObject *parent = 0); \
 +    QString destinationDirectory() const;
+
 public slots:
     virtual void doWork();
 
--- trunk/KDE/kdeutils/ark/part/part.cpp #1242113:1242114
@@ -611,8 +611,6 @@
         //this is done to update the quick extract menu
         updateActions();
 
-        m_destinationDirectory = dialog.data()->destinationDirectory().pathOrUrl();
-
         QVariantList files;
 
         //if the user has chosen to extract only selected entries, fetch these
@@ -629,7 +627,8 @@
             options[QLatin1String("PreservePaths")] = true;
         }
 
-        ExtractJob *job = m_model->extractFiles(files, m_destinationDirectory, \
options); +        const QString destinationDirectory = \
dialog.data()->destinationDirectory().pathOrUrl(); +        ExtractJob *job = \
m_model->extractFiles(files, destinationDirectory, options);  registerJob(job);
 
         connect(job, SIGNAL(result(KJob*)),
@@ -692,10 +691,13 @@
         KMessageBox::error(widget(), job->errorString());
     } else {
         if (ArkSettings::openDestinationFolderAfterExtraction()) {
-            KUrl destinationFolder(m_destinationDirectory);
-            destinationFolder.cleanPath();
+            ExtractJob *extractJob = qobject_cast<ExtractJob*>(job);
+            Q_ASSERT(extractJob);
 
-            KRun::runUrl(destinationFolder, QLatin1String( "inode/directory" ), \
widget()); +            KUrl \
destinationDirectory(extractJob->destinationDirectory()); +            \
destinationDirectory.cleanPath(); +
+            KRun::runUrl(destinationDirectory, QLatin1String("inode/directory"), \
widget());  }
 
         if (ArkSettings::closeAfterExtraction()) {
--- trunk/KDE/kdeutils/ark/part/part.h #1242113:1242114
@@ -116,7 +116,6 @@
     QSplitter            *m_splitter;
     KTempDir             *m_previewDir;
     bool                  m_busy;
-    QString               m_destinationDirectory;
 
     KAbstractWidgetJobTracker  *m_jobTracker;
     KParts::StatusBarExtension *m_statusBarExtension;


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

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