src/hbinput/inputwidgets/hbinputcommondialogs.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
--- a/src/hbinput/inputwidgets/hbinputcommondialogs.cpp	Mon Apr 19 14:02:13 2010 +0300
+++ b/src/hbinput/inputwidgets/hbinputcommondialogs.cpp	Mon May 03 12:48:33 2010 +0300
@@ -23,6 +23,8 @@
 **
 ****************************************************************************/
 #include <QDir>
+#include <QtAlgorithms>
+
 #include <hbinputdef.h>
 #include <hblistdialog.h>
 #include <hblistwidgetitem.h>
@@ -32,6 +34,18 @@
 
 #include "hbinputcommondialogs.h"
 
+/// @cond
+
+bool caseInsensitiveLessThanForHbInputLanguage(const HbInputLanguage &s1, const HbInputLanguage &s2)
+{
+    //Temporaries because localisedName() is a non-const function
+    HbInputLanguage t1 = s1;
+    HbInputLanguage t2 = s2;
+    return t1.localisedName().toLower() < t2.localisedName().toLower();
+}
+
+/// @endcond
+
 /*!
 Displays language selection dialog and returns selected language.
 */
@@ -54,7 +68,8 @@
     } else {
         languages=languageList;
     }
-
+	
+	qStableSort(languages.begin(), languages.end(), caseInsensitiveLessThanForHbInputLanguage);
     QList<HbListWidgetItem*> listItems;
     HbListWidgetItem* item = 0;
     foreach( HbInputLanguage language, languages ) {