util: clang-tidy
This commit is contained in:
@ -56,10 +56,10 @@ class BacklightBackend {
|
||||
|
||||
void set_previous_best_device(const BacklightDevice *device);
|
||||
|
||||
void set_brightness(std::string preferred_device, ChangeType change_type, double step);
|
||||
void set_brightness(const std::string &preferred_device, ChangeType change_type, double step);
|
||||
|
||||
void set_scaled_brightness(std::string preferred_device, int brightness);
|
||||
int get_scaled_brightness(std::string preferred_device);
|
||||
void set_scaled_brightness(const std::string &preferred_device, int brightness);
|
||||
int get_scaled_brightness(const std::string &preferred_device);
|
||||
|
||||
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
|
||||
|
||||
@ -70,7 +70,7 @@ class BacklightBackend {
|
||||
std::mutex udev_thread_mutex_;
|
||||
|
||||
private:
|
||||
void set_brightness_internal(std::string device_name, int brightness, int max_brightness);
|
||||
void set_brightness_internal(const std::string &device_name, int brightness, int max_brightness);
|
||||
|
||||
std::function<void()> on_updated_cb_;
|
||||
std::chrono::milliseconds polling_interval_;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <functional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
@ -17,7 +18,7 @@ struct Rule {
|
||||
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
||||
// aggregates"
|
||||
Rule(std::regex rule, std::string repr, int priority)
|
||||
: rule(rule), repr(repr), priority(priority) {}
|
||||
: rule(std::move(rule)), repr(std::move(repr)), priority(priority) {}
|
||||
};
|
||||
|
||||
int default_priority_function(std::string& key);
|
||||
@ -40,8 +41,9 @@ class RegexCollection {
|
||||
|
||||
public:
|
||||
RegexCollection() = default;
|
||||
RegexCollection(const Json::Value& map, std::string default_repr = "",
|
||||
std::function<int(std::string&)> priority_function = default_priority_function);
|
||||
RegexCollection(
|
||||
const Json::Value& map, std::string default_repr = "",
|
||||
const std::function<int(std::string&)>& priority_function = default_priority_function);
|
||||
~RegexCollection() = default;
|
||||
|
||||
std::string& get(std::string& value, bool& matched_any);
|
||||
|
Reference in New Issue
Block a user