From 1ad3b7775ec7388352d3a02c704062baa5d0aca3 Mon Sep 17 00:00:00 2001 From: Nathaniel Graham Date: Wed, 4 Oct 2017 09:08:26 -0600 Subject: [PATCH] Move Folders item closer to the top Summary: Move Folders item closer to the top in Dolphin's find panel. This seems like a more natural placment than after the document types. Also re-order variable placement to maintain consistency Test Plan: Tested in KDE Neon; works. Before: {F4631565} After: {F4631532} Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: #dolphin Differential Revision: https://phabricator.kde.org/D8132 --- src/search/dolphinfacetswidget.cpp | 12 ++++++------ src/search/dolphinfacetswidget.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp index 482de3ee89..7831d4c127 100644 --- a/src/search/dolphinfacetswidget.cpp +++ b/src/search/dolphinfacetswidget.cpp @@ -29,11 +29,11 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : QWidget(parent), + m_folders(0), m_documents(0), m_images(0), m_audio(0), m_videos(0), - m_folders(0), m_anytime(0), m_today(0), m_yesterday(0), @@ -49,20 +49,20 @@ DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) : { QButtonGroup* filetypeGroup = new QButtonGroup(this); m_anyType = createRadioButton(i18nc("@option:check", "Any"), filetypeGroup); + m_folders = createRadioButton(i18nc("@option:check", "Folders"), filetypeGroup); m_documents = createRadioButton(i18nc("@option:check", "Documents"), filetypeGroup); 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); typeLayout->addWidget(m_anyType); + typeLayout->addWidget(m_folders); typeLayout->addWidget(m_documents); typeLayout->addWidget(m_images); typeLayout->addWidget(m_audio); typeLayout->addWidget(m_videos); - typeLayout->addWidget(m_folders); typeLayout->addStretch(); QButtonGroup* timespanGroup = new QButtonGroup(this); @@ -155,7 +155,9 @@ QString DolphinFacetsWidget::ratingTerm() const QString DolphinFacetsWidget::facetType() const { - if (m_documents->isChecked()) { + if (m_folders->isChecked()) { + return QStringLiteral("Folder"); + } else if (m_documents->isChecked()) { return QStringLiteral("Document"); } else if (m_images->isChecked()) { return QStringLiteral("Image"); @@ -163,8 +165,6 @@ 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 2bf48616e9..1c041a2f92 100644 --- a/src/search/dolphinfacetswidget.h +++ b/src/search/dolphinfacetswidget.h @@ -75,11 +75,11 @@ private: private: QRadioButton* m_anyType; + QRadioButton* m_folders; QRadioButton* m_documents; QRadioButton* m_images; QRadioButton* m_audio; QRadioButton* m_videos; - QRadioButton* m_folders; QRadioButton* m_anytime; QRadioButton* m_today;