summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-05-29 13:38:21 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-15 18:17:26 (GMT)
commit930d91394d166139a6ed46aaf82dcb9255013073 (patch)
tree13a3ea3b1e0fb76cf3a4f53a11a386a8321fcfb7 /tools/linguist
parenta585375406def7ab15d580928ede1eec30b382a4 (diff)
downloadQt-930d91394d166139a6ed46aaf82dcb9255013073.zip
Qt-930d91394d166139a6ed46aaf82dcb9255013073.tar.gz
Qt-930d91394d166139a6ed46aaf82dcb9255013073.tar.bz2
simplify ending()
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/linguist/mainwindow.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 99ef7a4..783587c 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -114,11 +114,10 @@ static bool hasFormPreview(const QString &fileName)
static Ending ending(QString str, QLocale::Language lang)
{
str = str.simplified();
- int ch = 0;
- if (!str.isEmpty())
- ch = str.right(1)[0].unicode();
+ if (str.isEmpty())
+ return End_None;
- switch (ch) {
+ switch (str.at(str.length() - 1).unicode()) {
case 0x002e: // full stop
if (str.endsWith(QLatin1String("...")))
return End_Ellipsis;