gui: Indexer tab: Save/Restore paths to/from settings
This commit is contained in:
parent
62d3eac498
commit
0503325c47
@ -42,6 +42,9 @@ MainWindow::MainWindow(QWidget *parent, IPCClient &client) : QMainWindow(parent)
|
|||||||
ui->comboScale->setCurrentText(settings.value("currentScale").toString());
|
ui->comboScale->setCurrentText(settings.value("currentScale").toString());
|
||||||
previewsPerPage = settings.value("previewsPerPage", 20).toInt();
|
previewsPerPage = settings.value("previewsPerPage", 20).toInt();
|
||||||
ui->spinPreviewPage->setMinimum(1);
|
ui->spinPreviewPage->setMinimum(1);
|
||||||
|
|
||||||
|
QStringList indexPaths = settings.value("indexPaths").toStringList();
|
||||||
|
ui->lstPaths->addItems(indexPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addPathToIndex()
|
void MainWindow::addPathToIndex()
|
||||||
@ -144,12 +147,17 @@ void MainWindow::startIndexing()
|
|||||||
ui->previewProcessBar->setValue(0);
|
ui->previewProcessBar->setValue(0);
|
||||||
|
|
||||||
QVector<QString> paths;
|
QVector<QString> paths;
|
||||||
|
QStringList pathSettingsValue;
|
||||||
for(int i = 0; i < ui->lstPaths->count(); i++)
|
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->setTargetPaths(paths);
|
||||||
this->indexer->beginIndexing();
|
this->indexer->beginIndexing();
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("indexPaths", pathSettingsValue);
|
||||||
ui->btnStartIndexing->setText("Stop indexing");
|
ui->btnStartIndexing->setText("Stop indexing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user