aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-11-14 15:00:00 -0500
committerKen Moore <ken@ixsystems.com>2017-11-14 15:00:00 -0500
commit94ae313802ba84164214efd28afe75278d8cf483 (patch)
treeb74fc51b9aea0e1ccff286251e4727e61834eb84
parentFix up some initial startmenu sizing. (diff)
downloadlumina-94ae313802ba84164214efd28afe75278d8cf483.tar.gz
lumina-94ae313802ba84164214efd28afe75278d8cf483.tar.bz2
lumina-94ae313802ba84164214efd28afe75278d8cf483.zip
Fix up the insertion of files from multiple directories within the tar backend.
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/MainUI.cpp5
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp20
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.h3
3 files changed, 23 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
index 79c023dc..47c6bfe1 100644
--- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
@@ -95,8 +95,9 @@ void MainUI::LoadArguments(QStringList args){
connect(BACKEND, SIGNAL(FileLoaded()), this, SLOT(autoextractFiles()) );
connect(BACKEND, SIGNAL(ExtractSuccessful()), delayClose, SLOT(start()) );
}else if(action==2){
- aaFileList.clear();
- for(int j=1; j<files.length(); j++){ aaFileList << files[j]; }
+ aaFileList = files;
+ aaFileList.removeFirst();
+ //for(int j=1; j<files.length(); j++){ aaFileList << files[j]; }
qDebug() << "AA Files:" << aaFileList;
connect(BACKEND, SIGNAL(FileLoaded()), this, SLOT(autoArchiveFiles()) );
connect(BACKEND, SIGNAL(ArchivalSuccessful()), delayClose, SLOT(start()) );
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(); }
}
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
index 183cb610..56a7dcfe 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
@@ -50,10 +50,13 @@ private:
QStringList flags;
QHash<QString, QStringList> contents; //<filepath, [attributes, size, compressed size]
+ QStringList insertQueue;
+
bool LIST, STARTING;
void parseLines(QStringList lines);
private slots:
+ void startInsertFromQueue(){ startAdd(insertQueue); }
void startList();
void procFinished(int retcode, QProcess::ExitStatus);
void processData();
bgstack15