From 0464ea82a6850f58805bc4d6fc1df5369d83c3df Mon Sep 17 00:00:00 2001 From: Méven Car Date: Tue, 29 Apr 2025 12:33:44 +0200 Subject: Clazy fix --- src/search/bar.h | 2 +- src/search/chip.h | 2 +- src/search/popup.h | 2 +- src/search/selectors/dateselector.h | 2 +- src/search/selectors/filetypeselector.h | 2 +- src/search/selectors/minimumratingselector.h | 2 +- src/search/selectors/tagsselector.cpp | 6 ++++-- src/search/selectors/tagsselector.h | 2 +- src/search/widgetmenu.cpp | 4 ++-- 9 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src/search') 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 &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 &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 &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 &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 &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(actions().first()); + auto *widgetAction = static_cast(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(actions().first()); + auto widgetAction = static_cast(actions().constFirst()); widgetAction->defaultWidget()->setFocus(); } QMenu::showEvent(event); -- cgit v1.3