diff --git a/QVectorSearch/mainwindow.cpp b/QVectorSearch/mainwindow.cpp index 6e9679a..90121a8 100644 --- a/QVectorSearch/mainwindow.cpp +++ b/QVectorSearch/mainwindow.cpp @@ -28,12 +28,12 @@ MainWindow::MainWindow(QWidget *parent) MainWindow::~MainWindow() { delete ui; } void MainWindow::setupAlgorithmSelector() { + search_algorithms_.appendRow(new QStandardItem("Bucket search")); search_algorithms_.appendRow(new QStandardItem("Linear search")); search_algorithms_.appendRow(new QStandardItem("Sorted linear search")); search_algorithms_.appendRow(new QStandardItem("Parallel search")); search_algorithms_.appendRow(new QStandardItem("Tree search")); search_algorithms_.appendRow(new QStandardItem("Grouped search")); - search_algorithms_.appendRow(new QStandardItem("Bucket search")); } void MainWindow::setupWordListSourceSelector() { @@ -89,8 +89,8 @@ void MainWindow::search(const QString &search_term) { timer.stop(); std::stringstream status_message; - status_message << "search took " << timer << ", found " - << std::distance(results.begin(), results.end()) << " results"; + status_message << "search took " << timer << ", found " << results.size() + << " result(s) in " << word_list_.size() << " words."; ui->mainStatusBar->showMessage(QString::fromStdString(status_message.str())); showResults(results); @@ -102,22 +102,22 @@ void MainWindow::createSelectedFinder() { switch (selectedFinder) { case 0: default: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; case 1: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; case 2: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; case 3: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; case 4: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; case 5: - finder_ = std::make_unique(word_list_); + finder_ = std::make_unique(word_list_); break; } }