From fc632f50eca8145030f89c1d97c053d2db4021ce Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 Jul 2023 22:52:24 +0200 Subject: [PATCH] fix: lint --- src/modules/mpris/mpris.cpp | 17 ++++++++--------- src/modules/sway/workspaces.cpp | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/modules/mpris/mpris.cpp b/src/modules/mpris/mpris.cpp index a5621758..aa425489 100644 --- a/src/modules/mpris/mpris.cpp +++ b/src/modules/mpris/mpris.cpp @@ -83,7 +83,9 @@ Mpris::Mpris(const std::string& id, const Json::Value& config) // "dynamic-priority" has been kept for backward compatibility if (config_["dynamic-importance-order"].isArray() || config_["dynamic-priority"].isArray()) { dynamic_prio_.clear(); - const auto& dynamic_priority = config_["dynamic-importance-order"].isArray() ? config_["dynamic-importance-order"] : config_["dynamic-priority"]; + const auto& dynamic_priority = config_["dynamic-importance-order"].isArray() + ? config_["dynamic-importance-order"] + : config_["dynamic-priority"]; for (const auto& value : dynamic_priority) { if (value.isString()) { dynamic_prio_.push_back(value.asString()); @@ -299,9 +301,9 @@ auto Mpris::getDynamicStr(const PlayerInfo& info, bool truncated, bool html) -> "position") != dynamic_order_.end()); if (truncated && dynamic_len_ >= 0) { - //Since the first element doesn't present a separator and we don't know a priori which one - //it will be, we add a "virtual separatorLen" to the dynamicLen, since we are adding the - //separatorLen to all the other lengths. + // Since the first element doesn't present a separator and we don't know a priori which one + // it will be, we add a "virtual separatorLen" to the dynamicLen, since we are adding the + // separatorLen to all the other lengths. size_t separatorLen = utf8_width(dynamic_separator_); size_t dynamicLen = dynamic_len_ + separatorLen; if (showArtist) artistLen += separatorLen; @@ -361,12 +363,9 @@ auto Mpris::getDynamicStr(const PlayerInfo& info, bool truncated, bool html) -> std::string previousOrder = ""; for (const std::string& order : dynamic_order_) { - if ((order == "artist" && showArtist) || - (order == "album" && showAlbum) || + if ((order == "artist" && showArtist) || (order == "album" && showAlbum) || (order == "title" && showTitle)) { - if (previousShown && - previousOrder != "length" && - previousOrder != "position") { + if (previousShown && previousOrder != "length" && previousOrder != "position") { dynamic << dynamic_separator_; } diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index c1cfd5a4..638ed9d9 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -328,7 +328,7 @@ bool Workspaces::handleScroll(GdkEventScroll *e) { } } if (!config_["warp-on-scroll"].asBool()) { - ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping none")); + ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping none")); } try { ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name)); @@ -336,7 +336,7 @@ bool Workspaces::handleScroll(GdkEventScroll *e) { spdlog::error("Workspaces: {}", e.what()); } if (!config_["warp-on-scroll"].asBool()) { - ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping container")); + ipc_.sendCmd(IPC_COMMAND, fmt::format("mouse_warping container")); } return true; }