diff options
author | Weblate <noreply@weblate.org> | 2017-11-27 09:55:06 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-11-27 09:55:06 +0000 |
commit | 152a57c8c2844d63f95803128b216c8ab722e6e2 (patch) | |
tree | 0ce13eccbf6ef36df43d4c558657c9699f757d20 /src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp | |
parent | Translated using Weblate (Spanish) (diff) | |
parent | remove file manager dev folder (diff) | |
download | lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.gz lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.bz2 lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp index f110624b..5338efec 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp @@ -10,6 +10,7 @@ #include <QDebug> #include <QDateTime> #include <QCoreApplication> +#include <QTimer> Backend::Backend(QObject *parent) : QObject(parent){ //Setup the backend process @@ -91,14 +92,23 @@ QString Backend::linkTo(QString file){ //Modification routines void Backend::startAdd(QStringList paths){ - //NOTE: All the "paths" have to have the same parent directory + //if(paths.isEmpty() && !insertQueue.isEmpty()){ paths = insertQueue; } //load the queue if(paths.contains(filepath)){ paths.removeAll(filepath); } if(paths.isEmpty()){ return; } + //NOTE: All the "paths" have to have the same parent directory + //Go through and find all the files that contain the same parent dir, and put the rest into the insertQueue + QString parent = paths[0].section("/",0,-2); + insertQueue.clear(); + for(int i=1; i<paths.length(); i++){ + if(paths[i].section("/",0,-2)!=parent){ + insertQueue << paths.takeAt(i); i--; //push this back a bit for later + } + } + //qDebug() << "Start Archive Insert:" << paths << "Queued:" << insertQueue; QStringList args; args << "-c" << "-a"; args << flags; //Now setup the parent dir - QString parent = paths[0].section("/",0,-2); for(int i=0; i<paths.length(); i++){ paths[i] = paths[i].section(parent,1,-1); if(paths[i].startsWith("/")){ paths[i].remove(0,1); } @@ -262,7 +272,11 @@ void Backend::procFinished(int retcode, QProcess::ExitStatus){ } } if(args.contains("-x")){ result = tr("Extraction Finished"); emit ExtractSuccessful(); } - else if(args.contains("-c")){ result = tr("Modification Finished"); emit ArchivalSuccessful(); } + else if(args.contains("-c")){ + result = tr("Modification Finished"); + if(insertQueue.isEmpty()){ emit ArchivalSuccessful(); } + else{ needupdate = false; QTimer::singleShot(0, this, SLOT(startInsertFromQueue())); } + } if(needupdate){ startList(); } else{ emit ProcessFinished(retcode==0, result); result.clear(); } } |