Skip to content

Commit 49f95ce

Browse files
committed
Upower happy linter
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
1 parent 3cc18c8 commit 49f95ce

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: include/modules/upower.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class UPower final : public AIconLabel {
5555
void resetDevices();
5656
void setDisplayDevice();
5757
const Glib::ustring getText(const upDevice_output &upDevice_, const std::string &format);
58-
bool queryTooltip_cb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip>&);
58+
bool queryTooltip_cb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &);
5959

6060
// DBUS variables
6161
guint watcherID_;

Diff for: src/modules/upower.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ static std::string_view secondsToString(const std::chrono::seconds sec) {
178178
"UPower::secondsToString(). seconds: \"{0}\", minutes: \"{1}\", hours: \"{2}\", \
179179
days: \"{3}\", strRet: \"{4}\"",
180180
sec.count(), min.count(), hrs.count(), ds.count(), strRet);
181-
return fmt::format(fmt::runtime(strRet),
182-
fmt::arg("D", ds.count()),
183-
fmt::arg("H", hrs.count()),
181+
return fmt::format(fmt::runtime(strRet), fmt::arg("D", ds.count()), fmt::arg("H", hrs.count()),
184182
fmt::arg("M", min.count()));
185183
}
186184

@@ -279,7 +277,7 @@ void UPower::deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data) {
279277
}
280278

281279
void UPower::deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data) {
282-
UPower * up{static_cast<UPower *>(data)};
280+
UPower *up{static_cast<UPower *>(data)};
283281
up->removeDevice(objectPath);
284282
up->setDisplayDevice();
285283
// Update the widget
@@ -419,7 +417,7 @@ const Glib::ustring UPower::getText(const upDevice_output &upDevice_, const std:
419417
fmt::runtime(format),
420418
fmt::arg("percentage", std::to_string((int)std::round(upDevice_.percentage)) + '%'),
421419
fmt::arg("time", timeStr),
422-
fmt::arg("temperature", std::format("{:-.2g}C",upDevice_.temperature)),
420+
fmt::arg("temperature", std::format("{:-.2g}C", upDevice_.temperature)),
423421
fmt::arg("model", upDevice_.model), fmt::arg("native-path", upDevice_.nativePath));
424422
}
425423

0 commit comments

Comments
 (0)