diff options
author | Ratchanan Srirattanamet <ratchanan@ubports.com> | 2023-06-30 00:19:23 +0700 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-07-12 02:23:15 +0200 |
commit | 822b8010b127974286bd19133654dfbfe5ce94f2 (patch) | |
tree | fb64c9feea5ee40806821576ef0fbf29bda4a67c /src | |
parent | 9823a1daea4dce08a9a376dc88875204be241443 (diff) | |
download | ayatana-indicator-power-822b8010b127974286bd19133654dfbfe5ce94f2.tar.gz ayatana-indicator-power-822b8010b127974286bd19133654dfbfe5ce94f2.tar.bz2 ayatana-indicator-power-822b8010b127974286bd19133654dfbfe5ce94f2.zip |
src/service.c: stop special-casing Lomiri for level indicator type
Since the change in level reporting from an action to menu attribute is
a breaking change for Lomiri anyway, we might as well let Lomiri use
.level indicator type.
This reduces 1 special case for Lomiri, for which there is multiple
throughout the codebase. We probably want to minimize this over time...
Bug-UBports: https://gitlab.com/ubports/development/core/lomiri/-/issues/70
Diffstat (limited to 'src')
-rw-r--r-- | src/service.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/service.c b/src/service.c index 3e24945..3a0ff82 100644 --- a/src/service.c +++ b/src/service.c @@ -531,25 +531,11 @@ create_devices_section (IndicatorPowerService * self, int profile) sLabel = indicator_power_device_get_readable_text (device, TRUE); } - gchar *sIndicator = NULL; - gchar *sProperty = NULL; - - if (!ayatana_common_utils_is_lomiri()) - { - sIndicator = "org.ayatana.indicator.level"; - sProperty = "x-ayatana-level"; - } - else - { - sIndicator = "org.ayatana.indicator.progress"; - sProperty = "x-ayatana-progress"; - } - GMenuItem * item = g_menu_item_new (sLabel, NULL); g_free (sLabel); - g_menu_item_set_attribute (item, "x-ayatana-type", "s", sIndicator); + g_menu_item_set_attribute (item, "x-ayatana-type", "s", "org.ayatana.indicator.level"); guint16 battery_level = (guint16)(indicator_power_device_get_percentage (device) + 0.5); - g_menu_item_set_attribute (item, sProperty, "q", battery_level); + g_menu_item_set_attribute (item, "x-ayatana-level", "q", battery_level); if (!ayatana_common_utils_is_lomiri()) { |