~michael-sheldon/ubuntu-keyboard/fix-1385518-rtm

« back to all changes in this revision

Viewing changes to plugins/pinyin/src/chineselanguagefeatures.cpp

  • Committer: CI bot
  • Author(s): Michael Sheldon
  • Date: 2014-09-10 14:57:01 UTC
  • mfrom: (215.3.9 fix-1359404)
  • Revision ID: ps-jenkins@lists.canonical.com-20140910145701-j2o8iqkw4qtf4viw
Only switch back automatically from the symbol page if the user presses space or apostrophe and make pre-edit behaviour when entering symbols more consistent. Fixes: 1359404

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    }
68
68
 
69
69
    return false;
70
 
}
 
 
b'\\ No newline at end of file'
 
70
}
 
71
 
 
72
bool ChineseLanguageFeatures::isSymbol(const QString &text) const
 
73
{
 
74
    static const QString symbols = QString::fromUtf8("*#+=()@~/\\€£$¥₹%<>[]`^|_§{}¡¿«»\"“”„&0123456789");
 
75
 
 
76
    if (text.isEmpty()) {
 
77
        return false;
 
78
    }
 
79
 
 
80
    if (symbols.contains(text.right(1))) {
 
81
        return true;
 
82
    }
 
83
 
 
84
    return false;
 
85
}