From: Peng Wu Date: Tue, 22 Jun 2010 07:41:46 +0000 (+0800) Subject: fixes return key. X-Git-Tag: 1.3.10~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=263e1ae756cb07e0c95417e78e478bfa21c05a30;p=platform%2Fupstream%2Fibus-libpinyin.git fixes return key. fixes lua script load path. --- diff --git a/src/ExtEditor.cc b/src/ExtEditor.cc index c015bc9..fd7dad3 100644 --- a/src/ExtEditor.cc +++ b/src/ExtEditor.cc @@ -53,13 +53,19 @@ ExtEditor::ExtEditor (PinyinProperties & props, Config & config) { m_lua_plugin = ibus_engine_plugin_new (); - loadLuaScript (PKGDATADIR "/base.lua"); + gchar * path = g_build_filename (g_get_user_config_dir (), + "ibus", "pinyin", "base.lua", NULL); + loadLuaScript ( ".." G_DIR_SEPARATOR_S "lua" G_DIR_SEPARATOR_S "base.lua")|| + loadLuaScript (path) || + loadLuaScript (PKGDATADIR G_DIR_SEPARATOR_S "base.lua"); + + g_free(path); } int ExtEditor::loadLuaScript (std::string filename) { - return ibus_engine_plugin_load_lua_script (m_lua_plugin, filename.c_str ()); + return !ibus_engine_plugin_load_lua_script (m_lua_plugin, filename.c_str ()); } void @@ -278,15 +284,15 @@ ExtEditor::processSpace (guint keyval) gboolean ExtEditor::processEnter(guint keyval) { - if ( !(keyval == IBUS_KP_Enter ) ) + if ( !(keyval == IBUS_Return) ) return FALSE; - if ( m_text.length() == 0 ) + if ( m_text.length () == 0 ) return FALSE; Text text(m_text); - commitText(text); - reset(); + commitText (text); + reset (); return TRUE; }