Merge pull request #2625 from LukashonakV/happyLinter

This commit is contained in:
Alexis Rouillard 2023-11-01 08:27:13 +01:00 committed by GitHub
commit 1149e51f72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -7,7 +7,7 @@ namespace cava {
extern "C" { extern "C" {
#include <cava/common.h> #include <cava/common.h>
} }
} } // namespace cava
namespace waybar::modules { namespace waybar::modules {
using namespace std::literals::chrono_literals; using namespace std::literals::chrono_literals;

View File

@ -197,7 +197,7 @@ void waybar::modules::Custom::parseOutputRaw() {
int i = 0; int i = 0;
while (getline(output, line)) { while (getline(output, line)) {
Glib::ustring validated_line = line; Glib::ustring validated_line = line;
if(!validated_line.validate()) { if (!validated_line.validate()) {
validated_line = validated_line.make_valid(); validated_line = validated_line.make_valid();
} }

View File

@ -153,7 +153,7 @@ auto Workspaces::register_ipc() -> void {
} }
auto Workspaces::update() -> void { auto Workspaces::update() -> void {
//remove workspaces that wait to be removed // remove workspaces that wait to be removed
unsigned int current_remove_workspace_num = 0; unsigned int current_remove_workspace_num = 0;
for (const std::string &workspace_to_remove : workspaces_to_remove_) { for (const std::string &workspace_to_remove : workspaces_to_remove_) {
remove_workspace(workspace_to_remove); remove_workspace(workspace_to_remove);
@ -163,7 +163,7 @@ auto Workspaces::update() -> void {
workspaces_to_remove_.erase(workspaces_to_remove_.begin()); workspaces_to_remove_.erase(workspaces_to_remove_.begin());
} }
//add workspaces that wait to be created // add workspaces that wait to be created
unsigned int current_create_workspace_num = 0; unsigned int current_create_workspace_num = 0;
for (Json::Value const &workspace_to_create : workspaces_to_create_) { for (Json::Value const &workspace_to_create : workspaces_to_create_) {
create_workspace(workspace_to_create); create_workspace(workspace_to_create);

View File

@ -575,10 +575,12 @@ auto Mpris::getPlayerInfo() -> std::optional<PlayerInfo> {
errorexit: errorexit:
std::string errorMsg = error->message; std::string errorMsg = error->message;
// When mpris checks for active player sessions periodically(5 secs), NoActivePlayer error message is // When mpris checks for active player sessions periodically(5 secs), NoActivePlayer error
// thrown when there are no active sessions. This error message is spamming logs without having any value // message is
// addition. Log the error only if the error we recceived is not NoActivePlayer. // thrown when there are no active sessions. This error message is spamming logs without having
if(errorMsg.rfind("GDBus.Error:com.github.altdesktop.playerctld.NoActivePlayer") == std::string::npos){ // any value addition. Log the error only if the error we recceived is not NoActivePlayer.
if (errorMsg.rfind("GDBus.Error:com.github.altdesktop.playerctld.NoActivePlayer") ==
std::string::npos) {
spdlog::error("mpris[{}]: {}", info.name, error->message); spdlog::error("mpris[{}]: {}", info.name, error->message);
} }
return std::nullopt; return std::nullopt;