aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-15 19:54:42 -0600
committerTed Gould <ted@gould.cx>2010-01-15 19:54:42 -0600
commit41559b3cc70cffacc023a6a21cca41b5b1070447 (patch)
tree106c3fdeb425f0dc8924ff357d3d2c3095951b7b /libindicator
parentcee358bbe03e31ded010cce92ab201081cbe8807 (diff)
downloadlibayatana-indicator-41559b3cc70cffacc023a6a21cca41b5b1070447.tar.gz
libayatana-indicator-41559b3cc70cffacc023a6a21cca41b5b1070447.tar.bz2
libayatana-indicator-41559b3cc70cffacc023a6a21cca41b5b1070447.zip
Getting a multiplier, and providing a way to override it using an environment variable.
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/indicator-service-manager.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c
index 69b1343..ee29767 100644
--- a/libindicator/indicator-service-manager.c
+++ b/libindicator/indicator-service-manager.c
@@ -25,6 +25,8 @@ License along with this library. If not, see
#include "config.h"
#endif
+#include <stdlib.h>
+
#include <dbus/dbus-glib-bindings.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -60,6 +62,10 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
+/* We multiply our timeouts by in ms. This can be overriden by
+ the environment variable INDICATOR_SERVICE_RESTART_TIMEOUT. */
+static guint timeout_multiplier = 100;
+#define TIMEOUT_ENV_NAME "INDICATOR_SERVICE_RESTART_TIMEOUT"
/* Properties */
/* Enum for the properties so that they can be quickly
@@ -136,6 +142,15 @@ indicator_service_manager_class_init (IndicatorServiceManagerClass *klass)
0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /* Look to see if there is an environment variable effecting
+ the restart interval. This is in the class init as it should
+ only happen once. */
+ const gchar * restart_env = g_getenv(TIMEOUT_ENV_NAME);
+ if (restart_env != NULL) {
+ timeout_multiplier = atoi(restart_env);
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Time out multipler set to: %d", timeout_multiplier);
+ }
+
return;
}