[vlc-commits] commit: qt4: Get rid of towlower in favor of portability ( Juho Vähä-Herttua )

git at videolan.org git at videolan.org
Sun Nov 14 00:45:52 CET 2010


vlc/vlc-1.1 | branch: master | Juho Vähä-Herttua <juhovh at iki.fi> | Fri Nov 12 15:26:00 2010 +0200| [d627b7cc3eb0b716adaf656af72346f9a18af45f] | committer: Jean-Baptiste Kempf 

qt4: Get rid of towlower in favor of portability

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

(cherry picked from commit fb48e363450c0a56d1688a510528a246ae7c36a1)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=d627b7cc3eb0b716adaf656af72346f9a18af45f
---

 modules/gui/qt4/util/customwidgets.cpp |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp
index 5b460c3..eb0749f 100644
--- a/modules/gui/qt4/util/customwidgets.cpp
+++ b/modules/gui/qt4/util/customwidgets.cpp
@@ -391,12 +391,13 @@ int qtEventToVLCKey( QKeyEvent *e )
     uint32_t i_vlck = 0;
 
     if( qtk <= 0xff )
-        /* VLC and X11 use lowercase whereas Qt uses uppercase */
-#if defined( __STDC_ISO_10646__ ) || defined( _WIN32 )
-        i_vlck = towlower( qtk );
-#else
-# error FIXME
-#endif
+    {
+        /* VLC and X11 use lowercase whereas Qt uses uppercase, this
+         * method should be equal to towlower in case of latin1 */
+        if( qtk >= 'A' && qtk <= 'Z' ) i_vlck = qtk+32;
+        else if( qtk >= 0xC0 && qtk <= 0xDE && qtk != 0xD7) i_vlck = qtk+32;
+        else i_vlck = qtk;
+    }
     else
     {
         const vlc_qt_key_t *map;



More information about the vlc-commits mailing list