[vlc-commits] [Git][videolan/vlc][master] 2 commits: gui/qt: do not use deprecated SystemLocaleLongDate

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Dec 9 09:48:40 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
dcb97734 by Marvin Scholz at 2021-12-09T09:20:37+00:00
gui/qt: do not use deprecated SystemLocaleLongDate

- - - - -
319c04be by Marvin Scholz at 2021-12-09T09:20:37+00:00
gui/qt: use proper locale time format

Do not hardcode hh:mm but instead use the locale time format,
just like for the date, to ensure the time is displayed
consistently.

- - - - -


1 changed file:

- modules/gui/qt/dialogs/epg/epg.cpp


Changes:

=====================================
modules/gui/qt/dialogs/epg/epg.cpp
=====================================
@@ -39,6 +39,7 @@
 #include <QDialogButtonBox>
 #include <QTimer>
 #include <QDateTime>
+#include <QLocale>
 
 #include "qt.hpp"
 #include "player/player_controller.hpp"
@@ -145,12 +146,13 @@ void EpgDialog::displayEvent( EPGItem *epgItem )
     QDateTime enddate = epgItem->start().addSecs( epgItem->duration() );
 
     QString start, end;
+    QLocale locale;
     if( epgItem->start().daysTo(now) != 0 )
-        start = epgItem->start().toString( Qt::SystemLocaleLongDate );
+        start = locale.toString(epgItem->start());
     else
-        start = epgItem->start().time().toString( "hh:mm" );
+        start = locale.toString(epgItem->start().time(), QLocale::ShortFormat);
 
-    end = enddate.time().toString( "hh:mm" );
+    end = locale.toString(enddate.time(), QLocale::ShortFormat);
 
     title->setText( QString("%1 - %2 : %3%4")
                    .arg( start )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2eb91f770f0cae3645796e333b47f98ac7690e63...319c04be0450d0efd5b6c602fddb2a65f70b1168

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2eb91f770f0cae3645796e333b47f98ac7690e63...319c04be0450d0efd5b6c602fddb2a65f70b1168
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list