diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver')
4 files changed, 18 insertions, 4 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index 9d41374c..52831706 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -208,12 +208,16 @@ void MainUI::extractFiles(){ } void MainUI::extractSelection(){ - if(ui->tree_contents->currentItem()==0){ return; } - QString sel = ui->tree_contents->currentItem()->whatsThis(0); + if(ui->tree_contents->currentItem()==0){ return; } //nothing selected + QList<QTreeWidgetItem*> sel = ui->tree_contents->selectedItems(); + if(sel.isEmpty()){ sel << ui->tree_contents->currentItem(); } + QStringList selList; + for(int i=0; i<sel.length(); i++){ selList << sel[i]->whatsThis(0); } + selList.removeDuplicates(); QString dir = QFileDialog::getExistingDirectory(this, tr("Extract Into Directory"), QDir::homePath() ); if(dir.isEmpty()){ return; } ui->label_progress->setText(tr("Extracting...")); - BACKEND->startExtract(dir, true, sel); + BACKEND->startExtract(dir, true, selList); } void MainUI::ViewFile(QTreeWidgetItem *it){ diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.ui b/src-qt5/desktop-utils/lumina-archiver/MainUI.ui index 1aff2e4f..45583ce3 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.ui @@ -47,6 +47,9 @@ </item> <item> <widget class="QTreeWidget" name="tree_contents"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> <column> <property name="text"> <string notr="true">1</string> diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp index ddfd9d52..f87506ec 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp @@ -126,11 +126,17 @@ void Backend::startRemove(QStringList paths){ } void Backend::startExtract(QString path, bool overwrite, QString file){ + startExtract(path, overwrite, QStringList() << file); //overload for multi-file function +} + +void Backend::startExtract(QString path, bool overwrite, QStringList files){ QStringList args; args << "-x" << "--no-same-owner"; if(!overwrite){ args << "-k"; } args << flags; - if(!file.isEmpty()){ args << "--include" << file << "--strip-components" << QString::number(file.count("/")); } + for(int i=0; i<files.length(); i++){ + args << "--include" << files[i] << "--strip-components" << QString::number(files[i].count("/")); + } args << "-C" << path; STARTING=true; //qDebug() << "Starting command:" << "tar" << args; diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h index 47bc0bb6..ac2cb61f 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h @@ -36,6 +36,7 @@ public: void startAdd(QStringList paths); 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); void startViewFile(QString path); |