diff --git a/.cvsignore b/.cvsignore index d9f0ed2..4e97c4a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -17,3 +17,4 @@ imsettings-0.107.0.tar.bz2 imsettings-0.107.1.tar.bz2 imsettings-0.107.2.tar.bz2 imsettings-0.107.3.tar.bz2 +imsettings-0.107.4.tar.bz2 diff --git a/imsettings-close-fd.patch b/imsettings-close-fd.patch deleted file mode 100644 index df2cae7..0000000 --- a/imsettings-close-fd.patch +++ /dev/null @@ -1,36 +0,0 @@ -2009-09-17 Akira TAGOH - - * src/factory.c (_stop_process): get rid of the unnecessary increasing - the reference count, which causes taking a lot CPU load again. - -Index: src/factory.c -=================================================================== ---- src/factory.c (リビジョン 345) -+++ src/factory.c (リビジョン 346) -@@ -652,7 +652,7 @@ - { - gboolean retval = FALSE; - GHashTable *hash; -- struct ProcessInformation *info, *tmp; -+ struct ProcessInformation *info; - - if (is_body) { - hash = priv->body2info; -@@ -670,17 +670,13 @@ - retval = TRUE; - } - } else { -- tmp = _process_info_ref(info); - /* info will be deleted from *2info Hash table at _watch_im_status_cb when the process is really died. */ - g_hash_table_remove(priv->pid2id, GINT_TO_POINTER (info->pid)); - if (kill(-info->pid, SIGTERM) == -1) { -- gchar *module = g_strdup(identity); -- - g_set_error(error, IMSETTINGS_GERROR, IMSETTINGS_GERROR_UNABLE_TO_TRACK_IM, - _("Couldn't send a signal to the %s process successfully."), - is_body ? "Main" : "AUX"); - /* push back to the table */ -- g_hash_table_insert(hash, module, tmp); - g_hash_table_insert(priv->pid2id, GINT_TO_POINTER (info->pid), GUINT_TO_POINTER (info->id)); - } else { - GTimeVal time; diff --git a/imsettings-unref-later.patch b/imsettings-unref-later.patch deleted file mode 100644 index 70a3070..0000000 --- a/imsettings-unref-later.patch +++ /dev/null @@ -1,91 +0,0 @@ -2009-09-11 Akira TAGOH - - * src/factory.c (_get_process_info_by_pid): new. - (_watch_im_status_cb): unref'd the instance here to not keep - the process running as zombie. (rhbz#522689) - (_stop_process): don't remove the instance from the hash table yet. - -Index: src/factory.c -=================================================================== ---- src/factory.c (リビジョン 340) -+++ src/factory.c (リビジョン 341) -@@ -214,6 +214,25 @@ - return NULL; - } - -+static struct ProcessInformation * -+_get_process_info_by_pid(GHashTable *table, -+ GPid pid) -+{ -+ GHashTableIter iter; -+ gpointer key, val; -+ -+ g_hash_table_iter_init(&iter, table); -+ while (g_hash_table_iter_next(&iter, &key, &val)) { -+ struct ProcessInformation *info = val; -+ -+ if (pid == info->pid) { -+ return info; -+ } -+ } -+ -+ return NULL; -+} -+ - static GPid - _get_pid_from_name(IMSettingsManagerPrivate *priv, - gboolean is_body, -@@ -462,8 +481,25 @@ - } - } - } else { -- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, -- "pid %d is successfully stopped with %s.", pid, status_message->str); -+ info = _get_process_info_by_pid(priv->body2info, pid); -+ if (info == NULL) { -+ is_body = FALSE; -+ info = _get_process_info_by_pid(priv->aux2info, pid); -+ } -+ if (info == NULL) { -+ g_warning("No consistency in the internal process management database: pid: %d", pid); -+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, -+ "pid %d is successfully stopped with %s.", pid, status_message->str); -+ } else { -+ gchar *module = g_strdup(info->module); -+ -+ g_hash_table_remove(is_body ? priv->body2info : priv->aux2info, -+ info->module); -+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, -+ "Stopped %s process for %s with %s: pid %d", -+ is_body ? "Main" : "AUX", module, status_message->str, pid); -+ g_free(module); -+ } - } - if (status_message) - g_string_free(status_message, TRUE); -@@ -635,7 +671,7 @@ - } - } else { - tmp = _process_info_ref(info); -- g_hash_table_remove(hash, identity); -+ /* info will be deleted from *2info Hash table at _watch_im_status_cb when the process is really died. */ - g_hash_table_remove(priv->pid2id, GINT_TO_POINTER (info->pid)); - if (kill(-info->pid, SIGTERM) == -1) { - gchar *module = g_strdup(identity); -@@ -647,8 +683,15 @@ - g_hash_table_insert(hash, module, tmp); - g_hash_table_insert(priv->pid2id, GINT_TO_POINTER (info->pid), GUINT_TO_POINTER (info->id)); - } else { -+ GTimeVal time; -+ gchar *s; -+ -+ g_get_current_time(&time); -+ s = g_time_val_to_iso8601(&time); -+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Sent a signal to stop %s: pid: %d, time: %s", identity, info->pid, s); - retval = TRUE; -- _process_info_unref(tmp); -+ g_free(s); -+ /* info will be unref'd in _watch_im_status_cb when the process is really died. */ - } - } - diff --git a/imsettings-unref-notify.patch b/imsettings-unref-notify.patch deleted file mode 100644 index f118416..0000000 --- a/imsettings-unref-notify.patch +++ /dev/null @@ -1,17 +0,0 @@ -2009-09-08 Akira TAGOH - - * src/factory.c (imsettings_manager_real_finalize): unreference the object. - -Index: src/factory.c -=================================================================== ---- src/factory.c (リビジョン 329) -+++ src/factory.c (リビジョン 330) -@@ -844,7 +844,7 @@ - if (priv->body2info) - g_hash_table_destroy(priv->body2info); - if (priv->notify) -- notify_notification_close(priv->notify, NULL); -+ g_object_unref(priv->notify); - - if (G_OBJECT_CLASS (imsettings_manager_parent_class)->finalize) - G_OBJECT_CLASS (imsettings_manager_parent_class)->finalize(object); diff --git a/imsettings-update-info.patch b/imsettings-update-info.patch deleted file mode 100644 index 7a70c0f..0000000 --- a/imsettings-update-info.patch +++ /dev/null @@ -1,223 +0,0 @@ -2009-09-15 Akira TAGOH - - * data/xinputinfo.sh.in: output the value if the configuration is - the script or not. - - * tests/main.c (init): set IMSETTINGS_HELPER_PATH to xinputinfo.sh - working without the real installation. - - * tests/rhbz_523349.c: new testcase. - - * imsettings/imsettings-info.c (imsettings_info_notify_properties): - Add a reference of the environment variable to get the unit testing - working. - (_IMSETTINGS_DEFUNC_PROPERTY): update the variables before looking - if the configuration is based on the script. (rhbz#523349) - (imsettings_info_is_script): new. - -Index: imsettings/imsettings-info.c -=================================================================== ---- imsettings/imsettings-info.c (リビジョン 342) -+++ imsettings/imsettings-info.c (リビジョン 343) -@@ -74,6 +74,7 @@ - gboolean is_system_default; - gboolean is_user_default; - gboolean is_xim; -+ gboolean is_script; - } IMSettingsInfoPrivate; - - enum { -@@ -94,6 +95,7 @@ - PROP_SHORT_DESC, - PROP_LONG_DESC, - PROP_ICON, -+ PROP_IS_SCRIPT, - PROP_IS_SYSTEM_DEFAULT, - PROP_IS_USER_DEFAULT, - PROP_IS_XIM, -@@ -181,6 +183,7 @@ - "SHORT_DESC=", - "LONG_DESC=", - "ICON=", -+ "IMSETTINGS_IS_SCRIPT=", - NULL - }; - static const gchar *properties[] = { -@@ -197,6 +200,7 @@ - "short_desc", - "long_desc", - "icon", -+ "is_script", - NULL - }; - gint i; -@@ -204,7 +208,7 @@ - guint prop; - struct stat st; - IMSettingsInfoPrivate *priv = IMSETTINGS_INFO_GET_PRIVATE (object); -- gchar *lang; -+ gchar *lang, *path; - - cmd = g_string_new(NULL); - str = g_string_new(NULL); -@@ -212,7 +216,13 @@ - lang = g_strdup_printf("LANG=%s ", priv->language); - else - lang = g_strdup(""); -- xinputinfo = g_build_filename(XINPUTINFO_PATH, "xinputinfo.sh", NULL); -+ if (g_getenv("IMSETTINGS_HELPER_PATH") != NULL) { -+ path = g_strdup(g_getenv("IMSETTINGS_HELPER_PATH")); -+ } else { -+ path = g_strdup(XINPUTINFO_PATH); -+ } -+ xinputinfo = g_build_filename(path, "xinputinfo.sh", NULL); -+ g_free(path); - g_string_append_printf(cmd, "%s. %s %s", lang, xinputinfo, filename); - - g_free(xinputinfo); -@@ -268,6 +278,14 @@ - properties[prop - (PROP_GTK_IMM - PROP_0)], str->str, - NULL); - break; -+ case PROP_IS_SCRIPT: -+ g_object_set(object, -+ "is_script", -+ (g_ascii_strcasecmp(str->str, "true") == 0 || -+ g_ascii_strcasecmp(str->str, "yes") == 0 || -+ g_ascii_strcasecmp(str->str, "1") == 0), -+ NULL); -+ break; - case PROP_IGNORE_FLAG: - g_object_set(object, - "ignore", -@@ -412,6 +430,9 @@ - } - } G_STMT_END; - break; -+ case PROP_IS_SCRIPT: -+ _set_bool_prop(is_script); -+ break; - case PROP_IS_SYSTEM_DEFAULT: - _set_bool_prop(is_system_default); - break; -@@ -489,6 +510,9 @@ - case PROP_ICON: - _get_str_prop(icon_file); - break; -+ case PROP_IS_SCRIPT: -+ _get_bool_prop(is_script); -+ break; - case PROP_IS_SYSTEM_DEFAULT: - _get_bool_prop(is_system_default); - break; -@@ -735,6 +759,12 @@ - _("Icon filename to be used on GUI"), - ICONDIR G_DIR_SEPARATOR_S "imsettings-unknown.png", - G_PARAM_READWRITE)); -+ g_object_class_install_property(object_class, PROP_IS_SCRIPT, -+ g_param_spec_boolean("is_script", -+ "Script", -+ "Whether or not the configuration is written in the shell script", -+ FALSE, -+ G_PARAM_READWRITE)); - g_object_class_install_property(object_class, PROP_IS_SYSTEM_DEFAULT, - g_param_spec_boolean("is_system_default", - _("System Default"), -@@ -807,6 +837,11 @@ - g_return_val_if_fail (IMSETTINGS_IS_INFO (info), (_v_)); \ - \ - priv = IMSETTINGS_INFO_GET_PRIVATE (info); \ -+ if (imsettings_info_is_script(info)) { \ -+ /* reload the configuration before referencing. */ \ -+ g_object_set(info, "filename", \ -+ priv->filename, NULL); \ -+ } \ - \ - return priv->_m_; \ - } -@@ -863,6 +898,18 @@ - } - - gboolean -+imsettings_info_is_script(IMSettingsInfo *info) -+{ -+ IMSettingsInfoPrivate *priv; -+ -+ g_return_val_if_fail (IMSETTINGS_IS_INFO (info), FALSE); -+ -+ priv = IMSETTINGS_INFO_GET_PRIVATE (info); -+ -+ return priv->is_script; -+} -+ -+gboolean - imsettings_info_is_system_default(IMSettingsInfo *info) - { - IMSettingsInfoPrivate *priv; -Index: imsettings/imsettings-info.h -=================================================================== ---- imsettings/imsettings-info.h (リビジョン 342) -+++ imsettings/imsettings-info.h (リビジョン 343) -@@ -66,6 +66,7 @@ - const gchar *imsettings_info_get_long_desc (IMSettingsInfo *info); - const gchar *imsettings_info_get_icon_file (IMSettingsInfo *info); - const gchar *imsettings_info_get_supported_language(IMSettingsInfo *info); -+gboolean imsettings_info_is_script (IMSettingsInfo *info); - gboolean imsettings_info_is_visible (IMSettingsInfo *info); - gboolean imsettings_info_is_system_default (IMSettingsInfo *info); - gboolean imsettings_info_is_user_default (IMSettingsInfo *info); -Index: data/xinputinfo.sh.in -=================================================================== ---- data/xinputinfo.sh.in (リビジョン 342) -+++ data/xinputinfo.sh.in (リビジョン 343) -@@ -20,6 +20,14 @@ - # Foundation, Inc., 59 Temple Place - Suite 330, - # Boston, MA 02111-1307, USA. - -+function is_script() { -+ if [ "x$(sed -re '/^[ ]?*[a-zA-Z0-9_]+=.*/{d};/[ ]?*#.*/{d}' $1)" = "x" ]; then -+ return 1 -+ else -+ return 0 -+ fi -+} -+ - USER_XINPUTRC="$HOME/.xinputrc" - SYS_XINPUTRC="@XINPUTRC_PATH@/xinputrc" - -@@ -42,13 +50,16 @@ - - if [ $# -gt 0 ]; then - source $1 -+ IMSETTINGS_FILENAME=$1 - else - [ -z "$IMSETTINGS_DISABLE_USER_XINPUTRC" ] && IMSETTINGS_DISABLE_USER_XINPUTRC=no - - if [ -r "$USER_XINPUTRC" -a "x$IMSETTINGS_DISABLE_USER_XINPUTRC" = "xno" ]; then - source "$USER_XINPUTRC" -+ IMSETTINGS_FILENAME=$USER_XINPUTRC - elif [ -r "$SYS_XINPUTRC" ]; then - source "$SYS_XINPUTRC" -+ IMSETTINGS_FILENAME=$SYS_XINPUTRC - fi - fi - -@@ -58,6 +69,12 @@ - # For backward compatibility - [ -z "$IMSETTINGS_IGNORE_ME" ] && IMSETTINGS_IGNORE_ME=$IM_CHOOSER_IGNORE_ME - -+if is_script $IMSETTINGS_FILENAME; then -+ IMSETTINGS_IS_SCRIPT=1 -+else -+ IMSETTINGS_IS_SCRIPT=0 -+fi -+ - cat < - 0.107.4-1 +- New upstream release. + - Update the translations. + - Remove the unnecessary patches: + - imsettings-unref-notify.patch + - imsettings-unref-later.patch + - imsettings-update-info.patch + - imsettings-close-fd.patch + * Thu Sep 17 2009 Akira TAGOH - 0.107.3-5 - Fix taking too much CPU issue. diff --git a/sources b/sources index c0068c3..e70dbc9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c6201e25cbd670d0784bd998e80b5684 imsettings-0.107.3.tar.bz2 +7be7991a26ffee3bc2dac48e0421ad3a imsettings-0.107.4.tar.bz2