aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-21 22:22:21 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-27 16:29:28 +0100
commit5b53d364c64602c3dee72210b4ed9320e4d0efa3 (patch)
tree1e6c2bca3e004f418ea7f90882cb2f2524a97399 /src/utils.c
parent8e57201526a2e2a0a585ebadb498fb26b74edc12 (diff)
downloadayatana-indicator-session-5b53d364c64602c3dee72210b4ed9320e4d0efa3.tar.gz
ayatana-indicator-session-5b53d364c64602c3dee72210b4ed9320e4d0efa3.tar.bz2
ayatana-indicator-session-5b53d364c64602c3dee72210b4ed9320e4d0efa3.zip
src/{service.c,dbus-backends/actions.c}: Special treatment if running in an Ubuntu Touch session for desktop help, distro help and bug reporting URL.
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/src/utils.c b/src/utils.c
index 9593a46..cd01edf 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -98,21 +98,29 @@ get_distro_url (void)
if (distro_url == NULL)
{
- GHashTable * os_release = get_os_release();
- gpointer value = g_hash_table_lookup(os_release, "SUPPORT_URL");
-
- if (value == NULL)
- {
- value = g_hash_table_lookup(os_release, "HOME_URL");
-
- if (value == NULL)
+ if (g_strcmp0(get_desktop_session(), "ubuntu-touch") == 0)
{
- value = "https://www.gnu.org"; /* fallback value */
+ distro_url = g_strdup("https://ubports.com");
}
- }
+ else
+ {
- distro_url = g_strdup(value);
- g_hash_table_destroy(os_release);
+ GHashTable * os_release = get_os_release();
+ gpointer value = g_hash_table_lookup(os_release, "SUPPORT_URL");
+
+ if (value == NULL)
+ {
+ value = g_hash_table_lookup(os_release, "HOME_URL");
+
+ if (value == NULL)
+ {
+ value = "https://www.gnu.org"; /* fallback value */
+ }
+ }
+
+ distro_url = g_strdup(value);
+ g_hash_table_destroy(os_release);
+ }
}
return distro_url;
@@ -125,12 +133,19 @@ get_distro_bts_url (void)
if (distro_bts_url == NULL)
{
- GHashTable * os_release = get_os_release();
- gpointer value = g_hash_table_lookup(os_release, "BUG_REPORT_URL");
- if (value == NULL)
- value = "https://github.com/AyatanaIndicators/ayatana-indicator-session/issues"; /* fallback value */
- distro_bts_url = g_strdup(value);
- g_hash_table_destroy(os_release);
+ if (g_strcmp0(get_desktop_session(), "ubuntu-touch") == 0)
+ {
+ distro_bts_url = g_strdup("https://gitlab.com/ubports/porting");
+ }
+ else
+ {
+ GHashTable * os_release = get_os_release();
+ gpointer value = g_hash_table_lookup(os_release, "BUG_REPORT_URL");
+ if (value == NULL)
+ value = "https://github.com/AyatanaIndicators/ayatana-indicator-session/issues"; /* fallback value */
+ distro_bts_url = g_strdup(value);
+ g_hash_table_destroy(os_release);
+ }
}
return distro_bts_url;