From b8d081e942b738d0f1ffe574d1b05d09ab5f25ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=AA=E0=A5=8D=E0=A4=B0=E0=A4=B5=E0=A4=BF=E0=A4=A3=20?= =?UTF-8?q?=E0=A4=B8=E0=A4=BE=E0=A4=A4=E0=A4=AA=E0=A5=81=E0=A4=A4=E0=A5=87?= Date: Tue, 9 Feb 2010 10:15:27 +0530 Subject: [PATCH] updated with code enhancements from phuang --- ChangeLog | 6 ++++++ configure.ac | 6 +++--- ibus-sayura.spec.in | 9 ++++++--- src/engine.c | 10 ++++------ src/main.c | 42 ++++++++++++++++++++---------------------- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b13789..5babb6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,7 @@ + ibus-rawcode +Current Version :- 1.2.99 + +* Tue Feb 09 2010 Pravin Satpute - 1.2.99 +- updated patches for code enhancement by phuang +- new release with ibus diff --git a/configure.ac b/configure.ac index 7ed7050..2c0f9bd 100644 --- a/configure.ac +++ b/configure.ac @@ -21,8 +21,8 @@ # if not 1, append datestamp to the version number. m4_define([ibus_released], [0]) m4_define([ibus_major_version], [1]) -m4_define([ibus_minor_version], [0]) -m4_define([ibus_micro_version], [0]) +m4_define([ibus_minor_version], [2]) +m4_define([ibus_micro_version], [99]) m4_define(ibus_maybe_datestamp, m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi])) @@ -51,7 +51,7 @@ AM_PROG_LIBTOOL # check ibus PKG_CHECK_MODULES(IBUS, [ - ibus-1.0 + ibus-1.0 >= 1.2.99 ]) # check env diff --git a/ibus-sayura.spec.in b/ibus-sayura.spec.in index 1adcc2c..d957a8f 100644 --- a/ibus-sayura.spec.in +++ b/ibus-sayura.spec.in @@ -1,11 +1,11 @@ Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ -Release: 2%{?dist} +Release: 1%{?dist} Summary: The Sinhala engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries -URL: http://github.com/pravins/ibus-sayura/tree/master -Source0: http://pravins.fedorapeople.org/ibus-sayura/%{name}-%{version}.tar.gz +URL: https://fedorahosted.org/ibus-sayura +Source0: https://fedorahosted.org/releases/i/b/ibus-sayura/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -44,6 +44,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/ibus/component/* %changelog +* Tue Feb 09 2010 Pravin Satpute - @VERSION@-1 +- updated patches for code enhancements from phuang for ibus-1.2.99 + * Thu Mar 26 2009 Pravin Satpute - @VERSON@-2 - updated as per fedora spec review diff --git a/src/engine.c b/src/engine.c index 6186f20..4cc8fb7 100644 --- a/src/engine.c +++ b/src/engine.c @@ -202,8 +202,10 @@ ibus_sinhala_engine_init (IBusSinhalaEngine *sinhala) FALSE, 0, NULL); + g_object_ref_sink (sinhala->sinhala_mode_prop); sinhala->prop_list = ibus_prop_list_new (); + g_object_ref_sink (sinhala->prop_list); ibus_prop_list_append (sinhala->prop_list, sinhala->sinhala_mode_prop); sinhala->buffer = g_array_new (TRUE, TRUE, sizeof(gunichar *)); } @@ -236,8 +238,8 @@ ibus_sinhala_engine_destroy (IBusSinhalaEngine *sinhala) sinhala->sinhala_mode_prop = NULL; } - if (sinhala->buffer->len) { - g_object_unref (sinhala->buffer); + if (sinhala->buffer) { + g_array_free (sinhala->buffer, TRUE); sinhala->buffer = NULL; } @@ -259,12 +261,10 @@ ibus_sinhala_engine_update_preedit_text (IBusSinhalaEngine *sinhala) text, ibus_text_get_length (text), TRUE); - g_object_unref (text); } else{ text = ibus_text_new_from_static_string (""); ibus_engine_update_preedit_text ((IBusEngine *)sinhala, text, 0, FALSE); - g_object_unref (text); } } @@ -331,7 +331,6 @@ ibus_sinhala_engine_flush (IBusSinhalaEngine *sinhala) else{ text = ibus_text_new_from_static_string (""); ibus_engine_update_preedit_text ((IBusEngine *)sinhala, text, 0, FALSE); - g_object_unref (text); } ibus_engine_hide_preedit_text ((IBusEngine *) sinhala); @@ -545,7 +544,6 @@ static int ibus_sinhala_commit_preedit_to_ibus(IBusSinhalaEngine *sinhala) for(i=0; ibuffer->len; i++){ text = ibus_text_new_from_unichar(g_array_index(sinhala->buffer, gunichar,i)); ibus_engine_commit_text ((IBusEngine *)sinhala, text); - g_object_unref(text); } if(sinhala->buffer->len > 0){ g_array_remove_range(sinhala->buffer, 0, sinhala->buffer->len); diff --git a/src/main.c b/src/main.c index ac7026b..b901ff0 100644 --- a/src/main.c +++ b/src/main.c @@ -34,32 +34,14 @@ ibus_disconnected_cb (IBusBus *bus, static void start_component (void) { - IBusComponent *component; - ibus_init (); bus = ibus_bus_new (); + g_object_ref_sink (bus); g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL); - component = ibus_component_new ("org.freedesktop.IBus.Sinhala", - N_("Sinhala input method"), - "0.1.0", - "GPL", - "Pravin Satpute ", - "http://code.google.com/p/ibus/", - "", - "ibus-sayura"); - ibus_component_add_engine (component, - ibus_engine_desc_new ("sayura", - N_("Sinhala Input Method"), - N_("Sinhala Input Method"), - "si", - "GPL", - "Pravin Satpute ", - PKGDATADIR"/icon/ibus-sayura.png", - "us")); - factory = ibus_factory_new (ibus_bus_get_connection (bus)); + g_object_ref_sink (factory); ibus_factory_add_engine (factory, "sayura", IBUS_TYPE_SINHALA_ENGINE); @@ -67,11 +49,27 @@ start_component (void) ibus_bus_request_name (bus, "org.freedesktop.IBus.Sinhala", 0); } else { + IBusComponent *component; + component = ibus_component_new ("org.freedesktop.IBus.Sinhala", + N_("Sinhala input method"), + "0.1.0", + "GPL", + "Pravin Satpute ", + "https://fedorahosted.org/ibus-sayura/", + "", + "ibus-sayura"); + ibus_component_add_engine (component, + ibus_engine_desc_new ("sayura", + N_("Sinhala Input Method"), + N_("Sinhala Input Method"), + "si", + "GPL", + "Pravin Satpute ", + PKGDATADIR"/icon/ibus-sayura.png", + "us")); ibus_bus_register_component (bus, component); } - g_object_unref (component); - ibus_main (); }