diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/search/dolphinfacetswidget.cpp | 12 | ||||
| -rw-r--r-- | src/search/dolphinfacetswidget.h | 9 | ||||
| -rw-r--r-- | src/search/dolphinquery.cpp | 2 | ||||
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 6 |
4 files changed, 14 insertions, 15 deletions
diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp index c0b6c5243..ea11a400f 100644 --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -86,7 +86,7 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : topLayout->addWidget(m_ratingSelector); topLayout->addWidget(m_tagsSelector); - resetOptions(); + resetSearchTerms(); } DolphinFacetsWidget::~DolphinFacetsWidget() @@ -99,12 +99,12 @@ void DolphinFacetsWidget::changeEvent(QEvent *event) if (isEnabled()) { updateTagsSelector(); } else { - resetOptions(); + resetSearchTerms(); } } } -void DolphinFacetsWidget::resetOptions() +void DolphinFacetsWidget::resetSearchTerms() { m_typeSelector->setCurrentIndex(0); m_dateSelector->setCurrentIndex(0); @@ -115,7 +115,7 @@ void DolphinFacetsWidget::resetOptions() updateTagsMenu(); } -QString DolphinFacetsWidget::ratingTerm() const +QString DolphinFacetsWidget::searchTerms() const { QStringList terms; @@ -143,7 +143,7 @@ QString DolphinFacetsWidget::facetType() const 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 @@ bool DolphinFacetsWidget::isRatingTerm(const QString& term) const 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/dolphinfacetswidget.h b/src/search/dolphinfacetswidget.h index 5325074c6..84029c20f 100644 --- a/src/search/dolphinfacetswidget.h +++ b/src/search/dolphinfacetswidget.h @@ -52,13 +52,12 @@ public: 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/dolphinquery.cpp b/src/search/dolphinquery.cpp index 4d5f8e132..95efe9162 100644 --- 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 index 302081d7d..c216e1714 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -478,7 +478,7 @@ QUrl DolphinSearchBox::balooUrlForSearching() const 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 @@ void DolphinSearchBox::updateFromQuery(const DolphinQuery& query) 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(); |
