summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2009-02-06 17:22:33 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2009-02-06 17:22:33 +0800
commit2b30fe871a569b8d33d9fa2e97307f9ef6224c0d (patch)
tree9b004338b3e2fbf00cd76e566c8348df21722567 /bus
parent7818373100d18f04dc049a466f9f30bb32965176 (diff)
downloadibus-2b30fe871a569b8d33d9fa2e97307f9ef6224c0d.tar.gz
ibus-2b30fe871a569b8d33d9fa2e97307f9ef6224c0d.tar.xz
ibus-2b30fe871a569b8d33d9fa2e97307f9ef6224c0d.zip
Implement --rescan option for ibus-daemon.
Diffstat (limited to 'bus')
-rw-r--r--bus/main.c4
-rw-r--r--bus/registry.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/bus/main.c b/bus/main.c
index 4650bfc..31ca8b0 100644
--- a/bus/main.c
+++ b/bus/main.c
@@ -33,7 +33,7 @@ static gchar *panel = "default";
static gchar *config = "default";
static gchar *desktop = "gnome";
static gchar *address = "";
-static gboolean rescan = FALSE;
+gboolean g_rescan = FALSE;
static gboolean verbose = FALSE;
static const GOptionEntry entries[] =
@@ -45,7 +45,7 @@ static const GOptionEntry entries[] =
{ "panel", 'p', 0, G_OPTION_ARG_STRING, &panel, "specify the cmdline of panel program.", "cmdline" },
{ "config", 'c', 0, G_OPTION_ARG_STRING, &config, "specify the cmdline of config program.", "cmdline" },
{ "address", 'a', 0, G_OPTION_ARG_STRING, &address, "specify the address of ibus daemon.", "address" },
- { "rescan", 'r', 0, G_OPTION_ARG_NONE, &rescan, "force to rescan components, and recreate registry cache.", NULL },
+ { "rescan", 'r', 0, G_OPTION_ARG_NONE, &g_rescan, "force to rescan components, and recreate registry cache.", NULL },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "verbose.", NULL },
{ NULL },
};
diff --git a/bus/registry.c b/bus/registry.c
index 516554e..13e1cdf 100644
--- a/bus/registry.c
+++ b/bus/registry.c
@@ -87,8 +87,12 @@ bus_registry_init (BusRegistry *registry)
registry->observed_paths = NULL;
registry->components = NULL;
registry->engine_table = g_hash_table_new (g_str_hash, g_str_equal);
+
+ extern gboolean g_rescan;
- if (bus_registry_load_cache (registry) == FALSE || bus_registry_check_modification (registry)) {
+ if (g_rescan ||
+ bus_registry_load_cache (registry) == FALSE ||
+ bus_registry_check_modification (registry)) {
bus_registry_remove_all (registry);
bus_registry_load (registry);
bus_registry_save_cache (registry);