From f65a1f206f3b768e14c27653838d282486ee762e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 7 Sep 2015 18:54:11 +0200 Subject: [PATCH] Turn core qWarnings into qCWarning --- core/backends/lan/landevicelink.cpp | 2 +- core/backends/lan/uploadjob.cpp | 6 +++--- core/device.cpp | 2 +- core/filetransferjob.cpp | 2 +- core/kdeconnectplugin.cpp | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp index 09870579b..229038209 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -106,7 +106,7 @@ void LanDeviceLink::dataReceived() } else { if (unserialized.hasPayloadTransferInfo()) { - qWarning() << "Ignoring unencrypted payload"; + qCWarning(KDECONNECT_CORE) << "Ignoring unencrypted payload"; } Q_EMIT receivedPackage(unserialized); diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp index 90978f22a..930eae965 100644 --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -42,7 +42,7 @@ void UploadJob::start() while (!mServer->listen(QHostAddress::Any, mPort)) { mPort++; if (mPort > 1764) { //No ports available? - qWarning(KDECONNECT_CORE) << "Error opening a port in range 1739-1764 for file transfer"; + qCWarning(KDECONNECT_CORE) << "Error opening a port in range 1739-1764 for file transfer"; mPort = 0; return; } @@ -56,7 +56,7 @@ void UploadJob::newConnection() if (mSocket || !mServer->hasPendingConnections()) return; if (!mInput->open(QIODevice::ReadOnly)) { - qWarning() << "error when opening the input to upload"; + qCWarning(KDECONNECT_CORE) << "error when opening the input to upload"; return; //TODO: Handle error, clean up... } @@ -73,7 +73,7 @@ void UploadJob::readyRead() qint64 bytes = qMin(mInput->bytesAvailable(), (qint64)4096); int w = mSocket->write(mInput->read(bytes)); if (w<0) { - qWarning() << "error when writing data to upload" << bytes << mInput->bytesAvailable(); + qCWarning(KDECONNECT_CORE) << "error when writing data to upload" << bytes << mInput->bytesAvailable(); break; } else diff --git a/core/device.cpp b/core/device.cpp index 679d44489..fb7ee2b9d 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -269,7 +269,7 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link) m_protocolVersion = identityPackage.get("protocolVersion"); if (m_protocolVersion != NetworkPackage::ProtocolVersion) { - qWarning() << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; + qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; } connect(link, SIGNAL(destroyed(QObject*)), diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp index f10f527d5..0e21af013 100644 --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -41,7 +41,7 @@ FileTransferJob::FileTransferJob(const QSharedPointer& origin, qint64 Q_ASSERT(mOrigin); Q_ASSERT(mOrigin->isReadable()); if (mDestination.scheme().isEmpty()) { - qWarning() << "Destination QUrl" << mDestination << "lacks a scheme. Setting its scheme to 'file'."; + qCWarning(KDECONNECT_CORE) << "Destination QUrl" << mDestination << "lacks a scheme. Setting its scheme to 'file'."; mDestination.setScheme("file"); } diff --git a/core/kdeconnectplugin.cpp b/core/kdeconnectplugin.cpp index ac83e65d9..7e7f16257 100644 --- a/core/kdeconnectplugin.cpp +++ b/core/kdeconnectplugin.cpp @@ -20,7 +20,7 @@ #include "kdeconnectplugin.h" -#include +#include "core_debug.h" struct KdeConnectPluginPrivate { @@ -69,9 +69,9 @@ Device const* KdeConnectPlugin::device() const bool KdeConnectPlugin::sendPackage(NetworkPackage& np) const { if(!d->mOutgoingTypes.contains(np.type())) { - qWarning() << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->mOutgoingTypes; + qCWarning(KDECONNECT_CORE) << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->mOutgoingTypes; return false; } -// qWarning() << metaObject()->className() << "sends" << np.type() << ". Supported:" << d->mOutgoingTypes; +// qCWarning(KDECONNECT_CORE) << metaObject()->className() << "sends" << np.type() << ". Supported:" << d->mOutgoingTypes; return d->mDevice->sendPackage(np); }