rpms/im-chooser/devel im-chooser-suffix-r40.patch, NONE, 1.1 im-chooser.spec, 1.5, 1.6 im-chooser-suffix-r37.patch, 1.1, NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Jul 24 13:54:44 UTC 2006
Author: tagoh
Update of /cvs/dist/rpms/im-chooser/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1739
Modified Files:
im-chooser.spec
Added Files:
im-chooser-suffix-r40.patch
Removed Files:
im-chooser-suffix-r37.patch
Log Message:
im-chooser-suffix-r40.patch:
ChangeLog | 13 +++++++++++++
configure.ac | 18 ++++++++++++++++++
src/Makefile.am | 1 +
src/im-chooser.c | 23 +++++++++++++++--------
src/xinput.c | 5 +++++
5 files changed, 52 insertions(+), 8 deletions(-)
--- NEW FILE im-chooser-suffix-r40.patch ---
Index: configure.ac
===================================================================
--- configure.ac (ãªãã¸ã§ã³ 37)
+++ configure.ac (ä½æ¥ã³ãã¼)
@@ -85,6 +85,10 @@
AC_HELP_STRING([--with-xinitdir], [build with the specific xinit directory])
,,
with_xinitdir=no)
+AC_ARG_WITH(xinput-suffix,
+ AC_HELP_STRING([--with-xinput-suffix], [specify the xinput file suffix])
+ ,,
+ with_xinput_suffix=no)
dnl ======================================================================
dnl options - xinputdir
@@ -113,6 +117,19 @@
AC_SUBST(XINIT_PATH)
dnl ======================================================================
+dnl options - xinitdir
+dnl ======================================================================
+AC_MSG_CHECKING(whether to build the specific xinput suffix)
+if test "x$with_xinput_suffix" = xno; then
+ with_xinput_suffix=""
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+fi
+XINPUT_SUFFIX=$with_xinput_suffix
+AC_SUBST(XINPUT_SUFFIX)
+
+dnl ======================================================================
dnl output
dnl ======================================================================
AC_CONFIG_FILES([
@@ -133,5 +150,6 @@
echo " LIBS: $IMCHOOSE_LIBS"
echo " XINPUT_PATH: $XINPUT_PATH"
echo " XINIT_PATH: $XINIT_PATH"
+echo " XINPUT_SUFFIX: $XINPUT_SUFFIX"
echo " GNOME support: $use_gnome"
echo ""
Index: ChangeLog
===================================================================
--- ChangeLog (ãªãã¸ã§ã³ 37)
+++ ChangeLog (ä½æ¥ã³ãã¼)
@@ -1,6 +1,19 @@
2006-07-24 Akira TAGOH <at at gclab.org>
+ * src/xinput.c (xinput_get_im_list): exactly lookup with the suffix.
+
+ * src/im-chooser.c (im_chooser_instance_init): put the xinput name
+ without the suffix.
+ (im_chooser_update_xinputrc): make a symlink with the suffix.
+
+ * src/xinput.c (xinput_get_im_list): lookup the xiput file with
+ the suffix.
+
+ * src/im-chooser.c (im_chooser_get_widget): fixed to make
+ a non-sensitive when no options available on custom.
+
* configure.ac: bumped to 0.3.0.
+ added --with-xinput-suffix option.
* src/im-chooser.c (im_chooser_get_widget): fixed a typo.
Index: src/im-chooser.c
===================================================================
--- src/im-chooser.c (ãªãã¸ã§ã³ 37)
+++ src/im-chooser.c (ä½æ¥ã³ãã¼)
@@ -227,10 +227,15 @@
xinput = xinput_data_new(l->data);
if (xinput != NULL) {
gchar *name = g_path_get_basename(l->data);
+ size_t suffixlen = strlen(XINPUT_SUFFIX), len;
if (name != NULL &&
GPOINTER_TO_UINT (xinput_data_get_value(xinput, XINPUT_VALUE_IGNORE_ME)) != TRUE) {
- g_hash_table_replace(im->im_table, name, xinput);
+ len = strlen(name);
+ if (len > suffixlen) {
+ name[len - suffixlen] = 0;
+ g_hash_table_replace(im->im_table, name, xinput);
+ }
}
}
}
@@ -265,10 +270,10 @@
*/
mode = IM_MODE_SYSTEM;
retval = TRUE;
- } else if (strcmp(name, IM_NONE_NAME) == 0) {
+ } else if (strcmp(name, IM_NONE_NAME XINPUT_SUFFIX) == 0) {
mode = IM_MODE_NEVER;
retval = TRUE;
- } else if (strcmp(name, IM_XIM_NAME) == 0) {
+ } else if (strcmp(name, IM_XIM_NAME XINPUT_SUFFIX) == 0) {
mode = IM_MODE_LEGACY;
retval = TRUE;
} else {
@@ -564,7 +569,7 @@
gtk_alignment_set_padding(GTK_ALIGNMENT (align2), 10, 0, 0, 0);
gtk_container_add(GTK_CONTAINER (align2), label3);
gtk_box_pack_start(GTK_BOX (vbox), align2, FALSE, FALSE, 0);
- if (DECODE_MODE (im->mode) == IM_MODE_CUSTOM)
+ if (DECODE_MODE (im->mode) == IM_MODE_CUSTOM && !no_custom)
gtk_widget_set_sensitive(im->option, TRUE);
im->widget = vbox;
@@ -592,7 +597,7 @@
IMChooserSubMode submode,
const gchar *xinputname)
{
- gchar *srcfile = NULL, *dstfile = NULL, *backupfile = NULL;
+ gchar *srcfile = NULL, *dstfile = NULL, *backupfile = NULL, *confname;
const gchar *home;
gboolean retval = FALSE;
struct stat st;
@@ -630,14 +635,14 @@
retval = TRUE;
break;
case IM_MODE_NEVER:
- srcfile = g_build_filename(XINPUT_PATH, IM_NONE_NAME, NULL);
+ srcfile = g_build_filename(XINPUT_PATH, IM_NONE_NAME XINPUT_SUFFIX, NULL);
if (symlink(srcfile, dstfile) == -1) {
g_warning("Failed to create a symlink %s from %s", dstfile, srcfile);
}
retval = TRUE;
break;
case IM_MODE_LEGACY:
- srcfile = g_build_filename(XINPUT_PATH, IM_XIM_NAME, NULL);
+ srcfile = g_build_filename(XINPUT_PATH, IM_XIM_NAME XINPUT_SUFFIX, NULL);
if (symlink(srcfile, dstfile) == -1) {
g_warning("Failed to create a symlink %s from %s", dstfile, srcfile);
}
@@ -654,7 +659,9 @@
g_warning("no xinputname given.");
break;
}
- srcfile = g_build_filename(XINPUT_PATH, xinputname, NULL);
+ confname = g_strdup_printf("%s%s", xinputname, XINPUT_SUFFIX);
+ srcfile = g_build_filename(XINPUT_PATH, confname, NULL);
+ g_free(confname);
if (symlink(srcfile, dstfile) == -1) {
g_warning("Failed to create a symlink %s from %s", dstfile, srcfile);
}
Index: src/xinput.c
===================================================================
--- src/xinput.c (ãªãã¸ã§ã³ 37)
+++ src/xinput.c (ä½æ¥ã³ãã¼)
@@ -82,6 +82,7 @@
const gchar *name;
gchar *filename;
struct stat st;
+ size_t len, suffixlen = strlen(XINPUT_SUFFIX);
if (path == NULL) {
path = XINPUT_PATH;
@@ -89,6 +90,10 @@
if ((dir = g_dir_open(path, 0, NULL)) == NULL)
return NULL;
while ((name = g_dir_read_name(dir)) != NULL) {
+ len = strlen(name);
+ if (len < suffixlen ||
+ strcmp(&name[len - suffixlen], XINPUT_SUFFIX) != 0)
+ continue;
filename = g_build_filename(path, name, NULL);
if (lstat(filename, &st) == 0) {
if (S_ISREG (st.st_mode) && !S_ISLNK (st.st_mode)) {
Index: src/Makefile.am
===================================================================
--- src/Makefile.am (ãªãã¸ã§ã³ 37)
+++ src/Makefile.am (ä½æ¥ã³ãã¼)
@@ -4,6 +4,7 @@
-DG_LOG_DOMAIN="\"IM-Chooser\"" \
-DXINIT_PATH="\"$(XINIT_PATH)\"" \
-DXINPUT_PATH="\"$(XINPUT_PATH)\"" \
+ -DXINPUT_SUFFIX="\"$(XINPUT_SUFFIX)\"" \
$(IMCHOOSE_CFLAGS) \
$(GNOME_CFLAGS) \
$(NULL)
Index: im-chooser.spec
===================================================================
RCS file: /cvs/dist/rpms/im-chooser/devel/im-chooser.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- im-chooser.spec 24 Jul 2006 13:20:50 -0000 1.5
+++ im-chooser.spec 24 Jul 2006 13:54:42 -0000 1.6
@@ -7,7 +7,7 @@
BuildRequires: gtk2-devel intltool gettext libgnomeui-devel automake autoconf
Source0: http://trac.tagoh.net/download/%{name}/%{name}-%{version}.tar.gz
-Patch0: im-chooser-suffix-r37.patch
+Patch0: im-chooser-suffix-r40.patch
Summary: Desktop Input Method configuration tool
Group: Applications/System
@@ -33,6 +33,9 @@
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
+# rename the xinput files with .conf suffix
+mv $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinput.d/none{,.conf}
+mv $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinput.d/xim{,.conf}
%find_lang %{name}
@@ -40,12 +43,12 @@
rm -rf $RPM_BUILD_ROOT
%post
-alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_sysconfdir}/X11/xinit/xinput.d/none 10
-alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_sysconfdir}/X11/xinit/xinput.d/xim 30
+alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_sysconfdir}/X11/xinit/xinput.d/none.conf 10
+alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_sysconfdir}/X11/xinit/xinput.d/xim.conf 30
%postun
-alternatives --remove xinputrc %{_sysconfdir}/X11/xinit/xinput.d/none
-alternatives --remove xinputrc %{_sysconfdir}/X11/xinit/xinput.d/xim
+alternatives --remove xinputrc %{_sysconfdir}/X11/xinit/xinput.d/none.conf
+alternatives --remove xinputrc %{_sysconfdir}/X11/xinit/xinput.d/xim.conf
%files -f %{name}.lang
%defattr (-, root, root)
@@ -58,7 +61,7 @@
* Mon Jul 24 2006 Akira TAGOH <tagoh at redhat.com> - 0.3.0-2
- New upstream release.
- add libgnomeui-devel to BR.
-- im-chooser-suffix-r37.patch: applied to support the recent change
+- im-chooser-suffix-r40.patch: applied to support the recent change
in the xinput files.
* Thu Jul 20 2006 Akira TAGOH <tagoh at redhat.com> - 0.2.2-2
--- im-chooser-suffix-r37.patch DELETED ---
More information about the fedora-cvs-commits
mailing list