gui: MainWindow: Set, save and restore ignore patterns

This commit is contained in:
Albert S. 2022-05-31 10:16:53 +02:00
джерело c2bd1b526b
коміт ae57a22078
2 змінених файлів з 8 додано та 2 видалено

@ -72,6 +72,9 @@ MainWindow::MainWindow(QWidget *parent, QString socketPath) : QMainWindow(parent
QStringList indexPaths = settings.value("indexPaths").toStringList();
ui->lstPaths->addItems(indexPaths);
QString ignorePatterns = settings.value("ignorePatterns").toString();
ui->txtIgnorePatterns->setText(ignorePatterns);
ui->spinPreviewPage->setValue(1);
ui->spinPreviewPage->setMinimum(1);
}
@ -196,9 +199,12 @@ void MainWindow::startIndexing()
pathSettingsValue.append(path);
}
this->indexer->setTargetPaths(paths);
QString ignorePatterns = ui->txtIgnorePatterns->text();
this->indexer->setIgnorePattern(ignorePatterns.split(";"));
this->indexer->beginIndexing();
QSettings settings;
settings.setValue("indexPaths", pathSettingsValue);
settings.setValue("ignorePatterns", ignorePatterns);
ui->btnStartIndexing->setText("Stop indexing");
}

@ -27,7 +27,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="resultsTab">
<attribute name="title">
@ -333,7 +333,7 @@
</widget>
</item>
<item row="6" column="0">
<widget class="QLineEdit" name="lineEdit"/>
<widget class="QLineEdit" name="txtIgnorePatterns"/>
</item>
<item row="10" column="0">
<widget class="QPushButton" name="btnStartIndexing">