From 19f3ce6f856c11735ba0781d8bf21a49f84c4840 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 22 Mar 2024 23:21:57 +0100 Subject: [PATCH] fix: lint --- include/modules/dwl/window.hpp | 7 ++++--- src/modules/dwl/window.cpp | 28 ++++++++-------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/include/modules/dwl/window.hpp b/include/modules/dwl/window.hpp index e4c96404..6b068360 100644 --- a/include/modules/dwl/window.hpp +++ b/include/modules/dwl/window.hpp @@ -6,14 +6,14 @@ #include "AAppIconLabel.hpp" #include "bar.hpp" -#include "util/json.hpp" #include "dwl-ipc-unstable-v2-client-protocol.h" +#include "util/json.hpp" namespace waybar::modules::dwl { class Window : public AAppIconLabel, public sigc::trackable { public: - Window(const std::string&, const waybar::Bar&, const Json::Value&); + Window(const std::string &, const waybar::Bar &, const Json::Value &); virtual ~Window() = default; void handle_layout(const uint32_t layout); @@ -23,8 +23,9 @@ class Window : public AAppIconLabel, public sigc::trackable { void handle_frame(); struct zdwl_ipc_manager_v2 *status_manager_; + private: - const Bar& bar_; + const Bar &bar_; std::string title_; std::string appid_; diff --git a/src/modules/dwl/window.cpp b/src/modules/dwl/window.cpp index cfd47a05..4f8b0281 100644 --- a/src/modules/dwl/window.cpp +++ b/src/modules/dwl/window.cpp @@ -9,7 +9,6 @@ #include "client.hpp" #include "dwl-ipc-unstable-v2-client-protocol.h" - #include "util/rewrite_string.hpp" namespace waybar::modules::dwl { @@ -43,7 +42,7 @@ static void set_layout(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, uint32_t static_cast(data)->handle_layout(layout); } -static void appid(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, const char *appid){ +static void appid(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, const char *appid) { static_cast(data)->handle_appid(appid); }; @@ -73,7 +72,7 @@ static void handle_global_remove(void *data, struct wl_registry *registry, uint3 static const wl_registry_listener registry_listener_impl = {.global = handle_global, .global_remove = handle_global_remove}; -Window::Window(const std::string& id, const Bar& bar, const Json::Value& config) +Window::Window(const std::string &id, const Bar &bar, const Json::Value &config) : AAppIconLabel(config, "window", id, "{}", 0, true), bar_(bar) { struct wl_display *display = Client::inst()->wl_display; struct wl_registry *registry = wl_display_get_registry(display); @@ -92,29 +91,18 @@ Window::Window(const std::string& id, const Bar& bar, const Json::Value& config) zdwl_ipc_manager_v2_destroy(status_manager_); } -void Window::handle_title(const char *title) { - title_ = title; -} +void Window::handle_title(const char *title) { title_ = title; } -void Window::handle_appid(const char *appid) { - appid_ = appid; -} +void Window::handle_appid(const char *appid) { appid_ = appid; } -void Window::handle_layout_symbol(const char *layout_symbol) { - layout_symbol_ = layout_symbol; -} +void Window::handle_layout_symbol(const char *layout_symbol) { layout_symbol_ = layout_symbol; } -void Window::handle_layout(const uint32_t layout) { - layout_ = layout; -} +void Window::handle_layout(const uint32_t layout) { layout_ = layout; } void Window::handle_frame() { label_.set_markup(waybar::util::rewriteString( - fmt::format( - fmt::runtime(format_), - fmt::arg("title", title_), - fmt::arg("layout", layout_symbol_), - fmt::arg("app_id", appid_)), + fmt::format(fmt::runtime(format_), fmt::arg("title", title_), + fmt::arg("layout", layout_symbol_), fmt::arg("app_id", appid_)), config_["rewrite"])); updateAppIconName(appid_, ""); updateAppIcon();