aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
index ad88c8bf..226da9f1 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
@@ -30,14 +30,14 @@ void Backend::loadFile(QString path){
qDebug() << "void Backend::loadFile(QString path) has started";
qDebug() << "Loading Archive:" << path;
filepath = path;
- qDebug () << "BACKEND LOAD- " << "path = " << path;
- qDebug () << "BACKEND LOAD- " << "filepath = " << filepath;
+ //qDebug () << "BACKEND LOAD- " << "path = " << path;
+ //qDebug () << "BACKEND LOAD- " << "filepath = " << filepath;
tmpfilepath = filepath.section("/",0,-2)+"/"+".tmp_larchiver_"+filepath.section("/",-1);
flags.clear();
flags << "-f" << filepath; //add the actual archive path
if(QFile::exists(path)){ startList(); qDebug () << "BACKEND LOAD startList has started";}
else{ contents.clear(); emit ProcessFinished(true, ""); }
- qDebug () << "BACKEND LOAD COMPLETE";
+ //qDebug () << "BACKEND LOAD COMPLETE";
}
bool Backend::canModify(){
@@ -140,9 +140,9 @@ void Backend::startExtract(QString path, bool overwrite, QString file){
}
void Backend::startExtract(QString path, bool overwrite, QStringList files){
- QStringList args;
+ QStringList args; //this is a new/empty list - no need for the check below (KPM)
//remove --ax arg if its still lingering so its not passed to external process
- for(int i=0; i<args.length(); i++){ if(args[i]=="--ax"){ args.removeAt(i);}}
+ //for(int i=0; i<args.length(); i++){ if(args[i]=="--ax"){ args.removeAt(i);}}
args << "-x" << "--no-same-owner";
if(!overwrite){ args << "-k"; }
args << flags;
@@ -225,6 +225,7 @@ void Backend::procFinished(int retcode, QProcess::ExitStatus){
result = tr("Could not read archive");
}else if(result.isEmpty()){
result = tr("Archive Loaded");
+ emit FileLoaded();
}
emit ProcessFinished((retcode==0), result);
result.clear();
@@ -242,6 +243,7 @@ void Backend::procFinished(int retcode, QProcess::ExitStatus){
//Multi-file extract - open the dir instead
QProcess::startDetached("xdg-open \""+ args.last()+"\""); //just extracted to a dir - open it now
}
+
}else if(args.contains("-c") && QFile::exists(tmpfilepath)){
if(retcode==0){
QFile::remove(filepath);
@@ -250,7 +252,7 @@ void Backend::procFinished(int retcode, QProcess::ExitStatus){
QFile::remove(tmpfilepath);
}
}
- if(args.contains("-x")){ result = tr("Extraction Finished"); }
+ if(args.contains("-x")){ result = tr("Extraction Finished"); emit ExtractSuccessful(); }
else if(args.contains("-c")){ result = tr("Modification Finished"); }
if(needupdate){ startList(); }
else{ emit ProcessFinished(retcode==0, result); result.clear(); }
bgstack15