From kde-commits Mon Jun 30 23:26:17 2014 From: Albert Vaca Date: Mon, 30 Jun 2014 23:26:17 +0000 To: kde-commits Subject: [kdeconnect-kde] /: Simplified debug areas so we only have one, called "kdeconnect" Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140417078818237 Git commit cabb0f2f7bca256fbbfafd86e0bb6fa97007196b by Albert Vaca. Committed on 30/06/2014 at 23:25. Pushed by albertvaka into branch 'master'. Simplified debug areas so we only have one, called "kdeconnect" M +0 -1 core/CMakeLists.txt M +2 -2 core/backends/lan/landevicelink.cpp M +10 -10 core/backends/lan/lanlinkprovider.cpp M +1 -1 core/backends/lan/uploadjob.cpp M +12 -12 core/daemon.cpp M +11 -11 core/device.cpp M +8 -8 core/filetransferjob.cpp D +0 -28 core/kdebugnamespace.cpp M +5 -1 core/kdebugnamespace.h M +4 -4 core/networkpackage.cpp M +5 -5 core/pluginloader.cpp M +0 -1 interfaces/CMakeLists.txt D +0 -27 interfaces/kdebugnamespace.cpp D +0 -29 interfaces/kdebugnamespace.h M +0 -1 kcm/CMakeLists.txt M +3 -4 kcm/devicessortproxymodel.cpp M +2 -1 kcm/kcm.cpp D +0 -26 kcm/kdebugnamespace.cpp D +0 -29 kcm/kdebugnamespace.h M +10 -12 kded/kded.cpp M +1 -1 kio/CMakeLists.txt D +0 -26 kio/kdebugnamespace.cpp D +0 -29 kio/kdebugnamespace.h M +7 -7 kio/kiokdeconnect.cpp M +1 -1 plugins/battery/batterydbusinterface.cpp M +6 -12 plugins/mpriscontrol/mpriscontrolplugin.cpp M +3 -3 plugins/notifications/notificationsdbusinterface.cpp M +3 -3 plugins/ping/pingplugin.cpp M +11 -11 plugins/sftp/mounter.cpp M +8 -8 plugins/sftp/sftpplugin.cpp M +6 -6 plugins/share/shareplugin.cpp M +1 -1 plugins/telephony/telephonyplugin.cpp http://commits.kde.org/kdeconnect-kde/cabb0f2f7bca256fbbfafd86e0bb6fa970071= 96b diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index aa7ee5b..49bcaba 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -28,7 +28,6 @@ set(kded_kdeconnect_SRCS filetransferjob.cpp daemon.cpp device.cpp - kdebugnamespace.cpp ) = kde4_add_library(kdeconnectcore SHARED ${kded_kdeconnect_SRCS}) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landev= icelink.cpp index 03c9f1f..be8a37b 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -80,7 +80,7 @@ void LanDeviceLink::dataReceived() = const QByteArray package =3D mSocketLineReader->readLine(); = - //kDebug(kdeconnect_kded()) << "LanDeviceLink dataReceived" << package; + //kDebug(debugArea()) << "LanDeviceLink dataReceived" << package; = NetworkPackage unserialized(QString::null); NetworkPackage::unserialize(package, &unserialized); @@ -90,7 +90,7 @@ void LanDeviceLink::dataReceived() unserialized.decrypt(mPrivateKey, &decrypted); = if (decrypted.hasPayloadTransferInfo()) { - kDebug(kdeconnect_kded()) << "HasPayloadTransferInfo"; + kDebug(debugArea()) << "HasPayloadTransferInfo"; DownloadJob* job =3D new DownloadJob(mSocketLineReader->peerAd= dress(), decrypted.payloadTransferInfo()); job->start(); decrypted.setPayload(job->getPayload(), decrypted.payloadSize(= )); diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanl= inkprovider.cpp index 13855ff..c59cba2 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -151,7 +151,7 @@ void LanLinkProvider::connectError() disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, = SLOT(connectError())); disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); = - kDebug(kdeconnect_kded()) << "Fallback (1), try reverse connection"; + kDebug(debugArea()) << "Fallback (1), try reverse connection"; NetworkPackage np(""); NetworkPackage::createIdentityPackage(&np); np.set("tcpPort", mTcpPort); @@ -173,7 +173,7 @@ void LanLinkProvider::connected() = NetworkPackage* receivedPackage =3D receivedIdentityPackages[socket].n= p; const QString& deviceId =3D receivedPackage->get("deviceId"); - //kDebug(kdeconnect_kded()) << "Connected" << socket->isWritable(); + //kDebug(debugArea()) << "Connected" << socket->isWritable(); = LanDeviceLink* deviceLink =3D new LanDeviceLink(deviceId, this, socket= ); = @@ -185,7 +185,7 @@ void LanLinkProvider::connected() //TODO: Use reverse connection too to preffer connecting a unstable de= vice (a phone) to a stable device (a computer) if (success) { = - //kDebug(kdeconnect_kded()) << "Handshaking done (i'm the existing= device)"; + //kDebug(debugArea()) << "Handshaking done (i'm the existing devic= e)"; = connect(deviceLink, SIGNAL(destroyed(QObject*)), this, SLOT(deviceLinkDestroyed(QObject*))); @@ -206,7 +206,7 @@ void LanLinkProvider::connected() = } else { //I think this will never happen - kDebug(kdeconnect_kded()) << "Fallback (2), try reverse connection= "; + kDebug(debugArea()) << "Fallback (2), try reverse connection"; mUdpSocket.writeDatagram(np2.serialize(), receivedIdentityPackages= [socket].sender, port); delete deviceLink; } @@ -220,7 +220,7 @@ void LanLinkProvider::connected() //I'm the new device and this is the answer to my UDP introduction (no dat= a received yet) void LanLinkProvider::newConnection() { - //kDebug(kdeconnect_kded()) << "LanLinkProvider newConnection"; + //kDebug(debugArea()) << "LanLinkProvider newConnection"; = while(mTcpServer->hasPendingConnections()) { QTcpSocket* socket =3D mTcpServer->nextPendingConnection(); @@ -234,7 +234,7 @@ void LanLinkProvider::newConnection() NetworkPackage::createIdentityPackage(&np); int written =3D socket->write(np.serialize()); = - kDebug(kdeconnect_kded()) << "LanLinkProvider sent package." << writte= n << " bytes written, waiting for reply"; + kDebug(debugArea()) << "LanLinkProvider sent package." << written << "= bytes written, waiting for reply"; */ } = @@ -246,20 +246,20 @@ void LanLinkProvider::dataReceived() = const QByteArray data =3D socket->readLine(); = - //kDebug(kdeconnect_kded()) << "LanLinkProvider received reply:" << da= ta; + //kDebug(debugArea()) << "LanLinkProvider received reply:" << data; = NetworkPackage np(""); bool success =3D NetworkPackage::unserialize(data, &np); = if (!success || np.type() !=3D PACKAGE_TYPE_IDENTITY) { - kDebug(kdeconnect_kded()) << "LanLinkProvider/newConnection: Not a= n identification package (wuh?)"; + kDebug(debugArea()) << "LanLinkProvider/newConnection: Not an iden= tification package (wuh?)"; return; } = const QString& deviceId =3D np.get("deviceId"); LanDeviceLink* deviceLink =3D new LanDeviceLink(deviceId, this, socket= ); = - //kDebug(kdeconnect_kded()) << "Handshaking done (i'm the new device)"; + //kDebug(debugArea()) << "Handshaking done (i'm the new device)"; = connect(deviceLink, SIGNAL(destroyed(QObject*)), this, SLOT(deviceLinkDestroyed(QObject*))); @@ -282,7 +282,7 @@ void LanLinkProvider::dataReceived() = void LanLinkProvider::deviceLinkDestroyed(QObject* destroyedDeviceLink) { - //kDebug(kdeconnect_kded()) << "deviceLinkDestroyed"; + //kDebug(debugArea()) << "deviceLinkDestroyed"; const QString id =3D destroyedDeviceLink->property("deviceId").toStrin= g(); QMap< QString, DeviceLink* >::iterator oldLinkIterator =3D mLinks.find= (id); if (oldLinkIterator !=3D mLinks.end() && oldLinkIterator.value() =3D= =3D destroyedDeviceLink) { diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.= cpp index a5b1215..752bf69 100644 --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -39,7 +39,7 @@ void UploadJob::start() while(!mServer->listen(QHostAddress::Any, mPort)) { mPort++; if (mPort > 1764) { //No ports available? - kDebug(kdeconnect_kded()) << "Error opening a port in range 17= 39-1764 for file transfer"; + kDebug(debugArea()) << "Error opening a port in range 1739-176= 4 for file transfer"; mPort =3D 0; return; } diff --git a/core/daemon.cpp b/core/daemon.cpp index 9a259ee..38ad08d 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -69,13 +69,13 @@ Daemon::Daemon(QObject *parent) uuid =3D uuid.mid(1, uuid.length() - 2).replace("-", "_"); config->group("myself").writeEntry("id", uuid); config->sync(); - kDebug(kdeconnect_kded()) << "My id:" << uuid; + kDebug(debugArea()) << "My id:" << uuid; } = - //kDebug(kdeconnect_kded()) << "QCA supported capabilities:" << QCA::s= upportedFeatures().join(","); + //kDebug(debugArea()) << "QCA supported capabilities:" << QCA::support= edFeatures().join(","); if(!QCA::isSupported("rsa")) { //TODO: Maybe display this in a more visible way? - kWarning(kdeconnect_kded()) << "Error: KDE Connect could not find = support for RSA in your QCA installation, if your distribution provides" + kWarning(debugArea()) << "Error: KDE Connect could not find suppor= t for RSA in your QCA installation, if your distribution provides" << "separate packages for QCA-ossl and QCA-gnupg plugin= s, make sure you have them installed and try again"; return; } @@ -89,13 +89,13 @@ Daemon::Daemon(QObject *parent) = if (!privKey.open(QIODevice::ReadWrite | QIODevice::Truncate)) { - kWarning(kdeconnect_kded()) << "Error: KDE Connect could not c= reate private keys file: " << privateKeyPath; + kWarning(debugArea()) << "Error: KDE Connect could not create = private keys file: " << privateKeyPath; return; } = if (!privKey.setPermissions(strict)) { - kWarning(kdeconnect_kded()) << "Error: KDE Connect could not s= et permissions for private file: " << privateKeyPath; + kWarning(debugArea()) << "Error: KDE Connect could not set per= missions for private file: " << privateKeyPath; } = //http://delta.affinix.com/docs/qca/rsatest_8cpp-example.html @@ -113,11 +113,11 @@ Daemon::Daemon(QObject *parent) = if (QFile::permissions(config->group("myself").readEntry("privateKeyPa= th")) !=3D strict) { - kWarning(kdeconnect_kded()) << "Error: KDE Connect detects wrong p= ermissions for private file " << config->group("myself").readEntry("private= KeyPath"); + kWarning(debugArea()) << "Error: KDE Connect detects wrong permiss= ions for private file " << config->group("myself").readEntry("privateKeyPat= h"); } = //Debugging - kDebug(kdeconnect_kded()) << "Starting KdeConnect daemon"; + kDebug(debugArea()) << "Starting KdeConnect daemon"; = //Load backends (hardcoded by now, should be plugins in a future) d->mLinkProviders.insert(new LanLinkProvider()); @@ -185,14 +185,14 @@ void Daemon::onNewDeviceLink(const NetworkPackage& id= entityPackage, DeviceLink* = const QString& id =3D identityPackage.get("deviceId"); = - //kDebug(kdeconnect_kded()) << "Device discovered" << id << "via" << d= l->provider()->name(); + //kDebug(debugArea()) << "Device discovered" << id << "via" << dl->pro= vider()->name(); = if (d->mDevices.contains(id)) { - //kDebug(kdeconnect_kded()) << "It is a known device"; + //kDebug(debugArea()) << "It is a known device"; Device* device =3D d->mDevices[id]; device->addLink(identityPackage, dl); } else { - //kDebug(kdeconnect_kded()) << "It is a new device"; + //kDebug(debugArea()) << "It is a new device"; = Device* device =3D new Device(this, identityPackage, dl); connect(device, SIGNAL(reachableStatusChanged()), this, SLOT(onDev= iceReachableStatusChanged())); @@ -213,12 +213,12 @@ void Daemon::onDeviceReachableStatusChanged() = Q_EMIT deviceVisibilityChanged(id, device->isReachable()); = - //kDebug(kdeconnect_kded()) << "Device" << device->name() << "reachabl= e status changed:" << device->isReachable(); + //kDebug(debugArea()) << "Device" << device->name() << "reachable stat= us changed:" << device->isReachable(); = if (!device->isReachable()) { = if (!device->isPaired()) { - kDebug(kdeconnect_kded()) << "Destroying device" << device->na= me(); + kDebug(debugArea()) << "Destroying device" << device->name(); Q_EMIT deviceRemoved(id); d->mDevices.remove(id); device->deleteLater(); diff --git a/core/device.cpp b/core/device.cpp index b005140..dacc7db 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -233,7 +233,7 @@ static bool lessThan(DeviceLink* p1, DeviceLink* p2) = void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* li= nk) { - //kDebug(kdeconnect_kded()) << "Adding link to" << id() << "via" << li= nk->provider(); + //kDebug(debugArea()) << "Adding link to" << id() << "via" << link->pr= ovider(); = m_protocolVersion =3D identityPackage.get("protocolVersion"); if (m_protocolVersion !=3D NetworkPackage::ProtocolVersion) { @@ -280,7 +280,7 @@ void Device::removeLink(DeviceLink* link) { m_deviceLinks.removeOne(link); = - //kDebug(kdeconnect_kded()) << "RemoveLink" << m_deviceLinks.size() <<= "links remaining"; + //kDebug(debugArea()) << "RemoveLink" << m_deviceLinks.size() << "link= s remaining"; = if (m_deviceLinks.isEmpty()) { reloadPlugins(); @@ -313,12 +313,12 @@ void Device::privateReceivedPackage(const NetworkPack= age& np) { if (np.type() =3D=3D PACKAGE_TYPE_PAIR) { = - //kDebug(kdeconnect_kded()) << "Pair package"; + //kDebug(debugArea()) << "Pair package"; = bool wantsPair =3D np.get("pair"); = if (wantsPair =3D=3D isPaired()) { - kDebug(kdeconnect_kded()) << "Already" << (wantsPair? "paired"= :"unpaired"); + kDebug(debugArea()) << "Already" << (wantsPair? "paired":"unpa= ired"); if (m_pairStatus =3D=3D Device::Requested) { m_pairStatus =3D Device::NotPaired; m_pairingTimeut.stop(); @@ -333,7 +333,7 @@ void Device::privateReceivedPackage(const NetworkPackag= e& np) const QString& key =3D np.get("publicKey"); m_publicKey =3D QCA::RSAPublicKey::fromPEM(key); if (m_publicKey.isNull()) { - kDebug(kdeconnect_kded()) << "ERROR decoding key"; + kDebug(debugArea()) << "ERROR decoding key"; if (m_pairStatus =3D=3D Device::Requested) { m_pairStatus =3D Device::NotPaired; m_pairingTimeut.stop(); @@ -344,12 +344,12 @@ void Device::privateReceivedPackage(const NetworkPack= age& np) = if (m_pairStatus =3D=3D Device::Requested) { //We started pai= ring = - kDebug(kdeconnect_kded()) << "Pair answer"; + kDebug(debugArea()) << "Pair answer"; setAsPaired(); = } else { = - kDebug(kdeconnect_kded()) << "Pair request"; + kDebug(debugArea()) << "Pair request"; = KNotification* notification =3D new KNotification("pingRec= eived"); //KNotification::Persistent notification->setPixmap(KIcon("dialog-information").pixmap= (48, 48)); @@ -367,7 +367,7 @@ void Device::privateReceivedPackage(const NetworkPackag= e& np) = } else { = - kDebug(kdeconnect_kded()) << "Unpair request"; + kDebug(debugArea()) << "Unpair request"; = PairStatus prevPairStatus =3D m_pairStatus; m_pairStatus =3D Device::NotPaired; @@ -390,7 +390,7 @@ void Device::privateReceivedPackage(const NetworkPackag= e& np) plugin->receivePackage(np); } } else { - kDebug(kdeconnect_kded()) << "device" << name() << "not paired, ig= noring package" << np.type(); + kDebug(debugArea()) << "device" << name() << "not paired, ignoring= package" << np.type(); unpair(); = } @@ -408,7 +408,7 @@ bool Device::sendOwnPublicKey() = void Device::rejectPairing() { - kDebug(kdeconnect_kded()) << "Rejected pairing"; + kDebug(debugArea()) << "Rejected pairing"; = m_pairStatus =3D Device::NotPaired; = @@ -424,7 +424,7 @@ void Device::acceptPairing() { if (m_pairStatus !=3D Device::RequestedByPeer) return; = - kDebug(kdeconnect_kded()) << "Accepted pairing"; + kDebug(debugArea()) << "Accepted pairing"; = bool success =3D sendOwnPublicKey(); = diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp index f98e95a..a7db9d0 100644 --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -41,18 +41,18 @@ FileTransferJob::FileTransferJob(const QSharedPointer& origin, int si mDeviceName =3D i18nc("Device name that will appear on the jobs", "KDE= -Connect"); = setCapabilities(Killable); - kDebug(kdeconnect_kded()) << "FileTransferJob Downloading payload to" = << destination; + kDebug(debugArea()) << "FileTransferJob Downloading payload to" << des= tination; } = void FileTransferJob::openFinished(KJob* job) { - kDebug(kdeconnect_kded()) << job->errorString(); + kDebug(debugArea()) << job->errorString(); } = void FileTransferJob::start() { QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection); - //kDebug(kdeconnect_kded()) << "FileTransferJob start"; + //kDebug(debugArea()) << "FileTransferJob start"; } = void FileTransferJob::doStart() @@ -136,10 +136,10 @@ void FileTransferJob::open(KIO::Job* job) { Q_UNUSED(job); = - //kDebug(kdeconnect_kded()) << "FileTransferJob open"; + //kDebug(debugArea()) << "FileTransferJob open"; = if (!mOrigin) { - kDebug(kdeconnect_kded()) << "FileTransferJob: Origin is null"; + kDebug(debugArea()) << "FileTransferJob: Origin is null"; return; } = @@ -161,7 +161,7 @@ void FileTransferJob::readyRead() mWritten +=3D data.size(); setProcessedAmount(Bytes, mWritten); = - //kDebug(kdeconnect_kded()) << "readyRead" << mSize << mWritten << byt= es; + //kDebug(debugArea()) << "readyRead" << mSize << mWritten << bytes; = if (mSize > -1) { //If a least 1 second has passed since last update @@ -192,11 +192,11 @@ void FileTransferJob::sourceFinished() = //TODO: MD5 check the file if (mSize > -1 && mWritten !=3D mSize) { - kDebug(kdeconnect_kded()) << "Received incomplete file (" << mWrit= ten << " of " << mSize << " bytes)"; + kDebug(debugArea()) << "Received incomplete file (" << mWritten <<= " of " << mSize << " bytes)"; setError(1); setErrorText(i18n("Received incomplete file")); } else { - kDebug(kdeconnect_kded()) << "Finished transfer" << mDestinationJo= b->url(); + kDebug(debugArea()) << "Finished transfer" << mDestinationJob->url= (); } mDestinationJob->close(); mDestinationJob->deleteLater(); diff --git a/core/kdebugnamespace.cpp b/core/kdebugnamespace.cpp deleted file mode 100644 index a2c8e87..0000000 --- a/core/kdebugnamespace.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "kdebugnamespace.h" - -int kdeconnect_kded() { - static int s_area =3D KDebug::registerArea("kdeconnect_kded", true); - return s_area; -} - - diff --git a/core/kdebugnamespace.h b/core/kdebugnamespace.h index 60c733d..c7a094a 100644 --- a/core/kdebugnamespace.h +++ b/core/kdebugnamespace.h @@ -23,7 +23,11 @@ = #include = -KDE_EXPORT int kdeconnect_kded(); +inline int debugArea() +{ + static int theArea =3D KDebug::registerArea("kdeconnect"); + return theArea; +}; = #endif = diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp index 16ade4a..330850c 100644 --- a/core/networkpackage.cpp +++ b/core/networkpackage.cpp @@ -82,10 +82,10 @@ QByteArray NetworkPackage::serialize() const QJson::Serializer serializer; QByteArray json =3D serializer.serialize(variant,&ok); if (!ok) { - kDebug(kdeconnect_kded()) << "Serialization error:" << serializer.= errorMessage(); + kDebug(debugArea()) << "Serialization error:" << serializer.errorM= essage(); } else { if (!isEncrypted()) { - //kDebug(kdeconnect_kded()) << "Serialized package:" << json; + //kDebug(kDebugArea) << "Serialized package:" << json; } json.append('\n'); } @@ -100,7 +100,7 @@ bool NetworkPackage::unserialize(const QByteArray& a, N= etworkPackage* np) bool ok; QVariantMap variant =3D parser.parse(a, &ok).toMap(); if (!ok) { - kDebug(kdeconnect_kded()) << "Unserialization error:" << a; + kDebug(debugArea()) << "Unserialization error:" << a; return false; } = @@ -108,7 +108,7 @@ bool NetworkPackage::unserialize(const QByteArray& a, N= etworkPackage* np) QJson::QObjectHelper::qvariant2qobject(variant, np); = if (!np->isEncrypted()) { - //kDebug(kdeconnect_kded()) << "Unserialized: " << a; + //kDebug(kDebugArea) << "Unserialized: " << a; } = np->mPayloadSize =3D variant["payloadSize"].toInt(); //Will return 0 i= f was not present, which is ok diff --git a/core/pluginloader.cpp b/core/pluginloader.cpp index 1c10c07..b5f9714 100644 --- a/core/pluginloader.cpp +++ b/core/pluginloader.cpp @@ -50,7 +50,7 @@ KPluginInfo PluginLoader::getPluginInfo(const QString& na= me) const { KService::Ptr service =3D plugins[name]; if (!service) { - kDebug(kdeconnect_kded()) << "Plugin unknown" << name; + kDebug(debugArea()) << "Plugin unknown" << name; return KPluginInfo(); } = @@ -63,13 +63,13 @@ PluginData PluginLoader::instantiatePluginForDevice(con= st QString& name, Device* = KService::Ptr service =3D plugins[name]; if (!service) { - kDebug(kdeconnect_kded()) << "Plugin unknown" << name; + kDebug(debugArea()) << "Plugin unknown" << name; return ret; } = KPluginFactory *factory =3D KPluginLoader(service->library()).factory(= ); if (!factory) { - kDebug(kdeconnect_kded()) << "KPluginFactory could not load the pl= ugin:" << service->library(); + kDebug(debugArea()) << "KPluginFactory could not load the plugin:"= << service->library(); return ret; } = @@ -81,11 +81,11 @@ PluginData PluginLoader::instantiatePluginForDevice(con= st QString& name, Device* //FIXME any reason to use QObject in template param instead KdeConnect= Plugin? ret.plugin =3D factory->create(device, QVariantList(= ) << deviceVariant << ret.outgoingInterfaces); if (!ret.plugin) { - kDebug(kdeconnect_kded()) << "Error loading plugin"; + kDebug(debugArea()) << "Error loading plugin"; return ret; } = - kDebug(kdeconnect_kded()) << "Loaded plugin:" << service->name(); + kDebug(debugArea()) << "Loaded plugin:" << service->name(); return ret; } = diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index a708ba1..3a8e9bc 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -15,7 +15,6 @@ set(libkdeconnect_SRC devicesmodel.cpp notificationsmodel.cpp modeltest.cpp - kdebugnamespace.cpp ) = set(libkdeconnect_public_HEADERS diff --git a/interfaces/kdebugnamespace.cpp b/interfaces/kdebugnamespace.cpp deleted file mode 100644 index 749e632..0000000 --- a/interfaces/kdebugnamespace.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "kdebugnamespace.h" - -int libkdeconnect() { - static int s_area =3D KDebug::registerArea("kdeconnect_libkdeconnect", tr= ue); - return s_area; -} - diff --git a/interfaces/kdebugnamespace.h b/interfaces/kdebugnamespace.h deleted file mode 100644 index 322c8ad..0000000 --- a/interfaces/kdebugnamespace.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KDEBUG_LIBKDECONNECT_H -#define KDEBUG_LIBKDECONNECT_H - -#include - -int libkdeconnect(); - -#endif - diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt index a1c1db4..0e30819 100644 --- a/kcm/CMakeLists.txt +++ b/kcm/CMakeLists.txt @@ -7,7 +7,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} set(kcm_SRCS kcm.cpp devicessortproxymodel.cpp - kdebugnamespace.cpp ) = kde4_add_ui_files(kcm_SRCS kcm.ui) diff --git a/kcm/devicessortproxymodel.cpp b/kcm/devicessortproxymodel.cpp index e17ec8b..929371d 100644 --- a/kcm/devicessortproxymodel.cpp +++ b/kcm/devicessortproxymodel.cpp @@ -20,10 +20,9 @@ = #include "devicessortproxymodel.h" = -#include "interfaces/dbusinterfaces.h" -#include "interfaces/devicesmodel.h" - -#include "kdebugnamespace.h" +#include +#include +#include = DevicesSortProxyModel::DevicesSortProxyModel(DevicesModel* devicesModel) : QSortFilterProxyModel(devicesModel) diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index f809a53..746c7c8 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -34,11 +34,12 @@ #include #include = +#include + #include "ui_kcm.h" #include "interfaces/dbusinterfaces.h" #include "interfaces/devicesmodel.h" #include "devicessortproxymodel.h" -#include "kdebugnamespace.h" = K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin();) K_EXPORT_PLUGIN(KdeConnectKcmFactory("kdeconnect-kcm", "kdeconnect-kcm")) diff --git a/kcm/kdebugnamespace.cpp b/kcm/kdebugnamespace.cpp deleted file mode 100644 index c38db0f..0000000 --- a/kcm/kdebugnamespace.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "kdebugnamespace.h" - -int kdeconnect_kcm() { - static int s_area =3D KDebug::registerArea("kdeconnect_kcm", true); - return s_area; -} diff --git a/kcm/kdebugnamespace.h b/kcm/kdebugnamespace.h deleted file mode 100644 index 47a7d43..0000000 --- a/kcm/kdebugnamespace.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KDEBUG_KDECONNECT_KCM_H -#define KDEBUG_KDECONNECT_KCM_H - -#include - -int kdeconnect_kcm(); - -#endif - diff --git a/kded/kded.cpp b/kded/kded.cpp index 8159124..2ec9062 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -27,8 +27,6 @@ = #include "core/kdebugnamespace.h" = -int theArea =3D KDebug::registerArea("kdeconnect-kded"); - K_PLUGIN_FACTORY(KdeConnectFactory, registerPlugin();) K_EXPORT_PLUGIN(KdeConnectFactory("kdeconnect", "kdeconnect-kded")) = @@ -37,13 +35,13 @@ Kded::Kded(QObject *parent, const QList&) , m_daemon(0) { QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); - kDebug(theArea) << "kded_kdeconnect started"; + kDebug(debugArea()) << "kded_kdeconnect started"; } = Kded::~Kded() { stop(); - kDebug(theArea) << "kded_kdeconnect stopped"; + kDebug(debugArea()) << "kded_kdeconnect stopped"; } = void Kded::start() @@ -53,7 +51,7 @@ void Kded::start() } = const QString daemon =3D KStandardDirs::locate("exe", "kdeconnectd"); - kDebug(theArea) << "Starting daemon " << daemon; + kDebug(debugArea()) << "Starting daemon " << daemon; m_daemon =3D new KProcess(this); connect(m_daemon, SIGNAL(started()), SLOT(daemonStarted())); connect(m_daemon, SIGNAL(error(QProcess::ProcessError)), this, SLOT(on= Error(QProcess::ProcessError))); @@ -85,24 +83,24 @@ void Kded::restart() = void Kded::onError(QProcess::ProcessError errorCode) { - kError(theArea) << "Process error code=3D" << errorCode; + kError(debugArea()) << "Process error code=3D" << errorCode; } = void Kded::daemonStarted() { - kDebug(theArea) << "Daemon successfuly started"; + kDebug(debugArea()) << "Daemon successfuly started"; Q_EMIT started(); } = void Kded::onFinished(int exitCode, QProcess::ExitStatus status) { if (status =3D=3D QProcess::CrashExit) { - kError(theArea) << "Process crashed with code=3D" << exitCode; - kError(theArea) << m_daemon->readAllStandardError(); - kWarning(theArea) << "Restarting in 5 sec..."; + kError(debugArea()) << "Process crashed with code=3D" << exitCode; + kError(debugArea()) << m_daemon->readAllStandardError(); + kWarning(debugArea()) << "Restarting in 5 sec..."; QTimer::singleShot(5000, this, SLOT(start())); = } else { - kWarning(theArea) << "Process finished with code=3D" << exitCode; + kWarning(debugArea()) << "Process finished with code=3D" << exitCo= de; } = Q_EMIT stopped(); @@ -116,5 +114,5 @@ void Kded::checkIfDaemonTerminated() } = m_daemon->kill(); - kWarning(theArea) << "Daemon killed"; + kWarning(debugArea()) << "Daemon killed"; } diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index f5a202a..b54bb1a 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -2,7 +2,7 @@ include_directories(${CMAKE_SOURCE_DIR}) = set(kio_kdeconnect_PART_SRCS kiokdeconnect.cpp - kdebugnamespace.cpp) +) = kde4_add_plugin(kio_kdeconnect ${kio_kdeconnect_PART_SRCS}) = diff --git a/kio/kdebugnamespace.cpp b/kio/kdebugnamespace.cpp deleted file mode 100644 index a8c13ae..0000000 --- a/kio/kdebugnamespace.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "kdebugnamespace.h" - -int kdeconnect_kio() { - static int s_area =3D KDebug::registerArea("kdeconnect_kio", true); - return s_area; -} diff --git a/kio/kdebugnamespace.h b/kio/kdebugnamespace.h deleted file mode 100644 index 9e536c0..0000000 --- a/kio/kdebugnamespace.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KDEBUG_KDECONNECT_KCM_H -#define KDEBUG_KDECONNECT_KCM_H - -#include - -int kdeconnect_kio(); - -#endif - diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index 6627126..3b8e84e 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -32,7 +32,7 @@ #include #include = -#include "kdebugnamespace.h" +#include = extern "C" int KDE_EXPORT kdemain(int argc, char **argv) { @@ -74,7 +74,7 @@ bool handleDBusError(QDBusReply& reply, KIO::SlaveBase= * slave) { if (!reply.isValid()) { - kDebug(kdeconnect_kio()) << "Error in DBus request:" << reply.erro= r(); + kDebug(debugArea()) << "Error in DBus request:" << reply.error(); slave->error(toKioError(reply.error().type()),reply.error().messag= e()); return true; } @@ -129,7 +129,7 @@ void KioKdeconnect::listDevice() { infoMessage(i18n("Accessing device...")); = - kDebug(kdeconnect_kio()) << "ListDevice" << m_currentDevice; + kDebug(debugArea()) << "ListDevice" << m_currentDevice; = SftpDbusInterface interface(m_currentDevice); = @@ -184,7 +184,7 @@ void KioKdeconnect::listDevice() = void KioKdeconnect::listDir(const KUrl &url) { - kDebug(kdeconnect_kio()) << "Listing..." << url; + kDebug(debugArea()) << "Listing..." << url; = /// Url is not used here becuase all we could care about the url is th= e host, and that's already /// handled in @p setHost @@ -206,7 +206,7 @@ void KioKdeconnect::listDir(const KUrl &url) = void KioKdeconnect::stat(const KUrl &url) { - kDebug(kdeconnect_kio()) << "Stat: " << url; + kDebug(debugArea()) << "Stat: " << url; = KIO::UDSEntry entry; entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); @@ -217,7 +217,7 @@ void KioKdeconnect::stat(const KUrl &url) = void KioKdeconnect::get(const KUrl &url) { - kDebug(kdeconnect_kio()) << "Get: " << url; + kDebug(debugArea()) << "Get: " << url; mimeType(""); finished(); } @@ -227,7 +227,7 @@ void KioKdeconnect::setHost(const QString &hostName, qu= int16 port, const QString = //This is called before everything else to set the file we want to show = - kDebug(kdeconnect_kio()) << "Setting host: " << hostName; + kDebug(debugArea()) << "Setting host: " << hostName; = // In this kio only the hostname is used Q_UNUSED(port) diff --git a/plugins/battery/batterydbusinterface.cpp b/plugins/battery/bat= terydbusinterface.cpp index ea550fb..b3b22dd 100644 --- a/plugins/battery/batterydbusinterface.cpp +++ b/plugins/battery/batterydbusinterface.cpp @@ -30,7 +30,7 @@ BatteryDbusInterface::BatteryDbusInterface(const Device *= device) = BatteryDbusInterface::~BatteryDbusInterface() { - kDebug(kdeconnect_kded()) << "Destroying BatteryDbusInterface"; + kDebug(debugArea()) << "Destroying BatteryDbusInterface"; } = void BatteryDbusInterface::updateValues(bool isCharging, int currentCharge) diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscon= trol/mpriscontrolplugin.cpp index f760020..dba821e 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp @@ -62,7 +62,7 @@ void MprisControlPlugin::serviceOwnerChanged(const QStrin= g &name, = if (name.startsWith("org.mpris.MediaPlayer2")) { = - kDebug(kdeconnect_kded()) << "Mpris (un)registered in bus" << name= << oldOwner << newOwner; + kDebug(debugArea()) << "Mpris (un)registered in bus" << name << ol= dOwner << newOwner; = if (oldOwner.isEmpty()) { addPlayer(name); @@ -78,7 +78,7 @@ void MprisControlPlugin::addPlayer(const QString& service) //FIXME: This call hangs and returns an empty string if KDED is still = starting! const QString identity =3D mprisInterface.property("Identity").toStrin= g(); playerList[identity] =3D service; - kDebug(kdeconnect_kded()) << "Mpris addPlayer" << service << "->" << i= dentity; + kDebug(debugArea()) << "Mpris addPlayer" << service << "->" << identit= y; sendPlayerList(); = OrgFreedesktopDBusPropertiesInterface* freedesktopInterface =3D new Or= gFreedesktopDBusPropertiesInterface(service, "/org/mpris/MediaPlayer2", QDB= usConnection::sessionBus(), this); @@ -132,7 +132,7 @@ void MprisControlPlugin::propertiesChanged(const QStrin= g& propertyInterface, con void MprisControlPlugin::removePlayer(const QString& ifaceName) { const QString identity =3D playerList.key(ifaceName); - kDebug(kdeconnect_kded()) << "Mpris removePlayer" << ifaceName << "->"= << identity; + kDebug(debugArea()) << "Mpris removePlayer" << ifaceName << "->" << id= entity; playerList.remove(identity); sendPlayerList(); } @@ -157,18 +157,18 @@ bool MprisControlPlugin::receivePackage (const Networ= kPackage& np) OrgMprisMediaPlayer2PlayerInterface mprisInterface(playerList[player],= "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus()); if (np.has("action")) { const QString& action =3D np.get("action"); - kDebug(kdeconnect_kded()) << "Calling action" << action << "in" <<= playerList[player]; + kDebug(debugArea()) << "Calling action" << action << "in" << playe= rList[player]; //TODO: Check for valid actions mprisInterface.call(action); } if (np.has("setVolume")) { double volume =3D np.get("setVolume")/100.f; - kDebug(kdeconnect_kded()) << "Setting volume" << volume << "to" <<= playerList[player]; + kDebug(debugArea()) << "Setting volume" << volume << "to" << playe= rList[player]; mprisInterface.setVolume(volume); } if (np.has("Seek")) { int offset =3D np.get("Seek"); - kDebug(kdeconnect_kded()) << "Seeking" << offset << "to" << player= List[player]; + kDebug(debugArea()) << "Seeking" << offset << "to" << playerList[p= layer]; mprisInterface.Seek(offset); } = @@ -185,20 +185,15 @@ bool MprisControlPlugin::receivePackage (const Networ= kPackage& np) = answer.set("nowPlaying",nowPlaying); = - - bool playing =3D (mprisInterface.playbackStatus() =3D=3D QLatin1St= ring("Playing")); answer.set("isPlaying", playing); = somethingToSend =3D true; - - } if (np.get("requestVolume")) { int volume =3D (int)(mprisInterface.volume() * 100); answer.set("volume",volume); somethingToSend =3D true; - } if (somethingToSend) { answer.set("player", player); @@ -206,7 +201,6 @@ bool MprisControlPlugin::receivePackage (const NetworkP= ackage& np) } = return true; - } = void MprisControlPlugin::sendPlayerList() diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins= /notifications/notificationsdbusinterface.cpp index 412640d..84a71a7 100644 --- a/plugins/notifications/notificationsdbusinterface.cpp +++ b/plugins/notifications/notificationsdbusinterface.cpp @@ -111,10 +111,10 @@ void NotificationsDbusInterface::addNotification(Noti= fication* noti) = void NotificationsDbusInterface::removeNotification(const QString& interna= lId) { - kDebug(kdeconnect_kded()) << "removeNotification" << internalId; + kDebug(debugArea()) << "removeNotification" << internalId; = if (!mInternalIdToPublicId.contains(internalId)) { - kDebug(kdeconnect_kded()) << "Not found"; + kDebug(debugArea()) << "Not found"; return; } = @@ -122,7 +122,7 @@ void NotificationsDbusInterface::removeNotification(con= st QString& internalId) = Notification* noti =3D mNotifications.take(publicId); if (!noti) { - kDebug(kdeconnect_kded()) << "Not found"; + kDebug(debugArea()) << "Not found"; return; } = diff --git a/plugins/ping/pingplugin.cpp b/plugins/ping/pingplugin.cpp index 5d5575c..b0616e1 100644 --- a/plugins/ping/pingplugin.cpp +++ b/plugins/ping/pingplugin.cpp @@ -34,12 +34,12 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_pi= ng", "kdeconnect-plugins" PingPlugin::PingPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { - //kDebug(kdeconnect_kded()) << "Ping plugin constructor for device" <<= device()->name(); + //kDebug(debugArea()) << "Ping plugin constructor for device" << devic= e()->name(); } = PingPlugin::~PingPlugin() { - //kDebug(kdeconnect_kded()) << "Ping plugin destructor for device" << = device()->name(); + //kDebug(debugArea()) << "Ping plugin destructor for device" << device= ()->name(); } = bool PingPlugin::receivePackage(const NetworkPackage& np) @@ -59,7 +59,7 @@ void PingPlugin::sendPing() { NetworkPackage np(PACKAGE_TYPE_PING); bool success =3D sendPackage(np); - kDebug(kdeconnect_kded()) << "sendPing:" << success; + kDebug(debugArea()) << "sendPing:" << success; } = void PingPlugin::connected() diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp index de28e12..5947c24 100644 --- a/plugins/sftp/mounter.cpp +++ b/plugins/sftp/mounter.cpp @@ -59,13 +59,13 @@ Mounter::Mounter(SftpPlugin* sftp, int idleTimeout) m_idleTimer.setSingleShot(false); = QTimer::singleShot(0, this, SLOT(start())); - kDebug(kdeconnect_kded()) << "Created"; + kDebug(debugArea()) << "Created"; } = Mounter::~Mounter() { unmount(); - kDebug(kdeconnect_kded()) << "Destroyed"; + kDebug(debugArea()) << "Destroyed"; } = bool Mounter::wait() @@ -75,7 +75,7 @@ bool Mounter::wait() return true; } = - kDebug(kdeconnect_kded()) << "Starting loop to wait for mount"; + kDebug(debugArea()) << "Starting loop to wait for mount"; = MountLoop loop; connect(this, SIGNAL(mounted()), &loop, SLOT(successed())); @@ -87,7 +87,7 @@ void Mounter::onPakcageReceived(const NetworkPackage& np) { if (np.get("stop", false)) { - kDebug(kdeconnect_kded()) << "SFTP server stopped"; + kDebug(debugArea()) << "SFTP server stopped"; unmount(); return; } @@ -142,13 +142,13 @@ void Mounter::onPakcageReceived(const NetworkPackage&= np) = cleanMountPoint(); = - kDebug(kdeconnect_kded()) << "Staring process: " << m_proc->program().= join(" "); + kDebug(debugArea()) << "Staring process: " << m_proc->program().join("= "); m_proc->start(); } = void Mounter::onStarted() { - kDebug(kdeconnect_kded()) << "Porcess started"; + kDebug(debugArea()) << "Porcess started"; m_started =3D true; Q_EMIT mounted(); = @@ -167,7 +167,7 @@ void Mounter::onError(QProcess::ProcessError error) { if (error =3D=3D QProcess::FailedToStart) { - kDebug(kdeconnect_kded()) << "Porcess failed to start"; + kDebug(debugArea()) << "Porcess failed to start"; m_started =3D false; Q_EMIT failed(i18n("Failed to start sshfs")); } @@ -177,7 +177,7 @@ void Mounter::onFinished(int exitCode, QProcess::ExitSt= atus exitStatus) { if (exitStatus =3D=3D QProcess::NormalExit) { - kDebug(kdeconnect_kded()) << "Process finished (exit code: " << ex= itCode << ")"; + kDebug(debugArea()) << "Process finished (exit code: " << exitCode= << ")"; = if (m_proc->property(idleTimeout_c).toBool()) { @@ -190,7 +190,7 @@ void Mounter::onFinished(int exitCode, QProcess::ExitSt= atus exitStatus) } else { - kDebug(kdeconnect_kded()) << "Porcess failed (exit code: " << exit= Code << ")"; + kDebug(debugArea()) << "Porcess failed (exit code: " << exitCode <= < ")"; Q_EMIT failed(i18n("Error when accessing to filesystem")); } = @@ -201,7 +201,7 @@ void Mounter::onFinished(int exitCode, QProcess::ExitSt= atus exitStatus) = void Mounter::onMountTimeout() { - kDebug(kdeconnect_kded()) << "Timeout: device not responding"; + kDebug(debugArea()) << "Timeout: device not responding"; Q_EMIT failed(i18n("Failed to mount filesystem: device not responding"= )); } = @@ -211,7 +211,7 @@ void Mounter::onIdleTimeout() = if (m_lastActivity.secsTo(QDateTime::currentDateTime()) >=3D m_idleTim= er.interval() / 1000) { - kDebug(kdeconnect_kded()) << "Timeout: there is no activity on mou= tned filesystem"; = + kDebug(debugArea()) << "Timeout: there is no activity on moutned f= ilesystem"; m_proc->setProperty(idleTimeout_c, true); unmount(); } diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index 1a04dc0..e4e4cdf 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -56,7 +56,7 @@ SftpPlugin::SftpPlugin(QObject *parent, const QVariantLis= t &args) , m_d(new Pimpl) { = addToDolphin(); - kDebug(kdeconnect_kded()) << "Created device:" << device()->name(); + kDebug(debugArea()) << "Created device:" << device()->name(); } = SftpPlugin::~SftpPlugin() @@ -64,7 +64,7 @@ SftpPlugin::~SftpPlugin() QDBusConnection::sessionBus().unregisterObject(dbusPath(), QDBusConnec= tion::UnregisterTree); removeFromDolphin(); = unmount(); - kDebug(kdeconnect_kded()) << "Destroyed device:" << device()->name(); + kDebug(debugArea()) << "Destroyed device:" << device()->name(); } = void SftpPlugin::addToDolphin() @@ -72,7 +72,7 @@ void SftpPlugin::addToDolphin() removeFromDolphin(); KUrl kioUrl("kdeconnect://"+device()->id()+"/"); m_d->placesModel.addPlace(device()->name(), kioUrl, "kdeconnect"); - kDebug(kdeconnect_kded()) << "add to dolphin"; + kDebug(debugArea()) << "add to dolphin"; } = void SftpPlugin::removeFromDolphin() @@ -88,12 +88,12 @@ void SftpPlugin::removeFromDolphin() void SftpPlugin::connected() { bool state =3D QDBusConnection::sessionBus().registerObject(dbusPath()= , this, QDBusConnection::ExportScriptableContents); - kDebug(kdeconnect_kded()) << "Exposing DBUS interface: " << state; + kDebug(debugArea()) << "Exposing DBUS interface: " << state; } = void SftpPlugin::mount() { - kDebug(kdeconnect_kded()) << "Mount device:" << device()->name(); + kDebug(debugArea()) << "Mount device:" << device()->name(); if (m_d->mounter) { return; } @@ -160,7 +160,7 @@ QString SftpPlugin::mountPoint() = void SftpPlugin::onMounted() { - kDebug(kdeconnect_kded()) << device()->name() << QString("Remote files= ystem mounted at %1").arg(mountPoint()); + kDebug(debugArea()) << device()->name() << QString("Remote filesystem = mounted at %1").arg(mountPoint()); = Q_EMIT mounted(); } @@ -168,9 +168,9 @@ void SftpPlugin::onMounted() void SftpPlugin::onUnmounted(bool idleTimeout) { if (idleTimeout) { - kDebug(kdeconnect_kded()) << device()->name() << "Remote filesyste= m unmounted by idle timeout"; + kDebug(debugArea()) << device()->name() << "Remote filesystem unmo= unted by idle timeout"; } else { - kDebug(kdeconnect_kded()) << device()->name() << "Remote filesyste= m unmounted"; + kDebug(debugArea()) << device()->name() << "Remote filesystem unmo= unted"; } = unmount(); diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp index 7e4e083..214eecf 100644 --- a/plugins/share/shareplugin.cpp +++ b/plugins/share/shareplugin.cpp @@ -55,7 +55,7 @@ KUrl SharePlugin::destinationDir() const QString url =3D dir.toLocalFile(); if (url.contains("%1")) url =3D url.arg(device()->name()); = - kDebug(kdeconnect_kded()) << url; + kDebug(debugArea()) << url; QDir().mkpath(url); = return url; @@ -67,7 +67,7 @@ bool SharePlugin::receivePackage(const NetworkPackage& np) //TODO: Use this code to write a test if (np.type() =3D=3D PACKAGE_TYPE_PING) { = - kDebug(kdeconnect_kded()) << "sending file" << (QDesktopServices::= storageLocation(QDesktopServices::HomeLocation) + "/.bashrc"); + kDebug(debugArea()) << "sending file" << (QDesktopServices::storag= eLocation(QDesktopServices::HomeLocation) + "/.bashrc"); = NetworkPackage out(PACKAGE_TYPE_SHARE); out.set("filename", mDestinationDir + "itworks.txt"); @@ -83,10 +83,10 @@ bool SharePlugin::receivePackage(const NetworkPackage& = np) } */ = - kDebug(kdeconnect_kded()) << "File transfer"; + kDebug(debugArea()) << "File transfer"; = if (np.hasPayload()) { - //kDebug(kdeconnect_kded()) << "receiving file"; + //kDebug(debugArea()) << "receiving file"; QString filename =3D np.get("filename", QString::number(Q= DateTime::currentMSecsSinceEpoch())); KUrl destination =3D destinationDir(); destination.addPath(filename); @@ -115,7 +115,7 @@ bool SharePlugin::receivePackage(const NetworkPackage& = np) QUrl url(np.get("url")); QDesktopServices::openUrl(url); } else { - kDebug(kdeconnect_kded()) << "Error: Nothing attached!"; + kDebug(debugArea()) << "Error: Nothing attached!"; } = return true; @@ -124,7 +124,7 @@ bool SharePlugin::receivePackage(const NetworkPackage& = np) = void SharePlugin::finished(KJob* job) { - kDebug(kdeconnect_kded()) << "File transfer finished"; + kDebug(debugArea()) << "File transfer finished"; = bool error =3D (job->error() !=3D 0); = diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/tele= phonyplugin.cpp index e547ca9..b708a98 100644 --- a/plugins/telephony/telephonyplugin.cpp +++ b/plugins/telephony/telephonyplugin.cpp @@ -66,7 +66,7 @@ KNotification* TelephonyPlugin::createNotification(const = NetworkPackage& np) content =3D i18n("Unknown telephony event: %2", event); } = - kDebug(kdeconnect_kded()) << "Creating notification with type:" << typ= e; + kDebug(debugArea()) << "Creating notification with type:" << type; = KNotification* notification =3D new KNotification(type, KNotification:= :CloseOnTimeout, this); //, KNotification::Persistent notification->setPixmap(KIcon(icon).pixmap(48, 48));