From bcee4e15d3e4d970d477ca3ad1cc7b1b4c691345 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 18 Aug 2022 15:22:25 +0200 Subject: [PATCH] fix: lint files --- src/modules/mpd/mpd.cpp | 23 +++++++++++------------ src/modules/sni/item.cpp | 5 ++--- src/modules/sway/window.cpp | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 9b878f9..0f58343 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -166,18 +166,17 @@ void waybar::modules::MPD::setLabel() { if (config_["title-len"].isInt()) title = title.substr(0, config_["title-len"].asInt()); try { - label_.set_markup( - fmt::format(format, fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), - fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), - fmt::arg("album", Glib::Markup::escape_text(album).raw()), - fmt::arg("title", Glib::Markup::escape_text(title).raw()), - fmt::arg("date", Glib::Markup::escape_text(date).raw()), - fmt::arg("volume", volume), fmt::arg("elapsedTime", elapsedTime), - fmt::arg("totalTime", totalTime), fmt::arg("songPosition", song_pos), - fmt::arg("queueLength", queue_length), fmt::arg("stateIcon", stateIcon), - fmt::arg("consumeIcon", consumeIcon), fmt::arg("randomIcon", randomIcon), - fmt::arg("repeatIcon", repeatIcon), fmt::arg("singleIcon", singleIcon), - fmt::arg("filename", filename))); + label_.set_markup(fmt::format( + format, fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), + fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), + fmt::arg("album", Glib::Markup::escape_text(album).raw()), + fmt::arg("title", Glib::Markup::escape_text(title).raw()), + fmt::arg("date", Glib::Markup::escape_text(date).raw()), fmt::arg("volume", volume), + fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), + fmt::arg("songPosition", song_pos), fmt::arg("queueLength", queue_length), + fmt::arg("stateIcon", stateIcon), fmt::arg("consumeIcon", consumeIcon), + fmt::arg("randomIcon", randomIcon), fmt::arg("repeatIcon", repeatIcon), + fmt::arg("singleIcon", singleIcon), fmt::arg("filename", filename))); } catch (fmt::format_error const& e) { spdlog::warn("mpd: format error: {}", e.what()); } diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 773cfda..7cd0045 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -314,9 +314,7 @@ void Item::updateImage() { } Glib::RefPtr Item::getIconPixbuf() { - if (!icon_name.empty()) { - try { std::ifstream temp(icon_name); if (temp.is_open()) { @@ -347,7 +345,8 @@ Glib::RefPtr Item::getIconPixbuf() { if (icon_name.empty()) { spdlog::error("Item '{}': No icon name or pixmap given.", id); } else { - spdlog::error("Item '{}': Could not find an icon named '{}' and no pixmap given.", id, icon_name); + spdlog::error("Item '{}': Could not find an icon named '{}' and no pixmap given.", id, + icon_name); } return getIconByName("image-missing", getScaledIconSize()); diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 1d7fbe9..3d63743 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -227,8 +227,8 @@ std::tuple int nb = node.size(); if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace); - return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()), - app_id, app_class, shell}; + return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()), + app_id, app_class, shell}; } } // iterate