From a71ce8e2065393a3dcf4cbcbd50a95732783c93e Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Mon, 4 May 2015 18:55:08 -0300 Subject: [PATCH 2/3] Make use of QLoggingCategory packagekitqt --- src/common.h | 4 ++++ src/daemon.cpp | 2 ++ src/daemonprivate.cpp | 2 +- src/transaction.cpp | 4 +++- src/transactionprivate.cpp | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common.h b/src/common.h index 05a3df4..24b7894 100644 --- a/src/common.h +++ b/src/common.h @@ -17,6 +17,10 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ +#include + +Q_DECLARE_LOGGING_CATEGORY(PACKAGEKITQT_TRANSACTION) +Q_DECLARE_LOGGING_CATEGORY(PACKAGEKITQT_DAEMON) #define PK_NAME "org.freedesktop.PackageKit" #define PK_PATH "/org/freedesktop/PackageKit" diff --git a/src/daemon.cpp b/src/daemon.cpp index 647756a..138a13a 100755 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -26,6 +26,8 @@ #include "common.h" +Q_LOGGING_CATEGORY(PACKAGEKITQT_TRANSACTION, "packagekitqt.daemon") + using namespace PackageKit; Daemon* Daemon::m_global = 0; diff --git a/src/daemonprivate.cpp b/src/daemonprivate.cpp index 25ba55b..15e5362 100644 --- a/src/daemonprivate.cpp +++ b/src/daemonprivate.cpp @@ -143,7 +143,7 @@ void DaemonPrivate::updateProperties(const QVariantMap &properties) } else if (property == QLatin1String("VersionMinor")) { versionMinor = value.toUInt(); } else { - qWarning() << "Unknown Transaction property:" << property << value; + qCWarning(PACKAGEKITQT_DAEMON) << "Unknown Daemon property:" << property << value; } ++it; diff --git a/src/transaction.cpp b/src/transaction.cpp index 7cfa302..96d946b 100755 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -28,6 +28,8 @@ #include +Q_LOGGING_CATEGORY(PACKAGEKITQT_TRANSACTION, "packagekitqt.transaction") + using namespace PackageKit; Transaction::Transaction() @@ -353,7 +355,7 @@ Transaction::InternalError Transaction::parseError(const QString &errorName) return Transaction::InternalErrorFunctionNotSupported; } - qWarning() << "Transaction::parseError: unknown error" << errorName; + qCWarning(PACKAGEKITQT_TRANSACTION) << "Transaction::parseError: unknown error" << errorName; return Transaction::InternalErrorFailed; } diff --git a/src/transactionprivate.cpp b/src/transactionprivate.cpp index 2c73899..56bc218 100644 --- a/src/transactionprivate.cpp +++ b/src/transactionprivate.cpp @@ -335,7 +335,7 @@ void TransactionPrivate::updateProperties(const QVariantMap &properties) uid = value.toUInt(); QMetaObject::invokeMethod(q, "uidChanged", Qt::QueuedConnection); } else { - qWarning() << "Unknown Transaction property:" << property << value; + qCWarning(PACKAGEKITQT_TRANSACTION) << "Unknown Transaction property:" << property << value; } ++it; -- 2.5.0