aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-02 13:48:48 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-11-02 13:48:48 +0100
commitba840e537b10fb4b0a9a6f8c2d4708ee0b525d21 (patch)
tree7e202266f2f687f3714b6bd81c411fe7f72ec8fc /src/service.c
parent9e19aaef2031739d8ddba99aafc8f9f2d5d740fd (diff)
downloadayatana-indicator-session-ba840e537b10fb4b0a9a6f8c2d4708ee0b525d21.tar.gz
ayatana-indicator-session-ba840e537b10fb4b0a9a6f8c2d4708ee0b525d21.tar.bz2
ayatana-indicator-session-ba840e537b10fb4b0a9a6f8c2d4708ee0b525d21.zip
{CMakeLists.txt,src/service.c}: Make building against librda optional.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 7711f97..eff36ca 100644
--- a/src/service.c
+++ b/src/service.c
@@ -22,7 +22,9 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <ayatana/common/utils.h>
-#include <rda/rda.h>
+#ifdef RDA_ENABLED
+# include <rda/rda.h>
+#endif /* RDA_ENABLED */
#include "backend.h"
#include "recoverable-problem.h"
#include "service.h"
@@ -885,12 +887,14 @@ create_session_section (IndicatorSessionService * self, int profile)
}
else
{
+#ifdef RDA_ENABLED
gboolean bSuspendable = rda_session_can_be_suspended ();
if (bSuspendable)
{
g_menu_append (menu, _("Suspend Remote Session"), "indicator.remotesuspend");
}
+#endif
}
return G_MENU_MODEL (menu);
@@ -1016,7 +1020,9 @@ on_logout_activated (GSimpleAction * a G_GNUC_UNUSED,
if (!self->priv->bLocal)
{
+#ifdef RDA_ENABLED
rda_session_terminate ();
+#endif /* RDA_ENABLED */
}
else
{
@@ -1099,7 +1105,9 @@ static void on_custom_activated (GSimpleAction *pAction G_GNUC_UNUSED, GVariant
static void onRemoteSuspend (GSimpleAction *pAction G_GNUC_UNUSED, GVariant *pParam G_GNUC_UNUSED, gpointer pUserData)
{
+#ifdef RDA_ENABLED
rda_session_suspend ();
+#endif /* RDA_ENABLED */
}
static void
@@ -1413,7 +1421,9 @@ indicator_session_service_init (IndicatorSessionService * self)
}
self->priv = p;
+#if RDA_ENABLED
self->priv->bLocal = rda_session_is_local ();
+#endif /* RDA_ENABLED */
/* init the backend objects */
p->cancellable = g_cancellable_new ();