From 225638336336d34e4357de264258cce0e80e5f30 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 4 Aug 2023 15:19:35 +0200 Subject: src/notifier.c: Do not access freed variable --- src/notifier.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/notifier.c b/src/notifier.c index c513656..0a56b6b 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -1,6 +1,6 @@ /* * Copyright 2014-2016 Canonical Ltd. - * Copyright 2021-2022 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -309,7 +309,6 @@ notification_show(IndicatorPowerNotifier * self) icon_name = NULL; nn = notify_notification_new(title, body, icon_name); g_strfreev (icon_names); - g_free (body); if (are_actions_supported(self)) { @@ -355,6 +354,8 @@ notification_show(IndicatorPowerNotifier * self) g_error_free(error); g_object_unref(nn); } + + g_free (body); } /*** -- cgit v1.2.3 From 319748d4476c7731d883597f6a2c161d865e1049 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Thu, 10 Aug 2023 19:44:56 +0200 Subject: Do not show when in a remote session fixes https://github.com/AyatanaIndicators/ayatana-indicator-power/issues/13 --- CMakeLists.txt | 1 + src/service.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 755a09a..a4035c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,7 @@ set( gio-unix-2.0>=2.36 libnotify>=0.7.6 libayatana-common>=0.9.1 + rda ) if (ENABLE_LOMIRI_FEATURES) diff --git a/src/service.c b/src/service.c index 3a0ff82..3f3e3b0 100644 --- a/src/service.c +++ b/src/service.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "brightness.h" #include "dbus-shared.h" @@ -118,7 +119,7 @@ struct _IndicatorPowerServicePrivate GSimpleAction * battery_level_action; GSimpleAction * device_state_action; GSimpleAction * brightness_action; - + gboolean bLocal; IndicatorPowerDevice * primary_device; GList * devices; /* IndicatorPowerDevice */ @@ -387,14 +388,19 @@ count_batteries (GList * devices, int *total, int *inuse) static gboolean should_be_visible (IndicatorPowerService * self) { + gboolean visible = TRUE; + priv_t * p = self->priv; + + if (!self->priv->bLocal) + { + return FALSE; + } + if (!ayatana_common_utils_is_lomiri()) { return TRUE; } - gboolean visible = TRUE; - priv_t * p = self->priv; - const int policy = g_settings_get_enum (p->settings, SETTINGS_ICON_POLICY_S); g_debug ("policy is: %d (present==0, charge==1, never==2)", policy); @@ -1182,7 +1188,7 @@ indicator_power_service_init (IndicatorPowerService * self) self->priv = p; p->cancellable = g_cancellable_new (); - + p->bLocal = rda_session_is_local (); p->settings = g_settings_new ("org.ayatana.indicator.power"); p->brightness = indicator_power_brightness_new(); -- cgit v1.2.3 From 7db56c61624c81ed0b8f31c3c4424ca68955d539 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 7 Aug 2023 15:48:46 +0200 Subject: debian/control: Add librda dependency --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 5450ce1..8c552e8 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Build-Depends: cmake, libnotify-dev (>= 0.7.6), libglib2.0-dev (>= 2.36), lomiri-schemas | hello, + librda-dev, # for packaging debhelper (>= 10), dpkg-dev (>= 1.16.1.1), -- cgit v1.2.3 From 60c00e40d89e733cbee3f62ed86f1531efea1135 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 7 Aug 2023 15:49:28 +0200 Subject: .build.yml: Add librda dependency --- .build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index 4284dc4..916609b 100644 --- a/.build.yml +++ b/.build.yml @@ -13,7 +13,7 @@ requires: - cmake - cmake-extras - intltool -# - libayatana-common + - libayatana-common - liblomiri-url-dispatcher - gobject-introspection - vala @@ -21,6 +21,7 @@ requires: - libnotify - systemd - gstreamer + - librda debian: # Useful URL: https://salsa.debian.org/debian-ayatana-team/ayatana-indicator-power @@ -47,6 +48,7 @@ requires: - libdbustest1-dev - systemd - libgstreamer1.0-dev + - librda-dev ubuntu: - clang @@ -69,6 +71,7 @@ requires: - libdbustest1-dev - systemd - libgstreamer1.0-dev + - librda-dev ubuntu:focal: - clang @@ -91,6 +94,7 @@ requires: - libdbustest1-dev - systemd - libgstreamer1.0-dev + - librda-dev variables: - 'CHECKERS=" -- cgit v1.2.3 From 62d78d59fab309f06de6fd4629d0c45523bcbf98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Sun, 20 Aug 2023 22:42:25 +0000 Subject: Translated using Weblate (Turkish) Currently translated at 100.0% (68 of 68 strings) Translation: Ayatana Indicators/Power Indicator Applet Translate-URL: https://hosted.weblate.org/projects/ayatana-indicators/power-applet/tr/ --- po/tr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/tr.po b/po/tr.po index 566ea52..7bd2be4 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-09 08:13+0200\n" -"PO-Revision-Date: 2023-06-11 15:49+0000\n" +"PO-Revision-Date: 2023-08-21 22:52+0000\n" "Last-Translator: Sabri Ünal \n" "Language-Team: Turkish \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.18-dev\n" +"X-Generator: Weblate 5.0-dev\n" #: data/org.ayatana.indicator.power.gschema.xml:1 msgid "Show time in Menu Bar" @@ -126,7 +126,7 @@ msgstr "Ağ aygıtı" #: src/device.c:735 msgid "Headset" -msgstr "Kulaklık" +msgstr "Kulaklık Seti" #. TRANSLATORS: loudspeakers with internal batteries #: src/device.c:739 -- cgit v1.2.3