Hello community, here is the log from the commit of package fcitx-cloudpinyin for openSUSE:Factory checked in at 2012-07-22 21:59:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx-cloudpinyin (Old) and /work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx-cloudpinyin", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx-cloudpinyin/fcitx-cloudpinyin.changes 2012-06-05 15:30:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new/fcitx-cloudpinyin.changes 2012-07-22 21:59:09.000000000 +0200 @@ -1,0 +2,6 @@ +Sat Jul 21 21:32:17 UTC 2012 - i...@marguerite.su + +- update version 0.2.3 + * change the policy for when there is duplication result, now most word position will not changed. + +------------------------------------------------------------------- Old: ---- fcitx-cloudpinyin-0.2.2.tar.bz2 New: ---- fcitx-cloudpinyin-0.2.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx-cloudpinyin.spec ++++++ --- /var/tmp/diff_new_pack.jIFyQN/_old 2012-07-22 21:59:11.000000000 +0200 +++ /var/tmp/diff_new_pack.jIFyQN/_new 2012-07-22 21:59:11.000000000 +0200 @@ -18,7 +18,7 @@ Name: fcitx-cloudpinyin -Version: 0.2.2 +Version: 0.2.3 Release: 0 Summary: Cloudpinyin module for fcitx Group: System/I18n/Chinese ++++++ fcitx-cloudpinyin-0.2.2.tar.bz2 -> fcitx-cloudpinyin-0.2.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.2.2/CMakeLists.txt new/fcitx-cloudpinyin-0.2.3/CMakeLists.txt --- old/fcitx-cloudpinyin-0.2.2/CMakeLists.txt 2012-06-02 11:30:42.000000000 +0200 +++ new/fcitx-cloudpinyin-0.2.3/CMakeLists.txt 2012-07-12 14:52:15.000000000 +0200 @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) -find_package(Fcitx 4.2.0 REQUIRED) +find_package(Fcitx 4.2.5 REQUIRED) find_package(PkgConfig REQUIRED) find_package(Gettext REQUIRED) find_package(Libintl REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.2.2/src/cloudpinyin.c new/fcitx-cloudpinyin-0.2.3/src/cloudpinyin.c --- old/fcitx-cloudpinyin-0.2.2/src/cloudpinyin.c 2012-06-02 11:30:42.000000000 +0200 +++ new/fcitx-cloudpinyin-0.2.3/src/cloudpinyin.c 2012-07-12 14:52:15.000000000 +0200 @@ -39,6 +39,7 @@ #include "fetch.h" #define CHECK_VALID_IM (im && \ + strcmp(im->langCode, "zh_CN") == 0 && \ (strcmp(im->uniqueName, "pinyin") == 0 || \ strcmp(im->uniqueName, "pinyin-libpinyin") == 0 || \ strcmp(im->uniqueName, "shuangpin-libpinyin") == 0 || \ @@ -546,19 +547,27 @@ { CloudPinyinCache* cacheEntry = CloudPinyinCacheLookup(cloudpinyin, pinyin); FcitxInputState* input = FcitxInstanceGetInputState(cloudpinyin->owner); - struct _FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input); + FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input); + + int order = cloudpinyin->config.iCandidateOrder - 1; + if (order < 0) + order = 0; if (cacheEntry) { FcitxCandidateWord* cand; /* only check the first three page */ - int size = FcitxCandidateWordGetPageSize(candList) * CLOUDPINYIN_CHECK_PAGE_NUMBER; + int pagesize = FcitxCandidateWordGetPageSize(candList); + int size = pagesize * CLOUDPINYIN_CHECK_PAGE_NUMBER; int i = 0; - for (cand = FcitxCandidateWordGetFirst(FcitxInputStateGetCandidateList(input)); + for (cand = FcitxCandidateWordGetFirst(candList); cand != NULL; - cand = FcitxCandidateWordGetNext(FcitxInputStateGetCandidateList(input), cand)) + cand = FcitxCandidateWordGetNext(candList, cand)) { - if (strcmp(cand->strWord, cacheEntry->str) == 0) + if (strcmp(cand->strWord, cacheEntry->str) == 0) { + if (i > order && i >= pagesize) + FcitxCandidateWordMoveByWord(candList, cand, order); return; + } i ++; if (i >= size) break; @@ -589,10 +598,6 @@ candWord.extraType = MSG_TIPS; } - int order = cloudpinyin->config.iCandidateOrder - 1; - if (order < 0) - order = 0; - FcitxCandidateWordInsert(candList, &candWord, order); } @@ -603,6 +608,7 @@ struct _FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input); if (cacheEntry) { + int cloudidx = 0; FcitxCandidateWord* candWord; for (candWord = FcitxCandidateWordGetFirst(candList); candWord != NULL; @@ -610,6 +616,7 @@ { if (candWord->owner == cloudpinyin) break; + cloudidx ++; } if (candWord == NULL) @@ -621,13 +628,29 @@ FcitxCandidateWord* cand; int i = 0; - int size = FcitxCandidateWordGetPageSize(candList) * CLOUDPINYIN_CHECK_PAGE_NUMBER; + int pagesize = FcitxCandidateWordGetPageSize(candList); + int size = pagesize * CLOUDPINYIN_CHECK_PAGE_NUMBER; for (cand = FcitxCandidateWordGetFirst(candList); cand != NULL; cand = FcitxCandidateWordGetNext(candList, cand)) { if (strcmp(cand->strWord, cacheEntry->str) == 0) { FcitxCandidateWordRemove(candList, candWord); + /* if cloud word is not on the first page.. impossible */ + if (cloudidx < pagesize) { + /* if the duplication before cloud word */ + if (i < cloudidx) { + FcitxCandidateWordInsertPlaceHolder(candList, cloudidx); + } + else { + if (i >= pagesize) { + FcitxCandidateWordMove(candList, i - 1, cloudidx); + } + else { + FcitxCandidateWordInsertPlaceHolder(candList, cloudidx); + } + } + } FcitxUIUpdateInputWindow(cloudpinyin->owner); candWord = NULL; break; @@ -674,6 +697,11 @@ FcitxModuleInvokeFunctionByName(cloudpinyin->owner, "fcitx-sunpinyin", 1, args); else if (strcmp(im->uniqueName, "shuangpin") == 0 || strcmp(im->uniqueName, "pinyin") == 0) FcitxModuleInvokeFunctionByName(cloudpinyin->owner, "fcitx-pinyin", 7, args); + else if (strcmp(im->uniqueName, "pinyin-libpinyin") == 0 || + strcmp(im->uniqueName, "shuangpin-libpinyin") == 0) + { + FcitxModuleInvokeFunctionByName(cloudpinyin->owner, "fcitx-libpinyin", 0, args); + } } } if (string) @@ -822,7 +850,7 @@ while (*s) { char* p; - int chr; + unsigned int chr; p = fcitx_utf8_get_char(s, &chr); if (p - s == 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.2.2/src/fcitx-cloudpinyin.desc new/fcitx-cloudpinyin-0.2.3/src/fcitx-cloudpinyin.desc --- old/fcitx-cloudpinyin-0.2.2/src/fcitx-cloudpinyin.desc 2012-06-02 11:30:42.000000000 +0200 +++ new/fcitx-cloudpinyin-0.2.3/src/fcitx-cloudpinyin.desc 2012-07-12 14:52:15.000000000 +0200 @@ -5,7 +5,7 @@ [CloudPinyin/MinimumPinyinLength] Type=Integer -DefaultValue=5 +DefaultValue=2 Description=Minimum Length of Pinyin To Trigger Cloud Pinyin [CloudPinyin/DontShowSource] -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org