Merge lp:~xnox/ubuntu-keyboard/libpinyin4 into lp:ubuntu-keyboard

Proposed by Dimitri John Ledkov
Status: Superseded
Proposed branch: lp:~xnox/ubuntu-keyboard/libpinyin4
Merge into: lp:ubuntu-keyboard
Diff against target: 79 lines (+22/-9)
3 files modified
debian/changelog (+6/-0)
debian/control (+1/-1)
src/lib/logic/pinyinadapter.cpp (+15/-8)
To merge this branch: bzr merge lp:~xnox/ubuntu-keyboard/libpinyin4
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+193775@code.launchpad.net

This proposal has been superseded by a proposal from 2013-11-04.

Commit message

Port to libpinyin4-dev API. (LP: #1247840)

Description of the change

Port to libpinyin4-dev API. (LP: #1247840)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~xnox/ubuntu-keyboard/libpinyin4 updated
98. By Dimitri John Ledkov

Port to libpinyin4-dev API. (LP: #1247840)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~xnox/ubuntu-keyboard/libpinyin4 updated
99. By Dimitri John Ledkov

merge trunk

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

99 trunk merges borked lp:ubuntu-keyboard

- depends on gdb, yet gdb build-dep is not declared
- depends on running dbus, which is not available in sbuild/chroot.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Also reported https://bugs.launchpad.net/ubuntu-ci-services-itself/+bug/1247992 the upstream merger is build this package with trusty-proposed enabled.

lp:~xnox/ubuntu-keyboard/libpinyin4 updated
100. By Dimitri John Ledkov

Merge trunk

101. By Dimitri John Ledkov

Merge from trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-10-25 11:04:48 +0000
3+++ debian/changelog 2013-11-04 23:21:25 +0000
4@@ -1,3 +1,9 @@
5+ubuntu-keyboard (0.99.trunk.phablet2+14.04.20131025-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * Port to libpinyin4-dev API. (LP: #1247840)
8+
9+ -- Dmitrijs Ledkovs <xnox@ubuntu.com> Mon, 04 Nov 2013 23:14:10 +0000
10+
11 ubuntu-keyboard (0.99.trunk.phablet2+14.04.20131025-0ubuntu1) trusty; urgency=low
12
13 [ Daniel d'Andrada ]
14
15=== modified file 'debian/control'
16--- debian/control 2013-11-04 17:48:55 +0000
17+++ debian/control 2013-11-04 23:21:25 +0000
18@@ -10,7 +10,7 @@
19 libglib2.0-dev,
20 libgsettings-qt-dev,
21 libhunspell-dev,
22- libpinyin2-dev,
23+ libpinyin4-dev,
24 libplatform-api1-dev,
25 libpresage-dev,
26 libxml2-utils,
27
28=== modified file 'src/lib/logic/pinyinadapter.cpp'
29--- src/lib/logic/pinyinadapter.cpp 2013-08-19 20:44:22 +0000
30+++ src/lib/logic/pinyinadapter.cpp 2013-11-04 23:21:25 +0000
31@@ -57,8 +57,8 @@
32 std::cout << std::endl;
33 #endif
34
35- m_array = g_array_new(FALSE, FALSE, sizeof(lookup_candidate_t));
36- pinyin_get_candidates(m_instance, 0, m_array);
37+
38+ pinyin_guess_candidates(m_instance, 0);
39
40 pinyin_guess_sentence(m_instance);
41
42@@ -66,16 +66,20 @@
43 pinyin_get_sentence(m_instance, &sentence);
44
45 candidates.clear();
46- for (unsigned int i = 0 ; i < m_array->len; i ++ )
47+ guint len = 0;
48+ pinyin_get_n_candidate(m_instance, &len);
49+ for (unsigned int i = 0 ; i < len; i ++ )
50 {
51- lookup_candidate_t token = g_array_index(m_array, lookup_candidate_t, i);
52- char* word = NULL;
53+ lookup_candidate_t * candidate = NULL;
54+ pinyin_get_candidate(m_instance, i, &candidate);
55+
56+ const char* word = NULL;
57+ pinyin_get_candidate_string(m_instance, candidate, &word);
58+
59 // Translate the token to utf-8 phrase.
60- pinyin_translate_token(m_instance, token.m_token, &word);
61 if (word) {
62 candidates.append(QString(word));
63 }
64- g_free(word);
65 }
66
67 QString unicode(sentence);
68@@ -91,7 +95,10 @@
69 void PinyinAdapter::wordCandidateSelected(const QString& word)
70 {
71 Q_UNUSED(word)
72- pinyin_choose_candidate(m_instance, 0, &g_array_index(m_array, lookup_candidate_t, 1));
73+
74+ lookup_candidate_t * candidate = NULL;
75+ pinyin_get_candidate(m_instance, 1, &candidate);
76+ pinyin_choose_candidate(m_instance, 0, candidate);
77 }
78
79 void PinyinAdapter::reset()

Subscribers

People subscribed via source and target branches