┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2025-04-29 12:33:44 +0200
committerMéven Car <[email protected]>2025-04-29 12:33:44 +0200
commit0464ea82a6850f58805bc4d6fc1df5369d83c3df (patch)
treecd3747579d3f6fd08a59c915c4002aeaab580951 /src/search
parent246fdb3ebbde298ddb20f0323ba717c5cf9ba925 (diff)
Clazy fix
Diffstat (limited to 'src/search')
-rw-r--r--src/search/bar.h2
-rw-r--r--src/search/chip.h2
-rw-r--r--src/search/popup.h2
-rw-r--r--src/search/selectors/dateselector.h2
-rw-r--r--src/search/selectors/filetypeselector.h2
-rw-r--r--src/search/selectors/minimumratingselector.h2
-rw-r--r--src/search/selectors/tagsselector.cpp6
-rw-r--r--src/search/selectors/tagsselector.h2
-rw-r--r--src/search/widgetmenu.cpp4
9 files changed, 13 insertions, 11 deletions
diff --git a/src/search/bar.h b/src/search/bar.h
index e681b8a6e..e8a401748 100644
--- a/src/search/bar.h
+++ b/src/search/bar.h
@@ -141,7 +141,7 @@ private Q_SLOTS:
* @see UpdatableStateInterface::updateStateToMatch().
* @see commitCurrentConfiguration().
*/
- void slotConfigurationChanged(const DolphinQuery &searchConfiguration);
+ void slotConfigurationChanged(const Search::DolphinQuery &searchConfiguration);
/**
* Changes the m_searchConfiguration in response to the user editing the search term. If no further changes to the search term happen within a time limit,
diff --git a/src/search/chip.h b/src/search/chip.h
index 94e51968d..8cd1fce24 100644
--- a/src/search/chip.h
+++ b/src/search/chip.h
@@ -41,7 +41,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
protected:
void paintEvent(QPaintEvent *event) override;
diff --git a/src/search/popup.h b/src/search/popup.h
index 423c9dde6..5ebcc51a3 100644
--- a/src/search/popup.h
+++ b/src/search/popup.h
@@ -45,7 +45,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
/**
* Requests for @p message with the given @p messageType to be shown to the user in a non-modal way.
diff --git a/src/search/selectors/dateselector.h b/src/search/selectors/dateselector.h
index 99cecec06..860c65100 100644
--- a/src/search/selectors/dateselector.h
+++ b/src/search/selectors/dateselector.h
@@ -28,7 +28,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
private:
void updateState(const std::shared_ptr<const DolphinQuery> &dolphinQuery) override;
diff --git a/src/search/selectors/filetypeselector.h b/src/search/selectors/filetypeselector.h
index bfc827344..10e9ea5e5 100644
--- a/src/search/selectors/filetypeselector.h
+++ b/src/search/selectors/filetypeselector.h
@@ -26,7 +26,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
private:
void updateState(const std::shared_ptr<const DolphinQuery> &dolphinQuery) override;
diff --git a/src/search/selectors/minimumratingselector.h b/src/search/selectors/minimumratingselector.h
index 02364cd1a..f1c14cf6c 100644
--- a/src/search/selectors/minimumratingselector.h
+++ b/src/search/selectors/minimumratingselector.h
@@ -31,7 +31,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
private:
void updateState(const std::shared_ptr<const DolphinQuery> &dolphinQuery) override;
diff --git a/src/search/selectors/tagsselector.cpp b/src/search/selectors/tagsselector.cpp
index 95d7ff52a..d6efb9081 100644
--- a/src/search/selectors/tagsselector.cpp
+++ b/src/search/selectors/tagsselector.cpp
@@ -133,7 +133,8 @@ void TagsSelector::updateMenu(const std::shared_ptr<const DolphinQuery> &dolphin
menu()->hide(); // The menu needs to be hidden now, then updated, and then shown again.
}
// Delete all existing actions in the menu
- for (QAction *action : menu()->actions()) {
+ const auto actions = menu()->actions();
+ for (QAction *action : actions) {
action->deleteLater();
}
menu()->clear();
@@ -180,7 +181,8 @@ void TagsSelector::updateState(const std::shared_ptr<const DolphinQuery> &dolphi
setIcon(QIcon{}); // No icon for the empty state
setText(i18nc("@action:button Required tags for search results: None", "None"));
}
- for (const auto &tag : dolphinQuery->requiredTags()) {
+ const auto tags = dolphinQuery->requiredTags();
+ for (const auto &tag : tags) {
tagsList()->addTag(tag); // We add it just in case this tag is not (or no longer) available on the system. This way the UI always works as expected.
}
if (menu()->isVisible()) {
diff --git a/src/search/selectors/tagsselector.h b/src/search/selectors/tagsselector.h
index 386cbb924..9aeba908f 100644
--- a/src/search/selectors/tagsselector.h
+++ b/src/search/selectors/tagsselector.h
@@ -27,7 +27,7 @@ public:
Q_SIGNALS:
/** Is emitted whenever settings have changed and a new search might be necessary. */
- void configurationChanged(const DolphinQuery &dolphinQuery);
+ void configurationChanged(const Search::DolphinQuery &dolphinQuery);
private:
/**
diff --git a/src/search/widgetmenu.cpp b/src/search/widgetmenu.cpp
index 701a0ce9c..5624e2dfc 100644
--- a/src/search/widgetmenu.cpp
+++ b/src/search/widgetmenu.cpp
@@ -41,7 +41,7 @@ void WidgetMenu::mouseReleaseEvent(QMouseEvent *event)
void WidgetMenu::resizeToFitContents()
{
- auto *widgetAction = static_cast<QWidgetAction *>(actions().first());
+ auto *widgetAction = static_cast<QWidgetAction *>(actions().constFirst());
auto focusedChildWidget = QApplication::focusWidget();
if (!widgetAction->defaultWidget()->isAncestorOf(focusedChildWidget)) {
focusedChildWidget = nullptr;
@@ -60,7 +60,7 @@ void WidgetMenu::resizeToFitContents()
void WidgetMenu::showEvent(QShowEvent *event)
{
if (!event->spontaneous()) {
- auto widgetAction = static_cast<QWidgetAction *>(actions().first());
+ auto widgetAction = static_cast<QWidgetAction *>(actions().constFirst());
widgetAction->defaultWidget()->setFocus();
}
QMenu::showEvent(event);