Hello community,

here is the log from the commit of package fcitx-cloudpinyin for 
openSUSE:Factory checked in at 2020-05-29 21:23:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcitx-cloudpinyin (Old)
 and      /work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fcitx-cloudpinyin"

Fri May 29 21:23:08 2020 rev:16 rq:809912 version:0.3.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/fcitx-cloudpinyin/fcitx-cloudpinyin.changes      
2017-12-19 10:51:03.910848716 +0100
+++ 
/work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new.3606/fcitx-cloudpinyin.changes
    2020-05-29 21:37:26.470661321 +0200
@@ -1,0 +2,7 @@
+Wed May 27 06:39:04 UTC 2020 - linhy <[email protected]>
+
+- update version 0.3.7
+  * upstream API changed
+  * translation update
+
+-------------------------------------------------------------------

Old:
----
  fcitx-cloudpinyin-0.3.6.tar.xz

New:
----
  fcitx-cloudpinyin-0.3.7.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fcitx-cloudpinyin.spec ++++++
--- /var/tmp/diff_new_pack.oZw62Q/_old  2020-05-29 21:37:26.918662655 +0200
+++ /var/tmp/diff_new_pack.oZw62Q/_new  2020-05-29 21:37:26.918662655 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package fcitx-cloudpinyin
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,17 +12,17 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           fcitx-cloudpinyin
-Version:        0.3.6
+Version:        0.3.7
 Release:        0
 Summary:        Cloudpinyin module for fcitx
-License:        GPL-2.0+
+License:        GPL-2.0-or-later
 Group:          System/I18n/Chinese 
-Url:            https://github.com/fcitx/fcitx-cloudpinyin
+URL:            https://github.com/fcitx/fcitx-cloudpinyin
 BuildRequires:  cmake
 BuildRequires:  fcitx-devel
 BuildRequires:  gcc-c++

++++++ fcitx-cloudpinyin-0.3.6.tar.xz -> fcitx-cloudpinyin-0.3.7.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/po/ca.po 
new/fcitx-cloudpinyin-0.3.7/po/ca.po
--- old/fcitx-cloudpinyin-0.3.6/po/ca.po        2017-11-28 00:58:12.000000000 
+0100
+++ new/fcitx-cloudpinyin-0.3.7/po/ca.po        2019-11-07 21:23:08.000000000 
+0100
@@ -3,14 +3,15 @@
 # This file is distributed under the same license as the PACKAGE package.
 #
 # Translators:
+# Robert Antoni Buj Gelonch <[email protected]>, 2017-2018
 # Walter Garcia-Fontes <[email protected]>, 2016
 msgid ""
 msgstr ""
 "Project-Id-Version: fcitx\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2017-09-14 16:02-0700\n"
-"PO-Revision-Date: 2017-08-03 16:57+0000\n"
-"Last-Translator: Walter Garcia-Fontes <[email protected]>\n"
+"POT-Creation-Date: 2019-11-03 12:27-0800\n"
+"PO-Revision-Date: 2018-06-13 07:07+0000\n"
+"Last-Translator: Robert Antoni Buj Gelonch <[email protected]>\n"
 "Language-Team: Catalan (http://www.transifex.com/fcitx/fcitx/language/ca/)\n"
 "Language: ca\n"
 "MIME-Version: 1.0\n"
@@ -18,57 +19,58 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: src/cloudpinyin.c:684
+#: src/cloudpinyin.c:685
 msgid " (via cloud)"
 msgstr "(via el núvol)"
 
 #: src/fcitx-cloudpinyin.conf.in:4
 msgid "Add Cloud Pinyin Support to Pinyin Input Method"
-msgstr "Afegeix suport de pinyin de núvol al mètode d'entrada pinying"
+msgstr ""
+"Afegeix la compatibilitat amb pinyin al núvol al mètode d'entrada pinying"
 
 #: src/fcitx-cloudpinyin.desc:24
 msgid "Baidu"
 msgstr "Baidu"
 
-#: src/cloudpinyin.c:619 src/fcitx-cloudpinyin.conf.in:3
+#: src/cloudpinyin.c:620 src/fcitx-cloudpinyin.conf.in:3
 msgid "Cloud Pinyin"
