aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-archiver
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2018-01-02 22:18:34 +0000
committerWeblate <noreply@weblate.org>2018-01-02 22:18:34 +0000
commit4bf6d3f38634dbb517055444a22d824d6eba99d8 (patch)
treebbe3e3e511f37222cdd9db145bde2f41a35e1260 /src-qt5/desktop-utils/lumina-archiver
parentTranslated using Weblate (Danish) (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.tar.gz
lumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.tar.bz2
lumina-4bf6d3f38634dbb517055444a22d824d6eba99d8.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver')
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/MainUI.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/MainUI.h9
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp13
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.h2
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/lumina-archiver.pro4
5 files changed, 18 insertions, 14 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
index 47c6bfe1..3d901e8c 100644
--- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
@@ -67,6 +67,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
ui->actionUSB_Image->setEnabled(false);
loadIcons();
ui->tree_contents->setHeaderLabels( QStringList() << tr("File") << tr("MimeType") << tr("Size")+" " );
+
+ preservePaths = false;
}
MainUI::~MainUI(){
@@ -296,7 +298,7 @@ void MainUI::simpleExtractFiles(){
void MainUI::autoArchiveFiles(){
qDebug() << "Auto Archive Files:" << aaFileList;
ui->label_progress->setText(tr("Adding Items..."));
- BACKEND->startAdd(aaFileList);
+ BACKEND->startAdd(aaFileList, true);
}
void MainUI::extractSelection(){
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.h b/src-qt5/desktop-utils/lumina-archiver/MainUI.h
index 1a9d287c..0a5c094c 100644
--- a/src-qt5/desktop-utils/lumina-archiver/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.h
@@ -26,13 +26,14 @@ public:
void LoadArguments(QStringList);
void loadIcons();
+ bool preservePaths;
private:
Ui::MainUI *ui;
- Backend *BACKEND;
- QStringList aaFileList, sxList;
- QString sxPath, sxFile;
- QTimer *delayClose;
+ Backend *BACKEND;
+ QStringList aaFileList, sxList;
+ QString sxPath, sxFile;
+ QTimer *delayClose;
QTreeWidgetItem* findItem(QString path, QTreeWidgetItem *start = 0);
bool cleanItems(QStringList list, QTreeWidgetItem *start = 0); //returns true if anything gets cleaned
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
index 5338efec..91e233d0 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
@@ -91,7 +91,7 @@ QString Backend::linkTo(QString file){
}
//Modification routines
-void Backend::startAdd(QStringList paths){
+void Backend::startAdd(QStringList paths, bool absolutePaths){
//if(paths.isEmpty() && !insertQueue.isEmpty()){ paths = insertQueue; } //load the queue
if(paths.contains(filepath)){ paths.removeAll(filepath); }
if(paths.isEmpty()){ return; }
@@ -109,11 +109,12 @@ void Backend::startAdd(QStringList paths){
args << "-c" << "-a";
args << flags;
//Now setup the parent dir
- 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); }
- }
- args << "-C" << parent;
+ if(!absolutePaths) {
+ 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); }
+ }
+ args << "-C" << parent; }
args << paths;
if(QFile::exists(filepath)){ //append to existing
args.replaceInStrings(filepath, tmpfilepath);
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
index 56a7dcfe..cb24a053 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
@@ -33,7 +33,7 @@ public:
QString linkTo(QString file);
//Modification routines
- void startAdd(QStringList paths);
+ void startAdd(QStringList paths, bool absolutePaths = false);
void startRemove(QStringList paths);
void startExtract(QString path, bool overwrite, QString file=""); //path to dir, overwrite, optional file to extract (everything otherwise)
void startExtract(QString path, bool overwrite, QStringList files);
diff --git a/src-qt5/desktop-utils/lumina-archiver/lumina-archiver.pro b/src-qt5/desktop-utils/lumina-archiver/lumina-archiver.pro
index 763407b9..a1b10109 100644
--- a/src-qt5/desktop-utils/lumina-archiver/lumina-archiver.pro
+++ b/src-qt5/desktop-utils/lumina-archiver/lumina-archiver.pro
@@ -87,7 +87,7 @@ TRANSLATIONS = i18n/l-archiver_af.ts \
i18n/l-archiver_zu.ts
dotrans.path=$${L_SHAREDIR}/lumina-desktop/i18n/
-dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$${L_SHAREDIR}/lumina-desktop/i18n/
+dotrans.extra=cd $$PWD/i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$${L_SHAREDIR}/lumina-desktop/i18n/
desktop.files=lumina-archiver.desktop
desktop.path=$${L_SHAREDIR}/applications/
@@ -96,7 +96,7 @@ desktop.path=$${L_SHAREDIR}/applications/
#link.extra=ln -sf lumina-archiver $(INSTALL_ROOT)$${L_BINDIR}/lpac
manpage.path=$${L_MANDIR}/man1/
-manpage.extra="$${MAN_ZIP} lumina-archiver.1 > $(INSTALL_ROOT)$${L_MANDIR}/man1/lumina-archiver.1.gz"
+manpage.extra="$${MAN_ZIP} $$PWD/lumina-archiver.1 > $(INSTALL_ROOT)$${L_MANDIR}/man1/lumina-archiver.1.gz"
INSTALLS += target desktop manpage
bgstack15