Merge lp:~mterry/ubuntu-keyboard/emdash into lp:ubuntu-keyboard

Proposed by Michael Terry
Status: Merged
Approved by: Michael Sheldon
Approved revision: 293
Merged at revision: 309
Proposed branch: lp:~mterry/ubuntu-keyboard/emdash
Merge into: lp:ubuntu-keyboard
Diff against target: 38 lines (+3/-3)
3 files modified
plugins/pinyin/src/chineselanguagefeatures.cpp (+1/-1)
plugins/westernsupport/westernlanguagefeatures.cpp (+1/-1)
qml/languages/Keyboard_symbols.qml (+1/-1)
To merge this branch: bzr merge lp:~mterry/ubuntu-keyboard/emdash
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+247645@code.launchpad.net

Commit message

Add em dash, en dash, and the bullet as extended hyphen options.

Description of the change

Add em dash, en dash, and the bullet as extended hyphen options.

I chose to make the em dash the primary character, since I think that's the most commonly desired of the three (I have no data for that, but the en dash is a bit close to hyphen to make it the go-to extended character).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good, however these characters should also be added to the isSymbol() function in plugins/westernsupport/westernlanguagefeatures.cpp and plugins/pinyin/src/chineselanguagefeatures.cpp so that they get treated correctly by the auto-complete/auto-correct word engine. Once that's done this should be good to go :).

review: Needs Fixing
lp:~mterry/ubuntu-keyboard/emdash updated
293. By Michael Terry

Add the new symbols to isSymbol()

Revision history for this message
Michael Terry (mterry) wrote :

Done! Thanks, didn't know about that.

Revision history for this message
Michael Terry (mterry) wrote :

(Mightn't you just check the QChar's category() to see if it's a letter?)

Revision history for this message
Michael Terry (mterry) wrote :

Or heck, even call isLetter()

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

This implementation actually pre-dates me working on the keyboard, so I'm not certain of the original rationale; my guess would be that this was done to avoid potential issues with Chinese (and other non-latin based) input, but I'm not certain so I'll have a play and see if this can be cleaned up a bit when I've got some time.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Well, we can land this in the meantime, I assume.

/me is itching to make whales with bullet and underline characters

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Yep, all looking good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/pinyin/src/chineselanguagefeatures.cpp'
2--- plugins/pinyin/src/chineselanguagefeatures.cpp 2014-12-08 14:26:19 +0000
3+++ plugins/pinyin/src/chineselanguagefeatures.cpp 2015-01-28 13:56:34 +0000
4@@ -71,7 +71,7 @@
5
6 bool ChineseLanguageFeatures::isSymbol(const QString &text) const
7 {
8- static const QString symbols = QString::fromUtf8("*#+=()@~/\\€£$¥₹%<>[]`^|_§{}¡¿«»\"“”„&0123456789");
9+ static const QString symbols = QString::fromUtf8("*#+=()@~/\\€£$¥₹%<>[]`^|_—–•§{}¡¿«»\"“”„&0123456789");
10
11 if (text.isEmpty()) {
12 return false;
13
14=== modified file 'plugins/westernsupport/westernlanguagefeatures.cpp'
15--- plugins/westernsupport/westernlanguagefeatures.cpp 2014-12-09 20:42:49 +0000
16+++ plugins/westernsupport/westernlanguagefeatures.cpp 2015-01-28 13:56:34 +0000
17@@ -92,7 +92,7 @@
18
19 bool WesternLanguageFeatures::isSymbol(const QString &text) const
20 {
21- static const QString symbols = QString::fromUtf8("*#+=()@~/\\€£$¥₹%<>[]`^|_§{}¡¿«»\"“”„&0123456789");
22+ static const QString symbols = QString::fromUtf8("*#+=()@~/\\€£$¥₹%<>[]`^|_—–•§{}¡¿«»\"“”„&0123456789");
23
24 if (text.isEmpty()) {
25 return false;
26
27=== modified file 'qml/languages/Keyboard_symbols.qml'
28--- qml/languages/Keyboard_symbols.qml 2014-09-26 15:51:34 +0000
29+++ qml/languages/Keyboard_symbols.qml 2015-01-28 13:56:34 +0000
30@@ -55,7 +55,7 @@
31 CharKey { label: "*"; shifted: "`"; leftSide: true; }
32 CharKey { label: "#"; shifted: "^"; }
33 CharKey { label: "+"; shifted: "|"; }
34- CharKey { label: "-"; shifted: "_"; }
35+ CharKey { label: "-"; shifted: "_"; extended: ["—", "–", "•"]; }
36 CharKey { label: "="; shifted: "§"; }
37 CharKey { label: "("; shifted: "{"; }
38 CharKey { label: ")"; shifted: "}"; }

Subscribers

People subscribed via source and target branches