-msgstr "Pinyin de núvol"
+msgstr "Pinyin al núvol"
 
 #: src/fcitx-cloudpinyin.desc:5
 msgid "Cloud Pinyin Candidate Word Order"
-msgstr "Ordre de paraules candidates del pinyin de núvol"
+msgstr "Ordre de les paraules candidates del pinyin al núvol"
 
 #: src/fcitx-cloudpinyin.desc:21
 msgid "Cloud Pinyin Source"
-msgstr "Font de pinyin de núvol"
+msgstr "Origen de pinyin al núvol"
 
-#: src/cloudpinyin.c:621
+#: src/cloudpinyin.c:622
 msgid "Cloud Pinyin is Disabled."
-msgstr "El pinyin de núvol està desactivat"
+msgstr "El pinyin al núvol està inhabilitat"
 
-#: src/cloudpinyin.c:620
+#: src/cloudpinyin.c:621
 msgid "Cloud Pinyin is Enabled."
-msgstr "El pinyin de núvol està activat."
+msgstr "El pinyin al núvol està habilitat."
 
 #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7
 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18
 #: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32
 msgid "CloudPinyin"
-msgstr "PinyinNúvol"
+msgstr "Pinyin al núvol"
 
 #: src/fcitx-cloudpinyin.desc:30
 msgid "Disable Cloud Pinyin When you are using mobile can save your network"
 msgstr ""
-"Desactivar el pinyin de núvol quan esteu usant dades mòbil pot estalviar la "
+"Inhabilitar pinyin al núvol quan esteu utilitzant el mòbil pot estalviar la "
 "vostra xarxa"
 
 #: src/fcitx-cloudpinyin.desc:16
 msgid "Don't Show the 'via cloud' hint"
-msgstr "No mostris la pista «via núvol»"
+msgstr "No mostris els suggerents «via núvol»"
 
 #: src/fcitx-cloudpinyin.desc:35
 msgid "Enabled"
-msgstr "Activat"
+msgstr "Habilitat"
 
 #: src/fcitx-cloudpinyin.desc:23
 msgid "Google"
@@ -76,8 +78,8 @@
 
 #: src/fcitx-cloudpinyin.desc:11
 msgid "Minimum Length of Pinyin To Trigger Cloud Pinyin"
-msgstr "Longitud mínima de pinyin per activar pinyin de núvol"
+msgstr "Longitud mínima de pinyin per activar pinyin al núvol"
 
 #: src/fcitx-cloudpinyin.desc:29
 msgid "Toggle Cloud Pinyin enabled status"
-msgstr "Commuta l'estat d'activació del pinyin de núvol"
+msgstr "Commuta l'estat d'activació del pinyin al núvol"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/po/ru.po 
new/fcitx-cloudpinyin-0.3.7/po/ru.po
--- old/fcitx-cloudpinyin-0.3.6/po/ru.po        2017-11-28 00:58:12.000000000 
+0100
+++ new/fcitx-cloudpinyin-0.3.7/po/ru.po        2019-11-07 21:23:08.000000000 
+0100
@@ -3,13 +3,13 @@
 # This file is distributed under the same license as the PACKAGE package.
 #
 # Translators:
-# TotalCaesar659 <[email protected]>, 2016
+# TotalCaesar659 <[email protected]>, 2016-2017
 msgid ""
 msgstr ""
 "Project-Id-Version: fcitx\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2017-09-14 16:02-0700\n"
-"PO-Revision-Date: 2017-08-03 16:57+0000\n"
+"POT-Creation-Date: 2017-11-28 00:03-0800\n"
+"PO-Revision-Date: 2017-11-27 15:15+0000\n"
 "Last-Translator: TotalCaesar659 <[email protected]>\n"
 "Language-Team: Russian (http://www.transifex.com/fcitx/fcitx/language/ru/)\n"
 "Language: ru\n"
@@ -20,37 +20,37 @@
 "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
 "%100>=11 && n%100<=14)? 2 : 3);\n"
 
