From 97b1ea46c11d6fb4857fc7eb3476ba82fa8d60ec Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 27 Aug 2023 05:45:50 +0300 Subject: [PATCH] kdecore: log KSystemTimeZones and KTimeZone messages to the correct debug area Signed-off-by: Ivailo Monev --- kdecore/date/ksystemtimezone.cpp | 12 ++++++------ kdecore/date/ktimezone.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/kdecore/date/ksystemtimezone.cpp b/kdecore/date/ksystemtimezone.cpp index 57fe9238..204f3d37 100644 --- a/kdecore/date/ksystemtimezone.cpp +++ b/kdecore/date/ksystemtimezone.cpp @@ -160,7 +160,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) const QString zonetab = m_zoneinfoDir + QLatin1String("/zone.tab"); QFile zonetabfile(zonetab); if (!zonetabfile.open(QFile::ReadOnly)) { - kWarning() << "Could not open zone.tab" << zonetab; + kWarning(161) << "Could not open zone.tab" << zonetab; return; } @@ -180,7 +180,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) m_watcher->addPaths(watchlist); connect(m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(update(QString))); - kDebug() << "Parsing" << zonetab; + kDebug(161) << "Parsing" << zonetab; char zonecode[4]; char zonecoordinates[32]; char zonename[128]; @@ -202,7 +202,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) ); if (Q_UNLIKELY(sscanfresult < 3 || sscanfresult > 4)) { - kWarning() << "Invalid zone.tab entry" << zonetabline; + kWarning(161) << "Invalid zone.tab entry" << zonetabline; continue; } @@ -211,7 +211,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) ); if (Q_UNLIKELY(zonetabcoordinates.first == KTimeZone::UNKNOWN || zonetabcoordinates.second == KTimeZone::UNKNOWN)) { - kWarning() << "Invalid zone.tab coordinates" << zonetabline; + kWarning(161) << "Invalid zone.tab coordinates" << zonetabline; continue; } @@ -229,7 +229,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) const QString localtz = reallocaltime.mid(zonediroffset, reallocaltime.size() - zonediroffset); m_localtz = findZone(localtz); #ifndef NDEBUG - kDebug() << "Zones update took" << updatetimer.elapsed() << "ms"; + kDebug(161) << "Zones update took" << updatetimer.elapsed() << "ms"; #endif return; } @@ -248,7 +248,7 @@ void KSystemTimeZonesPrivate::update(const QString &path) if (zone.abbreviations().contains(localtz)) { m_localtz = zone; #ifndef NDEBUG - kDebug() << "Zones update took" << updatetimer.elapsed() << "ms"; + kDebug(161) << "Zones update took" << updatetimer.elapsed() << "ms"; #endif break; } diff --git a/kdecore/date/ktimezone.cpp b/kdecore/date/ktimezone.cpp index ba5c819c..85dc63c5 100644 --- a/kdecore/date/ktimezone.cpp +++ b/kdecore/date/ktimezone.cpp @@ -147,11 +147,11 @@ KTimeZonePrivate::KTimeZonePrivate(const QString &nam, QFile tzfile(zoneinfoDir() + QDir::separator() + name); if (!tzfile.open(QFile::ReadOnly)) { - kWarning() << "Could not open" << tzfile.fileName(); + kWarning(161) << "Could not open" << tzfile.fileName(); return; } - kDebug() << "Parsing" << tzfile.fileName(); + kDebug(161) << "Parsing" << tzfile.fileName(); QDataStream tzstream(&tzfile); tzstream.setByteOrder(QDataStream::BigEndian); @@ -159,7 +159,7 @@ KTimeZonePrivate::KTimeZonePrivate(const QString &nam, ::memset(tzmagic, 0, sizeof(tzmagic) * sizeof(char)); tzstream.readRawData(tzmagic, 4); if (qstrcmp(tzmagic, "TZif") != 0) { - kWarning() << "Invalid magic bits" << tzfile.fileName() << tzmagic; + kWarning(161) << "Invalid magic bits" << tzfile.fileName() << tzmagic; return; } @@ -183,7 +183,7 @@ KTimeZonePrivate::KTimeZonePrivate(const QString &nam, // NOTE: should not be less than or equal to zero if (Q_UNLIKELY(tzh_typecnt <= 0)) { - kWarning() << "Invalid number of local time types" << tzfile.fileName(); + kWarning(161) << "Invalid number of local time types" << tzfile.fileName(); return; }