Closed rbuj closed 2 years ago
I wonder if there is a good reason why last_charging
and last_acline_status
are not gbooleans:
$ grep -r last_charging
battstat_applet.c: if (battstat->last_charging &&
battstat_applet.c: info.charging != battstat->last_charging)
battstat_applet.c: battstat->last_charging = (info.charging != FALSE);
battstat_applet.c: battstat->last_charging = 1000;
battstat.h: guint last_charging;
grep: battstat-applet: binary file matches
$ grep -r last_acline_status
battstat_applet.c: battstat->last_acline_status &&
battstat_applet.c: battstat->last_acline_status!=1000 &&
battstat_applet.c: if (info.on_ac_power != battstat->last_acline_status ||
battstat_applet.c: battstat->last_acline_status != info.on_ac_power ||
battstat_applet.c: battstat->last_acline_status = (info.on_ac_powerg != FALSE);
battstat_applet.c: battstat->last_acline_status = 1000;
battstat.h: guint last_acline_status;
grep: battstat-applet: binary file matches
I wonder if there is a good reason why
last_charging
andlast_acline_status
are not gbooleans
They are tristate variables.
enum TriState {Off = 0, On = 1, Unknown = 1000 };
thanks, that is a lot nicer code :)