-#: src/cloudpinyin.c:684
+#: src/cloudpinyin.c:685
 msgid " (via cloud)"
 msgstr "(через облако)"
 
 #: src/fcitx-cloudpinyin.conf.in:4
 msgid "Add Cloud Pinyin Support to Pinyin Input Method"
-msgstr "Добавить поддержку облака пиньинь для метода ввода пиньинь"
+msgstr "Добавить поддержку Cloud Pinyin для метода ввода пиньинь"
 
 #: src/fcitx-cloudpinyin.desc:24
 msgid "Baidu"
 msgstr "Baidu"
 
-#: src/cloudpinyin.c:619 src/fcitx-cloudpinyin.conf.in:3
+#: src/cloudpinyin.c:620 src/fcitx-cloudpinyin.conf.in:3
 msgid "Cloud Pinyin"
-msgstr "Облако пиньинь"
+msgstr "Cloud Pinyin"
 
 #: src/fcitx-cloudpinyin.desc:5
 msgid "Cloud Pinyin Candidate Word Order"
-msgstr "Порядок слов-кандидатов облака пиньинь"
+msgstr "Порядок слов-кандидатов Cloud Pinyin"
 
 #: src/fcitx-cloudpinyin.desc:21
 msgid "Cloud Pinyin Source"
 msgstr "Источник облака пиньинь"
 
-#: src/cloudpinyin.c:621
+#: src/cloudpinyin.c:622
 msgid "Cloud Pinyin is Disabled."
-msgstr "Облако пиньинь отключено."
+msgstr "Cloud Pinyin отключен."
 
-#: src/cloudpinyin.c:620
+#: src/cloudpinyin.c:621
 msgid "Cloud Pinyin is Enabled."
-msgstr "Облако пиньинь включено."
+msgstr "Cloud Pinyin включен."
 
 #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7
 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/src/cloudpinyin.c 
new/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c
--- old/fcitx-cloudpinyin-0.3.6/src/cloudpinyin.c       2017-11-28 
00:58:12.000000000 +0100
+++ new/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c       2019-11-07 
21:23:08.000000000 +0100
@@ -690,7 +690,7 @@
 }
 
 #define LOADING_TIME_QUICK_THRESHOLD 300
-#define DUP_PLACE_HOLDER "\xe2\x98\xba"
+#define DUP_PLACE_HOLDER "\xe2\x98\x81"
 
 void CloudPinyinFillCandidateWord(FcitxCloudPinyin* cloudpinyin,
                                   const char* pinyin)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/src/parse.c 
new/fcitx-cloudpinyin-0.3.7/src/parse.c
--- old/fcitx-cloudpinyin-0.3.6/src/parse.c     2017-11-28 00:58:12.000000000 
+0100
+++ new/fcitx-cloudpinyin-0.3.7/src/parse.c     2019-11-07 21:23:08.000000000 
+0100
@@ -8,135 +8,12 @@
 #include <ctype.h>
 #include "cloudpinyin.h"
 
