diff options
| author | 2023-07-08 01:38:33 +0200 | |
|---|---|---|
| committer | 2023-07-08 01:38:33 +0200 | |
| commit | 28292170d8c02743cabfabba3a1623b8d71b9aa2 (patch) | |
| tree | 03c7269f527a40a5b86863db7c111f2552afe46c /src/modules/logview | |
| parent | Merge branch 'bugfix/script-editor-out-of-range-exception' (diff) | |
| download | KVIrc-28292170d8c02743cabfabba3a1623b8d71b9aa2.tar.gz KVIrc-28292170d8c02743cabfabba3a1623b8d71b9aa2.tar.bz2 KVIrc-28292170d8c02743cabfabba3a1623b8d71b9aa2.zip | |
Port to (and require) Qt 5.15. Drop KDE4 support, fix KDE5 (#2541)
* Port to (and require) Qt 5.15. Drop KDE4 support, implement KDE5 support where needed.
---------
Co-authored-by: Fabio Bas <fabio.bas@officineinformatiche.net>
Diffstat (limited to 'src/modules/logview')
| -rw-r--r-- | src/modules/logview/LogFile.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/logview/LogFile.cpp b/src/modules/logview/LogFile.cpp index 43d98f01c..be244077b 100644 --- a/src/modules/logview/LogFile.cpp +++ b/src/modules/logview/LogFile.cpp @@ -30,6 +30,7 @@ #include "KviFileUtils.h" #include <QFileInfo> +#include <QLocale> #ifdef COMPILE_ZLIB_SUPPORT #include <zlib.h> @@ -91,14 +92,14 @@ LogFile::LogFile(const QString & szName) m_date = QDate::fromString(szDate, Qt::ISODate); break; case 2: - m_date = QDate::fromString(szDate, Qt::SystemLocaleShortDate); + m_date = QLocale().toDate(szDate, QLocale::ShortFormat); if(!m_date.isValid()) { // some locale date formats use '/' as a separator; we change them to '-' // when creating log files. Try to reverse that change here QString szUnescapedDate = szDate; szUnescapedDate.replace('-', KVI_PATH_SEPARATOR_CHAR); - m_date = QDate::fromString(szUnescapedDate, Qt::SystemLocaleShortDate); + m_date = QLocale().toDate(szUnescapedDate, QLocale::ShortFormat); if(m_date.isValid()) { //qt4 defaults to 1900 for years. So "11" means "1911" instead of "2011".. what a pity @@ -122,14 +123,14 @@ LogFile::LogFile(const QString & szName) m_date = QDate::fromString(szDate, Qt::ISODate); if(!m_date.isValid()) { - m_date = QDate::fromString(szDate, Qt::SystemLocaleShortDate); + m_date = QLocale().toDate(szDate, QLocale::ShortFormat); if(!m_date.isValid()) { // some locale date formats use '/' as a separator; we change them to '-' // when creating log files. Try to reverse that change here QString szUnescapedDate = szDate; szUnescapedDate.replace('-', KVI_PATH_SEPARATOR_CHAR); - m_date = QDate::fromString(szUnescapedDate, Qt::SystemLocaleShortDate); + m_date = QLocale().toDate(szUnescapedDate, QLocale::ShortFormat); if(m_date.isValid()) { //qt4 defaults to 1900 for years. So "11" means "1911" instead of "2011".. what a pity |
