aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-19 10:10:50 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-19 10:10:50 -0500
commit8f744774af079ec4c497377ae6dc4d833db8a360 (patch)
tree02d30547d77bdd0ab6c134618331a83963a41c0c /src/main.c
parente2431a9ab55122b74397b4536ea95f769bc64999 (diff)
downloadayatana-indicator-power-8f744774af079ec4c497377ae6dc4d833db8a360.tar.gz
ayatana-indicator-power-8f744774af079ec4c497377ae6dc4d833db8a360.tar.bz2
ayatana-indicator-power-8f744774af079ec4c497377ae6dc4d833db8a360.zip
remove the '--replace' command line argument; process management will be handled by Upstart
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/main.c b/src/main.c
index 7bb6b92..ef615dc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,37 +33,6 @@
****
***/
-static gboolean replace = FALSE;
-
-static void
-parse_command_line (int * argc, char *** argv)
-{
- GError * error;
- GOptionContext * option_context;
-
- static GOptionEntry entries[] =
- {
- { "replace", 'r', 0, G_OPTION_ARG_NONE, &replace, "Replace the currently-running service", NULL },
- { NULL }
- };
-
- error = NULL;
- option_context = g_option_context_new ("- indicator-power service");
- g_option_context_add_main_entries (option_context, entries, GETTEXT_PACKAGE);
- if (!g_option_context_parse (option_context, argc, argv, &error))
- {
- g_print ("option parsing failed: %s\n", error->message);
- g_error_free (error);
- exit (EXIT_FAILURE);
- }
-
- g_option_context_free (option_context);
-}
-
-/***
-****
-***/
-
static void
on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop)
{
@@ -72,7 +41,7 @@ on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop)
}
int
-main (int argc, char ** argv)
+main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED)
{
GMainLoop * loop;
IndicatorPowerService * service;
@@ -83,11 +52,9 @@ main (int argc, char ** argv)
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
textdomain (GETTEXT_PACKAGE);
- parse_command_line (&argc, &argv);
-
/* run */
device_provider = indicator_power_device_provider_upower_new ();
- service = indicator_power_service_new (replace, device_provider);
+ service = indicator_power_service_new (device_provider);
loop = g_main_loop_new (NULL, FALSE);
g_signal_connect (service, INDICATOR_POWER_SERVICE_SIGNAL_NAME_LOST,
G_CALLBACK(on_name_lost), loop);