mirror of
https://github.com/polybar/polybar.git
synced 2026-02-13 07:25:28 +00:00
refactor(core): Clean-up
- use "#pragma once" instead of the regular include guard - fix errors and warnings reported by cppcheck
This commit is contained in:
@ -12,7 +12,8 @@ using namespace modules;
|
||||
|
||||
// TODO: Add up-/download speed (check how ifconfig read the bytes)
|
||||
|
||||
NetworkModule::NetworkModule(const std::string& name_) : TimerModule(name_, 1s)
|
||||
NetworkModule::NetworkModule(const std::string& name_)
|
||||
: TimerModule(name_, 1s), connected(false), conseq_packetloss(false)
|
||||
{
|
||||
static const auto DEFAULT_FORMAT_CONNECTED = TAG_LABEL_CONNECTED;
|
||||
static const auto DEFAULT_FORMAT_DISCONNECTED = TAG_LABEL_DISCONNECTED;
|
||||
@ -22,9 +23,6 @@ NetworkModule::NetworkModule(const std::string& name_) : TimerModule(name_, 1s)
|
||||
static const auto DEFAULT_LABEL_DISCONNECTED = "";
|
||||
static const auto DEFAULT_LABEL_PACKETLOSS = "";
|
||||
|
||||
this->connected = false;
|
||||
this->conseq_packetloss = false;
|
||||
|
||||
// Load configuration values
|
||||
this->interface = config::get<std::string>(name(), "interface");
|
||||
this->interval = std::chrono::duration<double>(config::get<float>(name(), "interval", 1));
|
||||
@ -147,7 +145,6 @@ bool NetworkModule::update()
|
||||
if (this->wired_network) {
|
||||
label->replace_token("%linkspeed%", linkspeed);
|
||||
} else if (this->wireless_network) {
|
||||
// label->replace_token("%essid%", essid);
|
||||
label->replace_token("%essid%", !essid.empty() ? essid : "No network");
|
||||
label->replace_token("%signal%", std::to_string(signal_quality)+"%");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user