Fix typos in function, variable names and in documentation

This commit is contained in:
Torstein Husebø
2025-01-16 13:24:13 +01:00
parent a4241d7008
commit 6004316f1a
17 changed files with 32 additions and 32 deletions

View File

@ -42,7 +42,7 @@ class WindowCreationPayload {
std::string getWorkspaceName() const { return m_workspaceName; } std::string getWorkspaceName() const { return m_workspaceName; }
WindowAddress getAddress() const { return m_windowAddress; } WindowAddress getAddress() const { return m_windowAddress; }
void moveToWorksace(std::string& new_workspace_name); void moveToWorkspace(std::string& new_workspace_name);
private: private:
void clearAddr(); void clearAddr();

View File

@ -55,11 +55,11 @@ class Workspace {
void setName(std::string const& value) { m_name = value; }; void setName(std::string const& value) { m_name = value; };
void setOutput(std::string const& value) { m_output = value; }; void setOutput(std::string const& value) { m_output = value; };
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); } bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
void insertWindow(WindowCreationPayload create_window_paylod); void insertWindow(WindowCreationPayload create_window_payload);
std::string removeWindow(WindowAddress const& addr); std::string removeWindow(WindowAddress const& addr);
void initializeWindowMap(const Json::Value& clients_data); void initializeWindowMap(const Json::Value& clients_data);
bool onWindowOpened(WindowCreationPayload const& create_window_paylod); bool onWindowOpened(WindowCreationPayload const& create_window_payload);
std::optional<std::string> closeWindow(WindowAddress const& addr); std::optional<std::string> closeWindow(WindowAddress const& addr);
void update(const std::string& format, const std::string& icon); void update(const std::string& format, const std::string& icon);

View File

