summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/logger/src/Logger.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-08-16 12:04:15 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-08-16 12:37:02 +0200
commit94eb1df58b4ad4e25941782832d20e1c8d57f0c5 (patch)
treed569e73ee64f887c78200ce0e7d83a4957fe129a /rbutil/rbutilqt/logger/src/Logger.cpp
parentcd352d9052b42781887996da5b0691dd581ce48c (diff)
downloadrockbox-94eb1df58b.tar.gz
rockbox-94eb1df58b.tar.bz2
rockbox-94eb1df58b.zip
rbutil: Logger Qt6 fixes.
Fix various issues with building CuteLogger with Qt6. Change-Id: Iceac8f8a19f6703868c5a41b725d3cd69c724239
Diffstat (limited to 'rbutil/rbutilqt/logger/src/Logger.cpp')
-rw-r--r--rbutil/rbutilqt/logger/src/Logger.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/logger/src/Logger.cpp b/rbutil/rbutilqt/logger/src/Logger.cpp
index 16a18db728..689bc42e80 100644
--- a/rbutil/rbutilqt/logger/src/Logger.cpp
+++ b/rbutil/rbutilqt/logger/src/Logger.cpp
@@ -600,8 +600,13 @@ Logger::~Logger()
// Cleanup appenders
QMutexLocker appendersLocker(&d->loggerMutex);
+#if QT_VERSION >= 0x050e00
+ QSet<AbstractAppender*> deleteList(QSet<AbstractAppender*>(d->appenders.begin(), d->appenders.end()));
+ deleteList.unite(QSet<AbstractAppender*>(d->categoryAppenders.values().begin(), d->categoryAppenders.values().end()));
+#else
QSet<AbstractAppender*> deleteList(QSet<AbstractAppender*>::fromList(d->appenders));
deleteList.unite(QSet<AbstractAppender*>::fromList(d->categoryAppenders.values()));
+#endif
qDeleteAll(deleteList);
appendersLocker.unlock();
@@ -1032,7 +1037,11 @@ void LoggerTimingHelper::start(const char* msg, ...)
{
va_list va;
va_start(va, msg);
+#if QT_VERSION >= 0x050500
+ m_block = QString().vasprintf(msg, va);
+#else
m_block = QString().vsprintf(msg, va);
+#endif
va_end(va);
m_time.start();
@@ -1062,7 +1071,7 @@ LoggerTimingHelper::~LoggerTimingHelper()
else
message = QString(QLatin1String("\"%1\" finished in ")).arg(m_block);
- int elapsed = m_time.elapsed();
+ qint64 elapsed = m_time.elapsed();
if (elapsed >= 10000 && m_timingMode == Logger::TimingAuto)
message += QString(QLatin1String("%1 s.")).arg(elapsed / 1000);
else