-static inline boolean ishex(char ch)
-{
-    if ((ch >= '0' && ch <= '9') || (ch >='a' && ch <='f') || (ch >='A' && ch 
<='F'))
-        return true;
-    return false;
-}
-
-static inline unsigned char tohex(char ch)
-{
-    if (ch >= '0' && ch <= '9')
-        return ch - '0';
-    if (ch >='a' && ch <='f')
-        return ch - 'a' + 10;
-    if (ch >='A' && ch <='F')
-        return ch - 'A' + 10;
-    return 0;
-}
-
-void SogouParseKey(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
-{
-    char* str = fcitx_utils_trim(queue->str);
-    const char* ime_patch_key = "ime_patch_key = \"";
-    size_t len = strlen(str);
-    if (len == SOGOU_KEY_LENGTH + strlen(ime_patch_key) + 1
-        && strncmp(str, ime_patch_key, strlen(ime_patch_key)) == 0
-        && str[len - 1] == '\"') {
-        sscanf(str,"ime_patch_key = \"%s\"", cloudpinyin->key);
-        cloudpinyin->initialized = true;
-        cloudpinyin->key[SOGOU_KEY_LENGTH] = '\0';
-    }
-
-    free(str);
-}
-
-char* MapSogouStringToHalf(const char* string)
-{
-    const char* s = string;
-    const char* sn;
-    size_t len = strlen(string);
-    char* half = fcitx_utils_malloc0(sizeof(char) * (len + 1));
-    char* halfp = half;
-    int upperCount = 0;
-
-    while (*s) {
-        unsigned int chr = 0;
-
-        sn = fcitx_utf8_get_char(s, &chr);
-
-        /* from A to Z */
-        if ((chr >= 0xff21 && chr <= 0xff3a) || (chr >= 0xff41 && chr <= 
0xff5a)) {
-            *halfp = (char) (chr & 0xff) + 0x20;
-            if (isupper(*halfp))
-                upperCount ++;
-            halfp ++;
-        }
-        else {
-            while(s < sn) {
-                *halfp = *s;
-                if (isupper(*halfp))
-                    upperCount ++;
-                s++;
-                halfp++;
-            }
-        }
-
-        s = sn;
-    }
-    if (*half && isupper(*half) && upperCount == 1) {
-        *half = tolower(*half);
-    }
-    return half;
-}
-
-char* SogouParsePinyin(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
-{
-    char *start = NULL, *end = NULL;
-    if ((start = strchr(queue->str, '"')) != NULL && (end = strstr(queue->str, 
"%EF%BC%9A")) != NULL)
-    {
-        start ++;
-        if (start < end)
-        {
-            size_t length = end - start;
-            int conv_length;
-            char *unescapedstring = curl_easy_unescape(queue->curl, start, 
length, &conv_length);
-            char *realstring = MapSogouStringToHalf(unescapedstring);
-            curl_free(unescapedstring);
-            return realstring;
-        }
-    }
-    return NULL;
-}
-
-void QQParseKey(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
-{
-    char* str = fcitx_utils_trim(queue->str);
-    const char* ime_patch_key = "{\"key\":\"";
-    if (strncmp(str, ime_patch_key, strlen(ime_patch_key)) == 0)
-    {
-        if (sscanf(str,"{\"key\":\"%32s\",\"ret\":\"suc\"}", cloudpinyin->key) 
> 0)
-        {
-            cloudpinyin->initialized = true;
-            cloudpinyin->key[QQ_KEY_LENGTH] = '\0';
-        }
-    }
-
-    free(str);
-}
-
-char* QQParsePinyin(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
-{
-    char *start = NULL, *end = NULL;
-    if ((start = strstr(queue->str, "\"rs\":[\"")) != NULL)
-    {
-        start += strlen( "\"rs\":[\"");
-        if ((end = strstr(start, "\"")) != NULL)
-        {
-            size_t length = end - start;
-            char *realstring = fcitx_utils_malloc0(sizeof(char) * (length + 
1));
-            strncpy(realstring, start, length);
-            realstring[length] = '\0';
-            return realstring;
-        }
-    }
-    return NULL;
-}
-
 char* GoogleParsePinyin(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
 {
     char *start = NULL, *end = NULL;
+    if (!queue->str) {
+        return NULL;
+    }
     if ((start = strstr(queue->str, "\",[\"")) != NULL)
     {
         start += strlen( "\",[\"");
@@ -146,7 +23,12 @@
             char *realstring = fcitx_utils_malloc0(sizeof(char) * (length + 
1));
             strncpy(realstring, start, length);
             realstring[length] = '\0';
-            return realstring;
+            if (fcitx_utf8_check_string(realstring)) {
+                return realstring;
+            } else {
+                free(realstring);
+                return NULL;
+            }
         }
     }
     return NULL;
@@ -155,56 +37,21 @@
 char* BaiduParsePinyin(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue)
 {
     char *start = NULL, *end = NULL;
-    static iconv_t conv = 0;
-    if (conv == 0)
-        conv = iconv_open("utf-8", "utf-16be");
-
-    if (conv == (iconv_t)(-1))
+    if (!queue->str) {
         return NULL;
-    if ((start = strstr(queue->str, "[[[\"")) != NULL)
+    }
+    if ((start = strstr(queue->str, "[[\"")) != NULL)
     {
-        start += strlen( "[[[\"");
+        start += strlen( "[[\"");
         if ((end = strstr(start, "\",")) != NULL)
         {
             size_t length = end - start;
-            if (length % 6 != 0 || length == 0)
-                return NULL;
-
-            size_t i = 0, j = 0;
-            char* buf = fcitx_utils_malloc0((length / 6 + 1) * 2);
-            while (i < length)
-            {
-                if (start[i] == '\\' && start[i+1] == 'u')
-                {
-                    if (ishex(start[i+2]) && ishex(start[i+3]) && 
ishex(start[i+4]) && ishex(start[i+5]))
-                    {
-                        buf[j++] = (tohex(start[i+2]) << 4) | 
tohex(start[i+3]);
-                        buf[j++] = (tohex(start[i+4]) << 4) | 
tohex(start[i+5]);
-                    }
-                    else
-                        break;
-                }
-
-                i += 6;
-            }
-
-            if (i != length)
-            {
-                free(buf);
-                return NULL;
-            }
-            buf[j++] = 0;
-            buf[j++] = 0;
-            size_t len = UTF8_MAX_LENGTH * (length / 6) * sizeof(char);
-            char* realstring = fcitx_utils_malloc0(UTF8_MAX_LENGTH * (length / 
6) * sizeof(char));
-            IconvStr p = buf; char *pp = realstring;
-            iconv(conv, &p, &j, &pp, &len);
-
-            free(buf);
-            if (fcitx_utf8_check_string(realstring))
+            char *realstring = fcitx_utils_malloc0(sizeof(char) * (length + 
1));
+            strncpy(realstring, start, length);
+            realstring[length] = '\0';
+            if (fcitx_utf8_check_string(realstring)) {
                 return realstring;
-            else
-            {
+            } else {
                 free(realstring);
                 return NULL;
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/test/CMakeLists.txt 
new/fcitx-cloudpinyin-0.3.7/test/CMakeLists.txt
--- old/fcitx-cloudpinyin-0.3.6/test/CMakeLists.txt     2017-11-28 
00:58:12.000000000 +0100
+++ new/fcitx-cloudpinyin-0.3.7/test/CMakeLists.txt     2019-11-07 
21:23:08.000000000 +0100
@@ -1,27 +0,0 @@
-include_directories(
-    ${PROJECT_SOURCE_DIR}/src
-    ${PROJECT_BINARY_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CURL_INCLUDE_DIRS}
-    ${FCITX4_FCITX_INCLUDE_DIRS}
-    ${FCITX4_FCITX_CONFIG_INCLUDE_DIRS}
-    ${FCITX4_FCITX_UTILS_INCLUDE_DIRS}
-    ${LIBINTL_INCLUDE_DIR}
-    ${PTHREAD_INCLUDE_DIR}
-)
-
-link_directories(
-    ${CURL_LIBRARY_DIRS}
-    ${FCITX4_FCITX_UTILS_LIBRARY_DIRS}
-)
-
-add_executable(testhalf testhalf.c ../src/parse.c)
-
-target_link_libraries( testhalf
-                       ${PTHREAD_LIBRARIES}
-                       ${FCITX4_FCITX_UTILS_LIBRARIES}
-                       ${CURL_LIBRARIES}
-                       ${LIBINTL_LIBRARIES}
-                       )
-
-add_test(testhalf testhalf)
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.6/test/testhalf.c 
new/fcitx-cloudpinyin-0.3.7/test/testhalf.c
--- old/fcitx-cloudpinyin-0.3.6/test/testhalf.c 2017-11-28 00:58:12.000000000 
+0100
+++ new/fcitx-cloudpinyin-0.3.7/test/testhalf.c 1970-01-01 01:00:00.000000000 
+0100
@@ -1,19 +0,0 @@
-#include "parse.h"
-
-#include <assert.h>
-
-int main(int argc, char* argv[])
-{
-    char* result = MapSogouStringToHalf("ABCD");
-    printf("%s\n", result);
-    assert(strcmp(result, "ABCD") == 0);
-
-    free(result);
-
-    result = MapSogouStringToHalf("我a测b你CD的");
-    printf("%s\n", result);
-    assert(strcmp(result, "我a测b你CD的") == 0);
-
-    free(result);
-    return 0;
-}


Reply via email to