gui: MainWindow: Set, save and restore ignore patterns

Esse commit está contido em:
Albert S. 2022-05-31 10:16:53 +02:00
commit ae57a22078
2 arquivos alterados com 8 adições e 2 exclusões

Ver arquivo

@ -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");
}

Ver arquivo

@ -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">