@ -118,7 +118,7 @@ class Workspaces : public AModule, public EventHandler {
// Map for windows stored in workspaces not present in the current bar. // Map for windows stored in workspaces not present in the current bar.
// This happens when the user has multiple monitors (hence, multiple bars) // This happens when the user has multiple monitors (hence, multiple bars)
// and doesn't share windows accross bars (a.k.a `all-outputs` = false) // and doesn't share windows across bars (a.k.a `all-outputs` = false)
std::map<WindowAddress, std::string> m_orphanWindowMap; std::map<WindowAddress, std::string> m_orphanWindowMap;
enum class SortMethod { ID, NAME, NUMBER, DEFAULT }; enum class SortMethod { ID, NAME, NUMBER, DEFAULT };

View File

@ -21,7 +21,7 @@ class Language : public ALabel, public sigc::trackable {
auto update() -> void override; auto update() -> void override;
private: private:
enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 }; enum class DisplayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };
struct Layout { struct Layout {
std::string full_name; std::string full_name;
@ -58,7 +58,7 @@ class Language : public ALabel, public sigc::trackable {
std::map<std::string, Layout> layouts_map_; std::map<std::string, Layout> layouts_map_;
bool hide_single_; bool hide_single_;
bool is_variant_displayed; bool is_variant_displayed;
std::byte displayed_short_flag = static_cast<std::byte>(DispayedShortFlag::None); std::byte displayed_short_flag = static_cast<std::byte>(DisplayedShortFlag::None);
util::JsonParser parser_; util::JsonParser parser_;
std::mutex mutex_; std::mutex mutex_;

View File

@ -48,7 +48,7 @@ class Workspaces : public AModule, public sigc::trackable {
std::vector<std::string> high_priority_named_; std::vector<std::string> high_priority_named_;
std::vector<std::string> workspaces_order_; std::vector<std::string> workspaces_order_;
Gtk::Box box_; Gtk::Box box_;
std::string m_formatWindowSeperator; std::string m_formatWindowSeparator;
util::RegexCollection m_windowRewriteRules; util::RegexCollection m_windowRewriteRules;
util::JsonParser parser_; util::JsonParser parser_;
std::unordered_map<std::string, Gtk::Button> buttons_; std::unordered_map<std::string, Gtk::Button> buttons_;

View File

@ -4,6 +4,6 @@
namespace waybar::util { namespace waybar::util {
// Get a signal emited with value true when entering sleep, and false when exiting // Get a signal emitted with value true when entering sleep, and false when exiting
SafeSignal<bool>& prepare_for_sleep(); SafeSignal<bool>& prepare_for_sleep();
} // namespace waybar::util } // namespace waybar::util

View File

@ -7,7 +7,7 @@ waybar - menu property
# OVERVIEW # OVERVIEW
Some modules support a 'menu', which allows to have a popup menu whan a defined Some modules support a 'menu', which allows to have a popup menu when a defined
click is done over the module. click is done over the module.
# PROPERTIES # PROPERTIES

View File

@ -86,7 +86,7 @@ The visual display elements for waybar use a CSS stylesheet, see *waybar-styles(
*no-center* ++ *no-center* ++
typeof: bool ++ typeof: bool ++
default: false ++ default: false ++
Option to disable the center modules fully usefull together with expand-\*. Option to disable the center modules fully useful together with expand-\*.
*spacing* ++ *spacing* ++
typeof: integer ++ typeof: integer ++

View File

@ -97,11 +97,11 @@ auto AModule::update() -> void {
} }
} }
// Get mapping between event name and module action name // Get mapping between event name and module action name
// Then call overrided doAction in order to call appropriate module action // Then call overridden doAction in order to call appropriate module action
auto AModule::doAction(const std::string& name) -> void { auto AModule::doAction(const std::string& name) -> void {
if (!name.empty()) { if (!name.empty()) {
const std::map<std::string, std::string>::const_iterator& recA{eventActionMap_.find(name)}; const std::map<std::string, std::string>::const_iterator& recA{eventActionMap_.find(name)};
// Call overrided action if derrived class has implemented it // Call overridden action if derived class has implemented it
if (recA != eventActionMap_.cend() && name != recA->second) this->doAction(recA->second); if (recA != eventActionMap_.cend() && name != recA->second) this->doAction(recA->second);
} }
} }

View File

@ -20,7 +20,7 @@ Submap::Submap(const std::string& id, const Bar& bar, const Json::Value& config)
ALabel::update(); ALabel::update();
// Displays widget immediately if always_on_ assuming default submap // Displays widget immediately if always_on_ assuming default submap
// Needs an actual way to retrive current submap on startup // Needs an actual way to retrieve current submap on startup
if (always_on_) { if (always_on_) {
submap_ = default_submap_; submap_ = default_submap_;
label_.get_style_context()->add_class(submap_); label_.get_style_context()->add_class(submap_);

View File

@ -88,7 +88,7 @@ bool WindowCreationPayload::isEmpty(Workspaces &workspace_manager) {
int WindowCreationPayload::incrementTimeSpentUncreated() { return m_timeSpentUncreated++; } int WindowCreationPayload::incrementTimeSpentUncreated() { return m_timeSpentUncreated++; }
void WindowCreationPayload::moveToWorksace(std::string &new_workspace_name) { void WindowCreationPayload::moveToWorkspace(std::string &new_workspace_name) {
m_workspaceName = new_workspace_name; m_workspaceName = new_workspace_name;
} }

View File

@ -90,19 +90,19 @@ void Workspace::initializeWindowMap(const Json::Value &clients_data) {
} }
} }
void Workspace::insertWindow(WindowCreationPayload create_window_paylod) { void Workspace::insertWindow(WindowCreationPayload create_window_payload) {
if (!create_window_paylod.isEmpty(m_workspaceManager)) { if (!create_window_payload.isEmpty(m_workspaceManager)) {
auto repr = create_window_paylod.repr(m_workspaceManager); auto repr = create_window_payload.repr(m_workspaceManager);
if (!repr.empty()) { if (!repr.empty()) {
m_windowMap[create_window_paylod.getAddress()] = repr; m_windowMap[create_window_payload.getAddress()] = repr;
} }
} }
}; };
bool Workspace::onWindowOpened(WindowCreationPayload const &create_window_paylod) { bool Workspace::onWindowOpened(WindowCreationPayload const &create_window_payload) {
if (create_window_paylod.getWorkspaceName() == name()) { if (create_window_payload.getWorkspaceName() == name()) {
insertWindow(create_window_paylod); insertWindow(create_window_payload);
return true; return true;
} }
return false; return false;

View File

@ -487,7 +487,7 @@ void Workspaces::onWindowMoved(std::string const &payload) {
// and exit // and exit
for (auto &window : m_windowsToCreate) { for (auto &window : m_windowsToCreate) {
if (window.getAddress() == windowAddress) { if (window.getAddress() == windowAddress) {
window.moveToWorksace(workspaceName); window.moveToWorkspace(workspaceName);
return; return;
} }
} }

View File

@ -29,14 +29,14 @@ PowerProfilesDaemon::PowerProfilesDaemon(const std::string& id, const Json::Valu
// method on the proxy to see whether or not something's responding // method on the proxy to see whether or not something's responding
// on the other side. // on the other side.
// NOTE: the DBus adresses are under migration. They should be // NOTE: the DBus addresses are under migration. They should be
// changed to org.freedesktop.UPower.PowerProfiles at some point. // changed to org.freedesktop.UPower.PowerProfiles at some point.
// //
// See // See
// https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/releases/0.20 // https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/releases/0.20
// //
// The old name is still announced for now. Let's rather use the old // The old name is still announced for now. Let's rather use the old
// adresses for compatibility sake. // addresses for compatibility sake.
// //
// Revisit this in 2026, systems should be updated by then. // Revisit this in 2026, systems should be updated by then.

View File

@ -22,10 +22,10 @@ Language::Language(const std::string& id, const Json::Value& config)
hide_single_ = config["hide-single-layout"].isBool() && config["hide-single-layout"].asBool(); hide_single_ = config["hide-single-layout"].isBool() && config["hide-single-layout"].asBool();
is_variant_displayed = format_.find("{variant}") != std::string::npos; is_variant_displayed = format_.find("{variant}") != std::string::npos;
if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) { if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) {
displayed_short_flag |= static_cast<std::byte>(DispayedShortFlag::ShortName); displayed_short_flag |= static_cast<std::byte>(DisplayedShortFlag::ShortName);
} }
if (format_.find("{shortDescription}") != std::string::npos) { if (format_.find("{shortDescription}") != std::string::npos) {
displayed_short_flag |= static_cast<std::byte>(DispayedShortFlag::ShortDescription); displayed_short_flag |= static_cast<std::byte>(DisplayedShortFlag::ShortDescription);
} }
if (config.isMember("tooltip-format")) { if (config.isMember("tooltip-format")) {
tooltip_format_ = config["tooltip-format"].asString(); tooltip_format_ = config["tooltip-format"].asString();

View File

@ -57,9 +57,9 @@ Workspaces::Workspaces(const std::string &id, const Bar &bar, const Json::Value
box_.get_style_context()->add_class(MODULE_CLASS); box_.get_style_context()->add_class(MODULE_CLASS);
event_box_.add(box_); event_box_.add(box_);
if (config_["format-window-separator"].isString()) { if (config_["format-window-separator"].isString()) {
m_formatWindowSeperator = config_["format-window-separator"].asString(); m_formatWindowSeparator = config_["format-window-separator"].asString();
} else { } else {
m_formatWindowSeperator = " "; m_formatWindowSeparator = " ";
} }
const Json::Value &windowRewrite = config["window-rewrite"]; const Json::Value &windowRewrite = config["window-rewrite"];
if (windowRewrite.isObject()) { if (windowRewrite.isObject()) {
@ -271,7 +271,7 @@ void Workspaces::updateWindows(const Json::Value &node, std::string &windows) {
window = fmt::format(fmt::runtime(window), fmt::arg("name", title), window = fmt::format(fmt::runtime(window), fmt::arg("name", title),
fmt::arg("class", windowClass)); fmt::arg("class", windowClass));
windows.append(window); windows.append(window);
windows.append(m_formatWindowSeperator); windows.append(m_formatWindowSeparator);
} }
} }
for (const Json::Value &child : node["nodes"]) { for (const Json::Value &child : node["nodes"]) {
@ -340,7 +340,7 @@ auto Workspaces::update() -> void {
fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)), fmt::arg("value", output), fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)), fmt::arg("value", output),
fmt::arg("name", trimWorkspaceName(output)), fmt::arg("index", (*it)["num"].asString()), fmt::arg("name", trimWorkspaceName(output)), fmt::arg("index", (*it)["num"].asString()),
fmt::arg("windows", fmt::arg("windows",
windows.substr(0, windows.length() - m_formatWindowSeperator.length())), windows.substr(0, windows.length() - m_formatWindowSeparator.length())),
fmt::arg("output", (*it)["output"].asString())); fmt::arg("output", (*it)["output"].asString()));
} }
if (!config_["disable-markup"].asBool()) { if (!config_["disable-markup"].asBool()) {

View File

@ -45,7 +45,7 @@ waybar::modules::Temperature::Temperature(const std::string& id, const Json::Val
file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone); file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone);
} }
// check if file_path_ can be used to retrive the temperature // check if file_path_ can be used to retrieve the temperature
std::ifstream temp(file_path_); std::ifstream temp(file_path_);
if (!temp.is_open()) { if (!temp.is_open()) {
throw std::runtime_error("Can't open " + file_path_); throw std::runtime_error("Can't open " + file_path_);