From 60ef0fc76b82ef5a4cbf5646c8bc2e3bfe83a2ba Mon Sep 17 00:00:00 2001 From: XY Quadrat Date: Tue, 3 Oct 2017 23:07:53 +0200 Subject: [PATCH] Add option to only search for folders This commit adds an option under "More options" at the search widget. It allows to only search for folders and filter out everything else, just like the other options (e.g. "Videos") above. FEATURE: 269334 REVIEW: 130159 --- src/search/dolphinfacetswidget.cpp | 5 +++++ src/search/dolphinfacetswidget.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp index 023b30c68..482de3ee8 100644 --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -33,6 +33,7 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : m_images(0), m_audio(0), m_videos(0), + m_folders(0), m_anytime(0), m_today(0), m_yesterday(0), @@ -52,6 +53,7 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : m_images = createRadioButton(i18nc("@option:check", "Images"), filetypeGroup); m_audio = createRadioButton(i18nc("@option:check", "Audio Files"), filetypeGroup); m_videos = createRadioButton(i18nc("@option:check", "Videos"), filetypeGroup); + m_folders = createRadioButton(i18nc("@option:check", "Folders"), filetypeGroup); QVBoxLayout* typeLayout = new QVBoxLayout(); typeLayout->setSpacing(0); @@ -60,6 +62,7 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : typeLayout->addWidget(m_images); typeLayout->addWidget(m_audio); typeLayout->addWidget(m_videos); + typeLayout->addWidget(m_folders); typeLayout->addStretch(); QButtonGroup* timespanGroup = new QButtonGroup(this); @@ -160,6 +163,8 @@ QString DolphinFacetsWidget::facetType() const return QStringLiteral("Audio"); } else if (m_videos->isChecked()) { return QStringLiteral("Video"); + } else if (m_folders->isChecked()) { + return QStringLiteral("Folder"); } return QString(); diff --git a/src/search/dolphinfacetswidget.h b/src/search/dolphinfacetswidget.h index 6f0f0a619..2bf48616e 100644 --- a/src/search/dolphinfacetswidget.h +++ b/src/search/dolphinfacetswidget.h @@ -79,6 +79,7 @@ private: QRadioButton* m_images; QRadioButton* m_audio; QRadioButton* m_videos; + QRadioButton* m_folders; QRadioButton* m_anytime; QRadioButton* m_today; -- 2.47.3