mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix: lint files
This commit is contained in:
parent
b7bd06ad8f
commit
bcee4e15d3
@ -166,18 +166,17 @@ void waybar::modules::MPD::setLabel() {
|
|||||||
if (config_["title-len"].isInt()) title = title.substr(0, config_["title-len"].asInt());
|
if (config_["title-len"].isInt()) title = title.substr(0, config_["title-len"].asInt());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
label_.set_markup(
|
label_.set_markup(fmt::format(
|
||||||
fmt::format(format, fmt::arg("artist", Glib::Markup::escape_text(artist).raw()),
|
format, fmt::arg("artist", Glib::Markup::escape_text(artist).raw()),
|
||||||
fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()),
|
fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()),
|
||||||
fmt::arg("album", Glib::Markup::escape_text(album).raw()),
|
fmt::arg("album", Glib::Markup::escape_text(album).raw()),
|
||||||
fmt::arg("title", Glib::Markup::escape_text(title).raw()),
|
fmt::arg("title", Glib::Markup::escape_text(title).raw()),
|
||||||
fmt::arg("date", Glib::Markup::escape_text(date).raw()),
|
fmt::arg("date", Glib::Markup::escape_text(date).raw()), fmt::arg("volume", volume),
|
||||||
fmt::arg("volume", volume), fmt::arg("elapsedTime", elapsedTime),
|
fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime),
|
||||||
fmt::arg("totalTime", totalTime), fmt::arg("songPosition", song_pos),
|
fmt::arg("songPosition", song_pos), fmt::arg("queueLength", queue_length),
|
||||||
fmt::arg("queueLength", queue_length), fmt::arg("stateIcon", stateIcon),
|
fmt::arg("stateIcon", stateIcon), fmt::arg("consumeIcon", consumeIcon),
|
||||||
fmt::arg("consumeIcon", consumeIcon), fmt::arg("randomIcon", randomIcon),
|
fmt::arg("randomIcon", randomIcon), fmt::arg("repeatIcon", repeatIcon),
|
||||||
fmt::arg("repeatIcon", repeatIcon), fmt::arg("singleIcon", singleIcon),
|
fmt::arg("singleIcon", singleIcon), fmt::arg("filename", filename)));
|
||||||
fmt::arg("filename", filename)));
|
|
||||||
} catch (fmt::format_error const& e) {
|
} catch (fmt::format_error const& e) {
|
||||||
spdlog::warn("mpd: format error: {}", e.what());
|
spdlog::warn("mpd: format error: {}", e.what());
|
||||||
}
|
}
|
||||||
|
@ -314,9 +314,7 @@ void Item::updateImage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Pixbuf> Item::getIconPixbuf() {
|
Glib::RefPtr<Gdk::Pixbuf> Item::getIconPixbuf() {
|
||||||
|
|
||||||
if (!icon_name.empty()) {
|
if (!icon_name.empty()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
std::ifstream temp(icon_name);
|
std::ifstream temp(icon_name);
|
||||||
if (temp.is_open()) {
|
if (temp.is_open()) {
|
||||||
@ -347,7 +345,8 @@ Glib::RefPtr<Gdk::Pixbuf> Item::getIconPixbuf() {
|
|||||||
if (icon_name.empty()) {
|
if (icon_name.empty()) {
|
||||||
spdlog::error("Item '{}': No icon name or pixmap given.", id);
|
spdlog::error("Item '{}': No icon name or pixmap given.", id);
|
||||||
} else {
|
} 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());
|
return getIconByName("image-missing", getScaledIconSize());
|
||||||
|
@ -227,8 +227,8 @@ std::tuple<std::size_t, int, std::string, std::string, std::string, std::string>
|
|||||||
|
|
||||||
int nb = node.size();
|
int nb = node.size();
|
||||||
if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace);
|
if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace);
|
||||||
return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()),
|
return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()),
|
||||||
app_id, app_class, shell};
|
app_id, app_class, shell};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// iterate
|
// iterate
|
||||||
|
Loading…
Reference in New Issue
Block a user