diff --git a/src/search/dolphinfacetswidget.h b/src/search/dolphinfacetswidget.h --- a/src/search/dolphinfacetswidget.h +++ b/src/search/dolphinfacetswidget.h @@ -52,13 +52,12 @@ explicit DolphinFacetsWidget(QWidget* parent = nullptr); ~DolphinFacetsWidget() override; - void resetOptions(); - - QString ratingTerm() const; + QString searchTerms() const; QString facetType() const; - bool isRatingTerm(const QString& term) const; - void setRatingTerm(const QString& term); + bool isSearchTerm(const QString& term) const; + void setSearchTerm(const QString& term); + void resetSearchTerms(); void setFacetType(const QString& type); diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -86,7 +86,7 @@ topLayout->addWidget(m_ratingSelector); topLayout->addWidget(m_tagsSelector); - resetOptions(); + resetSearchTerms(); } DolphinFacetsWidget::~DolphinFacetsWidget() @@ -99,12 +99,12 @@ if (isEnabled()) { updateTagsSelector(); } else { - resetOptions(); + resetSearchTerms(); } } } -void DolphinFacetsWidget::resetOptions() +void DolphinFacetsWidget::resetSearchTerms() { m_typeSelector->setCurrentIndex(0); m_dateSelector->setCurrentIndex(0); @@ -115,7 +115,7 @@ updateTagsMenu(); } -QString DolphinFacetsWidget::ratingTerm() const +QString DolphinFacetsWidget::searchTerms() const { QStringList terms; @@ -143,7 +143,7 @@ return m_typeSelector->currentData().toString(); } -bool DolphinFacetsWidget::isRatingTerm(const QString& term) const +bool DolphinFacetsWidget::isSearchTerm(const QString& term) const { const QStringList subTerms = term.split(' ', QString::SkipEmptyParts); @@ -166,7 +166,7 @@ return containsModified || containsRating || containsTag; } -void DolphinFacetsWidget::setRatingTerm(const QString& term) +void DolphinFacetsWidget::setSearchTerm(const QString& term) { // If term has sub terms, then the sub terms are always "rating" and "modified" terms. // If term has no sub terms, then the term itself is either a "rating" term or a "modified" diff --git a/src/search/dolphinquery.cpp b/src/search/dolphinquery.cpp --- a/src/search/dolphinquery.cpp +++ b/src/search/dolphinquery.cpp @@ -28,7 +28,7 @@ namespace { /** Checks if a given term in the Baloo::Query::searchString() is a special search term. - * This is a copy of `DolphinFacetsWidget::isRatingTerm()` method. + * This is a copy of `DolphinFacetsWidget::isSearchTerm()` method. */ bool isSearchTerm(const QString& term) { diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -478,7 +478,7 @@ query.addType(m_facetsWidget->facetType()); QStringList queryStrings; - QString ratingQuery = m_facetsWidget->ratingTerm(); + QString ratingQuery = m_facetsWidget->searchTerms(); if (!ratingQuery.isEmpty()) { queryStrings << ratingQuery; } @@ -523,11 +523,11 @@ m_fileNameButton->setChecked(true); } - m_facetsWidget->resetOptions(); + m_facetsWidget->resetSearchTerms(); m_facetsWidget->setFacetType(query.type()); const QStringList searchTerms = query.searchTerms(); for (const QString& searchTerm : searchTerms) { - m_facetsWidget->setRatingTerm(searchTerm); + m_facetsWidget->setSearchTerm(searchTerm); } m_startSearchTimer->stop();