X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/848abc5922167a467bb73107ee6b72e9af3c8317..c540b4eef12d8251e25c608cd2c04fca724afa6f:/src/search/dolphinfacetswidget.cpp diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp index 21a45cd9b..08fe567b1 100644 --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -20,11 +20,13 @@ #include "dolphinfacetswidget.h" #include + #include #include #include -#include +#include #include +#include DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : QWidget(parent), @@ -105,15 +107,27 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : topLayout->addLayout(ratingLayout); topLayout->addStretch(); - m_anyType->setChecked(true); - m_anytime->setChecked(true); - m_anyRating->setChecked(true); + resetOptions(); } DolphinFacetsWidget::~DolphinFacetsWidget() { } +void DolphinFacetsWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::EnabledChange && !isEnabled()) { + resetOptions(); + } +} + +void DolphinFacetsWidget::resetOptions() +{ + m_anyType->setChecked(true); + m_anytime->setChecked(true); + m_anyRating->setChecked(true); +} + QString DolphinFacetsWidget::ratingTerm() const { QStringList terms; @@ -149,7 +163,7 @@ QString DolphinFacetsWidget::ratingTerm() const terms << QStringLiteral("modified>=%1").arg(date.toString(Qt::ISODate)); } - return terms.join(QStringLiteral(" AND ")); + return terms.join(QLatin1String(" AND ")); } QString DolphinFacetsWidget::facetType() const @@ -210,7 +224,9 @@ void DolphinFacetsWidget::setRatingTerm(const QString& term) void DolphinFacetsWidget::setFacetType(const QString& type) { - if (type == QLatin1String("Document")) { + if (type == QLatin1String("Folder")) { + m_folders->setChecked(true); + } else if (type == QLatin1String("Document")) { m_documents->setChecked(true); } else if (type == QLatin1String("Image")) { m_images->setChecked(true);