From 0503325c476f80fdffcc0b9a624cd2501a4c86e5 Mon Sep 17 00:00:00 2001 From: Albert S Date: Fri, 15 Apr 2022 22:57:15 +0200 Subject: [PATCH] gui: Indexer tab: Save/Restore paths to/from settings --- gui/mainwindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 249bab3..1a53951 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -42,6 +42,9 @@ MainWindow::MainWindow(QWidget *parent, IPCClient &client) : QMainWindow(parent) ui->comboScale->setCurrentText(settings.value("currentScale").toString()); previewsPerPage = settings.value("previewsPerPage", 20).toInt(); ui->spinPreviewPage->setMinimum(1); + + QStringList indexPaths = settings.value("indexPaths").toStringList(); + ui->lstPaths->addItems(indexPaths); } void MainWindow::addPathToIndex() @@ -144,12 +147,17 @@ void MainWindow::startIndexing() ui->previewProcessBar->setValue(0); QVector paths; + QStringList pathSettingsValue; for(int i = 0; i < ui->lstPaths->count(); i++) { - paths.append(ui->lstPaths->item(i)->text()); + QString path = ui->lstPaths->item(i)->text(); + paths.append(path); + pathSettingsValue.append(path); } this->indexer->setTargetPaths(paths); this->indexer->beginIndexing(); + QSettings settings; + settings.setValue("indexPaths", pathSettingsValue); ui->btnStartIndexing->setText("Stop indexing"); }