diff --git a/app/main.cpp b/app/main.cpp --- a/app/main.cpp +++ b/app/main.cpp @@ -23,7 +23,7 @@ #include #include -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { QApplication app(argc, argv); KAboutData aboutData(QStringLiteral("kdeconnect.app"), i18n("KDE Connect App"), QStringLiteral("1.0"), i18n("KDE Connect App"), KAboutLicense::GPL, i18n("(c) 2015, Aleix Pol Gonzalez")); diff --git a/app/org.kde.kdeconnect.app.desktop b/app/org.kde.kdeconnect.app.desktop --- a/app/org.kde.kdeconnect.app.desktop +++ b/app/org.kde.kdeconnect.app.desktop @@ -11,7 +11,6 @@ Name[en_GB]=KDE Connect Application Name[es]=Aplicación KDE Connect Name[et]=KDE Connecti rakendus -Name[eu]=KDE Connect aplikazioa Name[fi]=KDE Connect -sovellus Name[fr]=Application KDE Connect Name[gl]=Aplicativo de KDE Connect @@ -48,7 +47,6 @@ GenericName[en_GB]=Device Synchronisation GenericName[es]=Sincronización de dispositivos GenericName[et]=Seadmete sünkroonimine -GenericName[eu]=Galuak sinkronizatzea GenericName[fi]=Laitteiden synkronointi GenericName[fr]=Synchronisation de périphériques GenericName[gl]=Sincronización de dispositivos @@ -86,7 +84,6 @@ Comment[en_GB]=Make all your devices one Comment[es]=Convertir todos sus dispositivos en uno Comment[et]=Kõigi seadmete ühendamine -Comment[eu]=Bat egin zure gailu guztiak Comment[fi]=Yhdistä kaikki laitteesi toisiinsa Comment[fr]=Unifiez vos périphériques Comment[gl]=Unifique os seus dispositivos. diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -152,7 +152,7 @@ QTextStream(stderr) << i18n("waiting for device...") << endl; blockOnReply(iface.acquireDiscoveryMode(id)); - QObject::connect(&iface, &DaemonDbusInterface::deviceAdded, [&](const QString &deviceAddedId) { + QObject::connect(&iface, &DaemonDbusInterface::deviceAdded, [&](const QString& deviceAddedId) { if (device == deviceAddedId) { wait.quit(); } diff --git a/core/backends/bluetooth/bluetoothdownloadjob.h b/core/backends/bluetooth/bluetoothdownloadjob.h --- a/core/backends/bluetooth/bluetoothdownloadjob.h +++ b/core/backends/bluetooth/bluetoothdownloadjob.h @@ -34,7 +34,7 @@ { Q_OBJECT public: - explicit BluetoothDownloadJob(const QBluetoothAddress &remoteAddress, const QVariantMap &transferInfo, QObject* parent = 0); + explicit BluetoothDownloadJob(const QBluetoothAddress& remoteAddress, const QVariantMap& transferInfo, QObject* parent = 0); QSharedPointer payload() const; void start(); diff --git a/core/backends/bluetooth/bluetoothdownloadjob.cpp b/core/backends/bluetooth/bluetoothdownloadjob.cpp --- a/core/backends/bluetooth/bluetoothdownloadjob.cpp +++ b/core/backends/bluetooth/bluetoothdownloadjob.cpp @@ -20,7 +20,7 @@ #include "bluetoothdownloadjob.h" -BluetoothDownloadJob::BluetoothDownloadJob(const QBluetoothAddress &remoteAddress, const QVariantMap &transferInfo, QObject *parent) +BluetoothDownloadJob::BluetoothDownloadJob(const QBluetoothAddress& remoteAddress, const QVariantMap& transferInfo, QObject* parent) : QObject(parent) , mRemoteAddress(remoteAddress) , mTransferUuid(QBluetoothUuid(transferInfo.value("uuid").toString())) diff --git a/core/backends/bluetooth/bluetoothuploadjob.h b/core/backends/bluetooth/bluetoothuploadjob.h --- a/core/backends/bluetooth/bluetoothuploadjob.h +++ b/core/backends/bluetooth/bluetoothuploadjob.h @@ -34,7 +34,7 @@ { Q_OBJECT public: - explicit BluetoothUploadJob(const QSharedPointer &data, const QBluetoothAddress &remoteAddress, QObject* parent = 0); + explicit BluetoothUploadJob(const QSharedPointer& data, const QBluetoothAddress& remoteAddress, QObject* parent = 0); QVariantMap transferInfo() const; void start(); diff --git a/core/backends/bluetooth/bluetoothuploadjob.cpp b/core/backends/bluetooth/bluetoothuploadjob.cpp --- a/core/backends/bluetooth/bluetoothuploadjob.cpp +++ b/core/backends/bluetooth/bluetoothuploadjob.cpp @@ -24,7 +24,7 @@ #include "core_debug.h" #include -BluetoothUploadJob::BluetoothUploadJob(const QSharedPointer &data, const QBluetoothAddress &remoteAddress, QObject *parent) +BluetoothUploadJob::BluetoothUploadJob(const QSharedPointer& data, const QBluetoothAddress& remoteAddress, QObject* parent) : QObject(parent) , mData(data) , mRemoteAddress(remoteAddress) diff --git a/core/backends/devicelinereader.h b/core/backends/devicelinereader.h --- a/core/backends/devicelinereader.h +++ b/core/backends/devicelinereader.h @@ -39,9 +39,9 @@ public: DeviceLineReader(QIODevice* device, QObject* parent = 0); - QByteArray readLine() { return mPackages.dequeue(); } - qint64 write(const QByteArray& data) { return mDevice->write(data); } - qint64 bytesAvailable() const { return mPackages.size(); } + QByteArray readLine() { return m_packages.dequeue(); } + qint64 write(const QByteArray& data) { return m_device->write(data); } + qint64 bytesAvailable() const { return m_packages.size(); } Q_SIGNALS: void readyRead(); @@ -51,9 +51,9 @@ void dataReceived(); private: - QByteArray lastChunk; - QIODevice* mDevice; - QQueue mPackages; + QByteArray m_lastChunk; + QIODevice* m_device; + QQueue m_packages; }; diff --git a/core/backends/devicelinereader.cpp b/core/backends/devicelinereader.cpp --- a/core/backends/devicelinereader.cpp +++ b/core/backends/devicelinereader.cpp @@ -23,33 +23,33 @@ DeviceLineReader::DeviceLineReader(QIODevice* device, QObject* parent) : QObject(parent) - , mDevice(device) + , m_device(device) { - connect(mDevice, SIGNAL(readyRead()), + connect(m_device, SIGNAL(readyRead()), this, SLOT(dataReceived())); - connect(mDevice, SIGNAL(disconnected()), + connect(m_device, SIGNAL(disconnected()), this, SIGNAL(disconnected())); } void DeviceLineReader::dataReceived() { - while(mDevice->canReadLine()) { - const QByteArray line = mDevice->readLine(); + while(m_device->canReadLine()) { + const QByteArray line = m_device->readLine(); if (line.length() > 1) { - mPackages.enqueue(line);//we don't want single \n + m_packages.enqueue(line);//we don't want single \n } } //If we still have things to read from the device, call dataReceived again //We do this manually because we do not trust readyRead to be emitted again //So we call this method again just in case. - if (mDevice->bytesAvailable() > 0) { + if (m_device->bytesAvailable() > 0) { QMetaObject::invokeMethod(this, "dataReceived", Qt::QueuedConnection); return; } //If we have any packages, tell it to the world. - if (!mPackages.isEmpty()) { + if (!m_packages.isEmpty()) { Q_EMIT readyRead(); } } diff --git a/core/backends/devicelink.h b/core/backends/devicelink.h --- a/core/backends/devicelink.h +++ b/core/backends/devicelink.h @@ -44,8 +44,8 @@ virtual QString name() = 0; - const QString& deviceId() const { return mDeviceId; } - LinkProvider* provider() { return mLinkProvider; } + const QString& deviceId() const { return m_deviceId; } + LinkProvider* provider() { return m_linkProvider; } virtual bool sendPackage(NetworkPackage& np) = 0; @@ -53,7 +53,7 @@ virtual void userRequestsPair() = 0; virtual void userRequestsUnpair() = 0; - PairStatus pairStatus() const { return mPairStatus; } + PairStatus pairStatus() const { return m_pairStatus; } virtual void setPairStatus(PairStatus status); //The daemon will periodically destroy unpaired links if this returns false @@ -63,16 +63,16 @@ void pairingRequest(PairingHandler* handler); void pairingRequestExpired(PairingHandler* handler); void pairStatusChanged(DeviceLink::PairStatus status); - void pairingError(const QString &error); + void pairingError(const QString& error); void receivedPackage(const NetworkPackage& np); protected: - QCA::PrivateKey mPrivateKey; + QCA::PrivateKey m_privateKey; private: - const QString mDeviceId; - LinkProvider* mLinkProvider; - PairStatus mPairStatus; + const QString m_deviceId; + LinkProvider* m_linkProvider; + PairStatus m_pairStatus; }; diff --git a/core/backends/devicelink.cpp b/core/backends/devicelink.cpp --- a/core/backends/devicelink.cpp +++ b/core/backends/devicelink.cpp @@ -24,10 +24,10 @@ DeviceLink::DeviceLink(const QString& deviceId, LinkProvider* parent) : QObject(parent) - , mPrivateKey(KdeConnectConfig::instance()->privateKey()) - , mDeviceId(deviceId) - , mLinkProvider(parent) - , mPairStatus(NotPaired) + , m_privateKey(KdeConnectConfig::instance()->privateKey()) + , m_deviceId(deviceId) + , m_linkProvider(parent) + , m_pairStatus(NotPaired) { Q_ASSERT(!deviceId.isEmpty()); @@ -36,8 +36,8 @@ void DeviceLink::setPairStatus(DeviceLink::PairStatus status) { - if (mPairStatus != status) { - mPairStatus = status; + if (m_pairStatus != status) { + m_pairStatus = status; Q_EMIT pairStatusChanged(status); } } diff --git a/core/backends/lan/downloadjob.h b/core/backends/lan/downloadjob.h --- a/core/backends/lan/downloadjob.h +++ b/core/backends/lan/downloadjob.h @@ -38,16 +38,16 @@ { Q_OBJECT public: - DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo); + DownloadJob(const QHostAddress& address, const QVariantMap& transferInfo); ~DownloadJob() override; void start() override; QSharedPointer getPayload(); private: - QHostAddress mAddress; - qint16 mPort; - QSharedPointer mSocket; - QSharedPointer mBuffer; + QHostAddress m_address; + qint16 m_port; + QSharedPointer m_socket; + QSharedPointer m_buffer; private Q_SLOTS: void socketFailed(QAbstractSocket::SocketError error); diff --git a/core/backends/lan/downloadjob.cpp b/core/backends/lan/downloadjob.cpp --- a/core/backends/lan/downloadjob.cpp +++ b/core/backends/lan/downloadjob.cpp @@ -31,16 +31,16 @@ #include "lanlinkprovider.h" #include "core/core_debug.h" -DownloadJob::DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo) +DownloadJob::DownloadJob(const QHostAddress& address, const QVariantMap& transferInfo) : KJob() - , mAddress(address) - , mPort(transferInfo[QStringLiteral("port")].toInt()) - , mSocket(new QSslSocket) - , mBuffer(new QBuffer) + , m_address(address) + , m_port(transferInfo[QStringLiteral("port")].toInt()) + , m_socket(new QSslSocket) + , m_buffer(new QBuffer) { - LanLinkProvider::configureSslSocket(mSocket.data(), transferInfo.value(QStringLiteral("deviceId")).toString(), true); + LanLinkProvider::configureSslSocket(m_socket.data(), transferInfo.value(QStringLiteral("deviceId")).toString(), true); - connect(mSocket.data(), SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketFailed(QAbstractSocket::SocketError))); + connect(m_socket.data(), SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketFailed(QAbstractSocket::SocketError))); // connect(mSocket.data(), &QAbstractSocket::stateChanged, [](QAbstractSocket::SocketState state){ qDebug() << "statechange" << state; }); } @@ -53,27 +53,27 @@ { //TODO: Timeout? // Cannot use read only, might be due to ssl handshake, getting QIODevice::ReadOnly error and no connection - mSocket->connectToHostEncrypted(mAddress.toString(), mPort, QIODevice::ReadWrite); + m_socket->connectToHostEncrypted(m_address.toString(), m_port, QIODevice::ReadWrite); - bool b = mBuffer->open(QBuffer::ReadWrite); + bool b = m_buffer->open(QBuffer::ReadWrite); Q_ASSERT(b); } void DownloadJob::socketFailed(QAbstractSocket::SocketError error) { if (error != QAbstractSocket::RemoteHostClosedError) { //remote host closes when finishes - qWarning(KDECONNECT_CORE) << "error..." << mSocket->errorString(); + qWarning(KDECONNECT_CORE) << "error..." << m_socket->errorString(); setError(error + 1); - setErrorText(mSocket->errorString()); + setErrorText(m_socket->errorString()); } else { - auto ba = mSocket->readAll(); - mBuffer->write(ba); - mBuffer->seek(0); + auto ba = m_socket->readAll(); + m_buffer->write(ba); + m_buffer->seek(0); } emitResult(); } QSharedPointer DownloadJob::getPayload() { - return mBuffer.staticCast(); + return m_buffer.staticCast(); } diff --git a/core/backends/lan/landevicelink.h b/core/backends/lan/landevicelink.h --- a/core/backends/lan/landevicelink.h +++ b/core/backends/lan/landevicelink.h @@ -60,9 +60,9 @@ void dataReceived(); private: - SocketLineReader* mSocketLineReader; - ConnectionStarted mConnectionSource; - QHostAddress mHostAddress; + SocketLineReader* m_socketLineReader; + ConnectionStarted m_connectionSource; + QHostAddress m_hostAddress; }; #endif diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -31,30 +31,30 @@ LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSslSocket* socket, ConnectionStarted connectionSource) : DeviceLink(deviceId, parent) - , mSocketLineReader(nullptr) + , m_socketLineReader(nullptr) { reset(socket, connectionSource); } void LanDeviceLink::reset(QSslSocket* socket, ConnectionStarted connectionSource) { - if (mSocketLineReader) { - disconnect(mSocketLineReader->mSocket, &QAbstractSocket::disconnected, this, &QObject::deleteLater); - delete mSocketLineReader; + if (m_socketLineReader) { + disconnect(m_socketLineReader->m_socket, &QAbstractSocket::disconnected, this, &QObject::deleteLater); + delete m_socketLineReader; } - mSocketLineReader = new SocketLineReader(socket, this); + m_socketLineReader = new SocketLineReader(socket, this); connect(socket, &QAbstractSocket::disconnected, this, &QObject::deleteLater); - connect(mSocketLineReader, &SocketLineReader::readyRead, this, &LanDeviceLink::dataReceived); + connect(m_socketLineReader, &SocketLineReader::readyRead, this, &LanDeviceLink::dataReceived); //We take ownership of the socket. //When the link provider destroys us, //the socket (and the reader) will be //destroyed as well - socket->setParent(mSocketLineReader); + socket->setParent(m_socketLineReader); - mConnectionSource = connectionSource; + m_connectionSource = connectionSource; QString certString = KdeConnectConfig::instance()->getDeviceProperty(deviceId(), QStringLiteral("certificate")); DeviceLink::setPairStatus(certString.isEmpty()? PairStatus::NotPaired : PairStatus::Paired); @@ -62,10 +62,10 @@ QHostAddress LanDeviceLink::hostAddress() const { - if (!mSocketLineReader) { + if (!m_socketLineReader) { return QHostAddress::Null; } - QHostAddress addr = mSocketLineReader->mSocket->peerAddress(); + QHostAddress addr = m_socketLineReader->m_socket->peerAddress(); if (addr.protocol() == QAbstractSocket::IPv6Protocol) { bool success; QHostAddress convertedAddr = QHostAddress(addr.toIPv4Address(&success)); @@ -88,7 +88,7 @@ np.setPayloadTransferInfo(sendPayload(np)->transferInfo()); } - int written = mSocketLineReader->write(np.serialize()); + int written = m_socketLineReader->write(np.serialize()); //Actually we can't detect if a package is received or not. We keep TCP //"ESTABLISHED" connections that look legit (return true when we use them), @@ -105,9 +105,9 @@ void LanDeviceLink::dataReceived() { - if (mSocketLineReader->bytesAvailable() == 0) return; + if (m_socketLineReader->bytesAvailable() == 0) return; - const QByteArray serializedPackage = mSocketLineReader->readLine(); + const QByteArray serializedPackage = m_socketLineReader->readLine(); NetworkPackage package(QString::null); NetworkPackage::unserialize(serializedPackage, &package); @@ -125,14 +125,14 @@ //FIXME: The next two lines shouldn't be needed! Why are they here? transferInfo.insert(QStringLiteral("useSsl"), true); transferInfo.insert(QStringLiteral("deviceId"), deviceId()); - DownloadJob* job = new DownloadJob(mSocketLineReader->peerAddress(), transferInfo); + DownloadJob* job = new DownloadJob(m_socketLineReader->peerAddress(), transferInfo); job->start(); package.setPayload(job->getPayload(), package.payloadSize()); } Q_EMIT receivedPackage(package); - if (mSocketLineReader->bytesAvailable() > 0) { + if (m_socketLineReader->bytesAvailable() > 0) { QMetaObject::invokeMethod(this, "dataReceived", Qt::QueuedConnection); } @@ -140,7 +140,7 @@ void LanDeviceLink::userRequestsPair() { - if (mSocketLineReader->peerCertificate().isNull()) { + if (m_socketLineReader->peerCertificate().isNull()) { Q_EMIT pairingError(i18n("This device cannot be paired because it is running an old version of KDE Connect.")); } else { qobject_cast(provider())->userRequestsPair(deviceId()); @@ -154,7 +154,7 @@ void LanDeviceLink::setPairStatus(PairStatus status) { - if (status == Paired && mSocketLineReader->peerCertificate().isNull()) { + if (status == Paired && m_socketLineReader->peerCertificate().isNull()) { Q_EMIT pairingError(i18n("This device cannot be paired because it is running an old version of KDE Connect.")); return; } @@ -162,8 +162,8 @@ DeviceLink::setPairStatus(status); if (status == Paired) { Q_ASSERT(KdeConnectConfig::instance()->trustedDevices().contains(deviceId())); - Q_ASSERT(!mSocketLineReader->peerCertificate().isNull()); - KdeConnectConfig::instance()->setDeviceProperty(deviceId(), QStringLiteral("certificate"), mSocketLineReader->peerCertificate().toPem()); + Q_ASSERT(!m_socketLineReader->peerCertificate().isNull()); + KdeConnectConfig::instance()->setDeviceProperty(deviceId(), QStringLiteral("certificate"), m_socketLineReader->peerCertificate().toPem()); } } diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -47,8 +47,8 @@ QString name() override { return QStringLiteral("LanLinkProvider"); } int priority() override { return PRIORITY_HIGH; } - void userRequestsPair(const QString &deviceId); - void userRequestsUnpair(const QString &deviceId); + void userRequestsPair(const QString& deviceId); + void userRequestsUnpair(const QString& deviceId); void incomingPairPackage(DeviceLink* device, const NetworkPackage& np); static void configureSslSocket(QSslSocket* socket, const QString& deviceId, bool isDeviceTrusted); @@ -77,24 +77,24 @@ private: LanPairingHandler* createPairingHandler(DeviceLink* link); - void onNetworkConfigurationChanged(const QNetworkConfiguration &config); + void onNetworkConfigurationChanged(const QNetworkConfiguration& config); void addLink(const QString& deviceId, QSslSocket* socket, NetworkPackage* receivedPackage, LanDeviceLink::ConnectionStarted connectionOrigin); - Server* mServer; - QUdpSocket mUdpSocket; - quint16 mTcpPort; + Server* m_server; + QUdpSocket m_udpSocket; + quint16 m_tcpPort; - QMap mLinks; - QMap mPairingHandlers; + QMap m_links; + QMap m_pairingHandlers; struct PendingConnect { NetworkPackage* np; QHostAddress sender; }; - QMap receivedIdentityPackages; + QMap m_receivedIdentityPackages; QNetworkConfiguration m_lastConfig; - const bool mTestMode; - QTimer combineBroadcastsTimer; + const bool m_testMode; + QTimer m_combineBroadcastsTimer; }; #endif diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -45,21 +45,21 @@ #define MIN_VERSION_WITH_SSL_SUPPORT 6 LanLinkProvider::LanLinkProvider(bool testMode) - : mTestMode(testMode) + : m_testMode(testMode) { - mTcpPort = 0; + m_tcpPort = 0; - combineBroadcastsTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough - combineBroadcastsTimer.setSingleShot(true); - connect(&combineBroadcastsTimer, &QTimer::timeout, this, &LanLinkProvider::broadcastToNetwork); + m_combineBroadcastsTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough + m_combineBroadcastsTimer.setSingleShot(true); + connect(&m_combineBroadcastsTimer, &QTimer::timeout, this, &LanLinkProvider::broadcastToNetwork); - connect(&mUdpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection); + connect(&m_udpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection); - mServer = new Server(this); - mServer->setProxy(QNetworkProxy::NoProxy); - connect(mServer,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection); + m_server = new Server(this); + m_server->setProxy(QNetworkProxy::NoProxy); + connect(m_server,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection); - mUdpSocket.setProxy(QNetworkProxy::NoProxy); + m_udpSocket.setProxy(QNetworkProxy::NoProxy); //Detect when a network interface changes status, so we announce ourelves in the new network QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this); @@ -67,7 +67,7 @@ } -void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config) +void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration& config) { if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) { m_lastConfig = config; @@ -81,19 +81,19 @@ void LanLinkProvider::onStart() { - const QHostAddress bindAddress = mTestMode? QHostAddress::LocalHost : QHostAddress::Any; + const QHostAddress bindAddress = m_testMode? QHostAddress::LocalHost : QHostAddress::Any; - bool success = mUdpSocket.bind(bindAddress, UDP_PORT, QUdpSocket::ShareAddress); + bool success = m_udpSocket.bind(bindAddress, UDP_PORT, QUdpSocket::ShareAddress); Q_ASSERT(success); qCDebug(KDECONNECT_CORE) << "onStart"; - mTcpPort = MIN_TCP_PORT; - while (!mServer->listen(bindAddress, mTcpPort)) { - mTcpPort++; - if (mTcpPort > MAX_TCP_PORT) { //No ports available? + m_tcpPort = MIN_TCP_PORT; + while (!m_server->listen(bindAddress, m_tcpPort)) { + m_tcpPort++; + if (m_tcpPort > MAX_TCP_PORT) { //No ports available? qCritical(KDECONNECT_CORE) << "Error opening a port in range" << MIN_TCP_PORT << "-" << MAX_TCP_PORT; - mTcpPort = 0; + m_tcpPort = 0; return; } } @@ -104,47 +104,47 @@ void LanLinkProvider::onStop() { qCDebug(KDECONNECT_CORE) << "onStop"; - mUdpSocket.close(); - mServer->close(); + m_udpSocket.close(); + m_server->close(); } void LanLinkProvider::onNetworkChange() { - if (combineBroadcastsTimer.isActive()) { + if (m_combineBroadcastsTimer.isActive()) { qCDebug(KDECONNECT_CORE()) << "Preventing duplicate broadcasts"; return; } - combineBroadcastsTimer.start(); + m_combineBroadcastsTimer.start(); } //I'm in a new network, let's be polite and introduce myself void LanLinkProvider::broadcastToNetwork() { - if (!mServer->isListening()) { + if (!m_server->isListening()) { //Not started return; } - Q_ASSERT(mTcpPort != 0); + Q_ASSERT(m_tcpPort != 0); qCDebug(KDECONNECT_CORE()) << "Broadcasting identity packet"; - QHostAddress destAddress = mTestMode? QHostAddress::LocalHost : QHostAddress(QStringLiteral("255.255.255.255")); + QHostAddress destAddress = m_testMode? QHostAddress::LocalHost : QHostAddress(QStringLiteral("255.255.255.255")); NetworkPackage np(QLatin1String("")); NetworkPackage::createIdentityPackage(&np); - np.set(QStringLiteral("tcpPort"), mTcpPort); + np.set(QStringLiteral("tcpPort"), m_tcpPort); #ifdef Q_OS_WIN //On Windows we need to broadcast from every local IP address to reach all networks QUdpSocket sendSocket; sendSocket.setProxy(QNetworkProxy::NoProxy); - for (const QNetworkInterface &iface : QNetworkInterface::allInterfaces()) { + for (const QNetworkInterface& iface : QNetworkInterface::allInterfaces()) { if ( (iface.flags() & QNetworkInterface::IsUp) && (iface.flags() & QNetworkInterface::IsRunning) && (iface.flags() & QNetworkInterface::CanBroadcast)) { - for (const QNetworkAddressEntry &ifaceAddress : iface.addressEntries()) { + for (const QNetworkAddressEntry& ifaceAddress : iface.addressEntries()) { QHostAddress sourceAddress = ifaceAddress.ip(); if (sourceAddress.protocol() == QAbstractSocket::IPv4Protocol && sourceAddress != QHostAddress::LocalHost) { qCDebug(KDECONNECT_CORE()) << "Broadcasting as" << sourceAddress; @@ -156,7 +156,7 @@ } } #else - mUdpSocket.writeDatagram(np.serialize(), destAddress, UDP_PORT); + m_udpSocket.writeDatagram(np.serialize(), destAddress, UDP_PORT); #endif } @@ -165,15 +165,15 @@ //I will create a TcpSocket and try to connect. This can result in either connected() or connectError(). void LanLinkProvider::newUdpConnection() //udpBroadcastReceived { - while (mUdpSocket.hasPendingDatagrams()) { + while (m_udpSocket.hasPendingDatagrams()) { QByteArray datagram; - datagram.resize(mUdpSocket.pendingDatagramSize()); + datagram.resize(m_udpSocket.pendingDatagramSize()); QHostAddress sender; - mUdpSocket.readDatagram(datagram.data(), datagram.size(), &sender); + m_udpSocket.readDatagram(datagram.data(), datagram.size(), &sender); - if (sender.isLoopback() && !mTestMode) + if (sender.isLoopback() && !m_testMode) continue; NetworkPackage* receivedPackage = new NetworkPackage(QLatin1String("")); @@ -200,8 +200,8 @@ QSslSocket* socket = new QSslSocket(this); socket->setProxy(QNetworkProxy::NoProxy); - receivedIdentityPackages[socket].np = receivedPackage; - receivedIdentityPackages[socket].sender = sender; + m_receivedIdentityPackages[socket].np = receivedPackage; + m_receivedIdentityPackages[socket].sender = sender; connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); socket->connectToHost(sender, tcpPort); @@ -218,12 +218,12 @@ qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)" << socket->errorString(); NetworkPackage np(QLatin1String("")); NetworkPackage::createIdentityPackage(&np); - np.set(QStringLiteral("tcpPort"), mTcpPort); - mUdpSocket.writeDatagram(np.serialize(), receivedIdentityPackages[socket].sender, UDP_PORT); + np.set(QStringLiteral("tcpPort"), m_tcpPort); + m_udpSocket.writeDatagram(np.serialize(), m_receivedIdentityPackages[socket].sender, UDP_PORT); //The socket we created didn't work, and we didn't manage //to create a LanDeviceLink from it, deleting everything. - delete receivedIdentityPackages.take(socket).np; + delete m_receivedIdentityPackages.take(socket).np; delete socket; } @@ -241,7 +241,7 @@ // If socket disconnects due to any reason after connection, link on ssl faliure connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater); - NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; + NetworkPackage* receivedPackage = m_receivedIdentityPackages[socket].np; const QString& deviceId = receivedPackage->get(QStringLiteral("deviceId")); //qCDebug(KDECONNECT_CORE) << "Connected" << socket->isWritable(); @@ -281,10 +281,10 @@ //I think this will never happen, but if it happens the deviceLink //(or the socket that is now inside it) might not be valid. Delete them. qCDebug(KDECONNECT_CORE) << "Fallback (2), try reverse connection (send udp packet)"; - mUdpSocket.writeDatagram(np2.serialize(), receivedIdentityPackages[socket].sender, UDP_PORT); + m_udpSocket.writeDatagram(np2.serialize(), m_receivedIdentityPackages[socket].sender, UDP_PORT); } - delete receivedIdentityPackages.take(socket).np; + delete m_receivedIdentityPackages.take(socket).np; //We don't delete the socket because now it's owned by the LanDeviceLink } @@ -300,13 +300,13 @@ Q_ASSERT(socket->mode() != QSslSocket::UnencryptedMode); LanDeviceLink::ConnectionStarted connectionOrigin = (socket->mode() == QSslSocket::SslClientMode)? LanDeviceLink::Locally : LanDeviceLink::Remotely; - NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; + NetworkPackage* receivedPackage = m_receivedIdentityPackages[socket].np; const QString& deviceId = receivedPackage->get(QStringLiteral("deviceId")); addLink(deviceId, socket, receivedPackage, connectionOrigin); // Copied from connected slot, now delete received package - delete receivedIdentityPackages.take(socket).np; + delete m_receivedIdentityPackages.take(socket).np; } void LanLinkProvider::sslErrors(const QList& errors) @@ -318,12 +318,12 @@ disconnect(socket, SIGNAL(sslErrors(QList)), this, SLOT(sslErrors(QList))); qCDebug(KDECONNECT_CORE) << "Failing due to " << errors; - Device *device = Daemon::instance()->getDevice(socket->peerVerifyName()); + Device* device = Daemon::instance()->getDevice(socket->peerVerifyName()); if (device) { device->unpair(); } - delete receivedIdentityPackages.take(socket).np; + delete m_receivedIdentityPackages.take(socket).np; // Socket disconnects itself on ssl error and will be deleted by deleteLater slot, no need to delete manually } @@ -332,8 +332,8 @@ { //qCDebug(KDECONNECT_CORE) << "LanLinkProvider newConnection"; - while (mServer->hasPendingConnections()) { - QSslSocket* socket = mServer->nextPendingConnection(); + while (m_server->hasPendingConnections()) { + QSslSocket* socket = m_server->nextPendingConnection(); configureSocket(socket); //This socket is still managed by us (and child of the QTcpServer), if //it disconnects before we manage to pass it to a LanDeviceLink, it's @@ -370,7 +370,7 @@ } // Needed in "encrypted" if ssl is used, similar to "connected" - receivedIdentityPackages[socket].np = np; + m_receivedIdentityPackages[socket].np = np; const QString& deviceId = np->get(QStringLiteral("deviceId")); //qCDebug(KDECONNECT_CORE) << "Handshaking done (i'm the new device)"; @@ -396,7 +396,7 @@ } else { qWarning() << np->get(QStringLiteral("deviceName")) << "uses an old protocol version, this won't work"; //addLink(deviceId, socket, np, LanDeviceLink::Locally); - delete receivedIdentityPackages.take(socket).np; + delete m_receivedIdentityPackages.take(socket).np; } } @@ -404,12 +404,12 @@ { const QString id = destroyedDeviceLink->property("deviceId").toString(); //qCDebug(KDECONNECT_CORE) << "deviceLinkDestroyed" << id; - Q_ASSERT(mLinks.key(static_cast(destroyedDeviceLink)) == id); - QMap< QString, LanDeviceLink* >::iterator linkIterator = mLinks.find(id); - if (linkIterator != mLinks.end()) { + Q_ASSERT(m_links.key(static_cast(destroyedDeviceLink)) == id); + QMap< QString, LanDeviceLink* >::iterator linkIterator = m_links.find(id); + if (linkIterator != m_links.end()) { Q_ASSERT(linkIterator.value() == destroyedDeviceLink); - mLinks.erase(linkIterator); - mPairingHandlers.take(id)->deleteLater(); + m_links.erase(linkIterator); + m_pairingHandlers.take(id)->deleteLater(); } } @@ -447,7 +447,7 @@ //Usually SSL errors are only bad for trusted devices. Uncomment this section to log errors in any case, for debugging. //QObject::connect(socket, static_cast&)>(&QSslSocket::sslErrors), [](const QList& errors) //{ - // Q_FOREACH (const QSslError &error, errors) { + // Q_FOREACH (const QSslError& error, errors) { // qCDebug(KDECONNECT_CORE) << "SSL Error:" << error.errorString(); // } //}); @@ -486,20 +486,20 @@ LanDeviceLink* deviceLink; //Do we have a link for this device already? - QMap< QString, LanDeviceLink* >::iterator linkIterator = mLinks.find(deviceId); - if (linkIterator != mLinks.end()) { + QMap< QString, LanDeviceLink* >::iterator linkIterator = m_links.find(deviceId); + if (linkIterator != m_links.end()) { //qCDebug(KDECONNECT_CORE) << "Reusing link to" << deviceId; deviceLink = linkIterator.value(); deviceLink->reset(socket, connectionOrigin); } else { deviceLink = new LanDeviceLink(deviceId, this, socket, connectionOrigin); connect(deviceLink, &QObject::destroyed, this, &LanLinkProvider::deviceLinkDestroyed); - mLinks[deviceId] = deviceLink; - if (mPairingHandlers.contains(deviceId)) { + m_links[deviceId] = deviceLink; + if (m_pairingHandlers.contains(deviceId)) { //We shouldn't have a pairinghandler if we didn't have a link. //Crash if debug, recover if release (by setting the new devicelink to the old pairinghandler) - Q_ASSERT(mPairingHandlers.contains(deviceId)); - mPairingHandlers[deviceId]->setDeviceLink(deviceLink); + Q_ASSERT(m_pairingHandlers.contains(deviceId)); + m_pairingHandlers[deviceId]->setDeviceLink(deviceLink); } Q_EMIT onConnectionReceived(*receivedPackage, deviceLink); } @@ -508,25 +508,25 @@ LanPairingHandler* LanLinkProvider::createPairingHandler(DeviceLink* link) { - LanPairingHandler* ph = mPairingHandlers.value(link->deviceId()); + LanPairingHandler* ph = m_pairingHandlers.value(link->deviceId()); if (!ph) { ph = new LanPairingHandler(link); qCDebug(KDECONNECT_CORE) << "creating pairing handler for" << link->deviceId(); connect (ph, &LanPairingHandler::pairingError, link, &DeviceLink::pairingError); - mPairingHandlers[link->deviceId()] = ph; + m_pairingHandlers[link->deviceId()] = ph; } return ph; } void LanLinkProvider::userRequestsPair(const QString& deviceId) { - LanPairingHandler* ph = createPairingHandler(mLinks.value(deviceId)); + LanPairingHandler* ph = createPairingHandler(m_links.value(deviceId)); ph->requestPairing(); } void LanLinkProvider::userRequestsUnpair(const QString& deviceId) { - LanPairingHandler* ph = createPairingHandler(mLinks.value(deviceId)); + LanPairingHandler* ph = createPairingHandler(m_links.value(deviceId)); ph->unpair(); } diff --git a/core/backends/lan/server.cpp b/core/backends/lan/server.cpp --- a/core/backends/lan/server.cpp +++ b/core/backends/lan/server.cpp @@ -34,7 +34,7 @@ } void Server::incomingConnection(qintptr socketDescriptor) { - QSslSocket *serverSocket = new QSslSocket(parent()); + QSslSocket* serverSocket = new QSslSocket(parent()); if (serverSocket->setSocketDescriptor(socketDescriptor)) { pendingConnections.append(serverSocket); Q_EMIT newConnection(); diff --git a/core/backends/lan/socketlinereader.h b/core/backends/lan/socketlinereader.h --- a/core/backends/lan/socketlinereader.h +++ b/core/backends/lan/socketlinereader.h @@ -40,13 +40,13 @@ public: explicit SocketLineReader(QSslSocket* socket, QObject* parent = nullptr); - QByteArray readLine() { return mPackages.dequeue(); } - qint64 write(const QByteArray& data) { return mSocket->write(data); } - QHostAddress peerAddress() const { return mSocket->peerAddress(); } - QSslCertificate peerCertificate() const { return mSocket->peerCertificate(); } - qint64 bytesAvailable() const { return mPackages.size(); } + QByteArray readLine() { return m_packages.dequeue(); } + qint64 write(const QByteArray& data) { return m_socket->write(data); } + QHostAddress peerAddress() const { return m_socket->peerAddress(); } + QSslCertificate peerCertificate() const { return m_socket->peerCertificate(); } + qint64 bytesAvailable() const { return m_packages.size(); } - QSslSocket* mSocket; + QSslSocket* m_socket; Q_SIGNALS: void readyRead(); @@ -55,8 +55,8 @@ void dataReceived(); private: - QByteArray lastChunk; - QQueue mPackages; + QByteArray m_lastChunk; + QQueue m_packages; }; diff --git a/core/backends/lan/socketlinereader.cpp b/core/backends/lan/socketlinereader.cpp --- a/core/backends/lan/socketlinereader.cpp +++ b/core/backends/lan/socketlinereader.cpp @@ -23,31 +23,31 @@ SocketLineReader::SocketLineReader(QSslSocket* socket, QObject* parent) : QObject(parent) - , mSocket(socket) + , m_socket(socket) { - connect(mSocket, &QIODevice::readyRead, + connect(m_socket, &QIODevice::readyRead, this, &SocketLineReader::dataReceived); } void SocketLineReader::dataReceived() { - while (mSocket->canReadLine()) { - const QByteArray line = mSocket->readLine(); + while (m_socket->canReadLine()) { + const QByteArray line = m_socket->readLine(); if (line.length() > 1) { //we don't want a single \n - mPackages.enqueue(line); + m_packages.enqueue(line); } } //If we still have things to read from the socket, call dataReceived again //We do this manually because we do not trust readyRead to be emitted again //So we call this method again just in case. - if (mSocket->bytesAvailable() > 0) { + if (m_socket->bytesAvailable() > 0) { QMetaObject::invokeMethod(this, "dataReceived", Qt::QueuedConnection); return; } //If we have any packages, tell it to the world. - if (!mPackages.isEmpty()) { + if (!m_packages.isEmpty()) { Q_EMIT readyRead(); } } diff --git a/core/backends/lan/uploadjob.h b/core/backends/lan/uploadjob.h --- a/core/backends/lan/uploadjob.h +++ b/core/backends/lan/uploadjob.h @@ -41,11 +41,11 @@ QVariantMap transferInfo(); private: - const QSharedPointer mInput; - Server * const mServer; - QSslSocket* mSocket; - quint16 mPort; - const QString mDeviceId; + const QSharedPointer m_input; + Server * const m_server; + QSslSocket* m_socket; + quint16 m_port; + const QString m_deviceId; const static quint16 MIN_PORT = 1739; const static quint16 MAX_PORT = 1764; @@ -57,7 +57,7 @@ void cleanup(); void socketFailed(QAbstractSocket::SocketError); - void sslErrors(const QList &errors); + void sslErrors(const QList& errors); }; #endif // UPLOADJOB_H diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -28,92 +28,92 @@ UploadJob::UploadJob(const QSharedPointer& source, const QString& deviceId) : KJob() - , mInput(source) - , mServer(new Server(this)) - , mSocket(nullptr) - , mPort(0) - , mDeviceId(deviceId) // We will use this info if link is on ssl, to send encrypted payload + , m_input(source) + , m_server(new Server(this)) + , m_socket(nullptr) + , m_port(0) + , m_deviceId(deviceId) // We will use this info if link is on ssl, to send encrypted payload { - connect(mInput.data(), &QIODevice::readyRead, this, &UploadJob::startUploading); - connect(mInput.data(), &QIODevice::aboutToClose, this, &UploadJob::aboutToClose); + connect(m_input.data(), &QIODevice::readyRead, this, &UploadJob::startUploading); + connect(m_input.data(), &QIODevice::aboutToClose, this, &UploadJob::aboutToClose); } void UploadJob::start() { - mPort = MIN_PORT; - while (!mServer->listen(QHostAddress::Any, mPort)) { - mPort++; - if (mPort > MAX_PORT) { //No ports available? + m_port = MIN_PORT; + while (!m_server->listen(QHostAddress::Any, m_port)) { + m_port++; + if (m_port > MAX_PORT) { //No ports available? qCWarning(KDECONNECT_CORE) << "Error opening a port in range" << MIN_PORT << "-" << MAX_PORT; - mPort = 0; + m_port = 0; setError(1); setErrorText(i18n("Couldn't find an available port")); emitResult(); return; } } - connect(mServer, &QTcpServer::newConnection, this, &UploadJob::newConnection); + connect(m_server, &QTcpServer::newConnection, this, &UploadJob::newConnection); } void UploadJob::newConnection() { - if (!mInput->open(QIODevice::ReadOnly)) { + if (!m_input->open(QIODevice::ReadOnly)) { qCWarning(KDECONNECT_CORE) << "error when opening the input to upload"; return; //TODO: Handle error, clean up... } Server* server = qobject_cast(sender()); // FIXME : It is called again when payload sending is finished. Unsolved mystery :( - disconnect(mServer, &QTcpServer::newConnection, this, &UploadJob::newConnection); - - mSocket = server->nextPendingConnection(); - mSocket->setParent(this); - connect(mSocket, &QSslSocket::disconnected, this, &UploadJob::cleanup); - connect(mSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketFailed(QAbstractSocket::SocketError))); - connect(mSocket, SIGNAL(sslErrors(QList)), this, SLOT(sslErrors(QList))); - connect(mSocket, &QSslSocket::encrypted, this, &UploadJob::startUploading); + disconnect(m_server, &QTcpServer::newConnection, this, &UploadJob::newConnection); + + m_socket = server->nextPendingConnection(); + m_socket->setParent(this); + connect(m_socket, &QSslSocket::disconnected, this, &UploadJob::cleanup); + connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketFailed(QAbstractSocket::SocketError))); + connect(m_socket, SIGNAL(sslErrors(QList)), this, SLOT(sslErrors(QList))); + connect(m_socket, &QSslSocket::encrypted, this, &UploadJob::startUploading); // connect(mSocket, &QAbstractSocket::stateChanged, [](QAbstractSocket::SocketState state){ qDebug() << "statechange" << state; }); - LanLinkProvider::configureSslSocket(mSocket, mDeviceId, true); + LanLinkProvider::configureSslSocket(m_socket, m_deviceId, true); - mSocket->startServerEncryption(); + m_socket->startServerEncryption(); } void UploadJob::startUploading() { - while ( mInput->bytesAvailable() > 0 ) + while ( m_input->bytesAvailable() > 0 ) { - qint64 bytes = qMin(mInput->bytesAvailable(), (qint64)4096); - int w = mSocket->write(mInput->read(bytes)); + qint64 bytes = qMin(m_input->bytesAvailable(), (qint64)4096); + int w = m_socket->write(m_input->read(bytes)); if (w<0) { - qCWarning(KDECONNECT_CORE) << "error when writing data to upload" << bytes << mInput->bytesAvailable(); + qCWarning(KDECONNECT_CORE) << "error when writing data to upload" << bytes << m_input->bytesAvailable(); break; } else { - while ( mSocket->flush() ); + while ( m_socket->flush() ); } } - mInput->close(); + m_input->close(); } void UploadJob::aboutToClose() { // qDebug() << "closing..."; - mSocket->disconnectFromHost(); + m_socket->disconnectFromHost(); } void UploadJob::cleanup() { - mSocket->close(); + m_socket->close(); // qDebug() << "closed!"; emitResult(); } QVariantMap UploadJob::transferInfo() { - Q_ASSERT(mPort != 0); - return {{"port", mPort}}; + Q_ASSERT(m_port != 0); + return {{"port", m_port}}; } void UploadJob::socketFailed(QAbstractSocket::SocketError error) @@ -121,7 +121,7 @@ qWarning() << "error uploading" << error; setError(2); emitResult(); - mSocket->close(); + m_socket->close(); } void UploadJob::sslErrors(const QList& errors) @@ -129,5 +129,5 @@ qWarning() << "ssl errors" << errors; setError(1); emitResult(); - mSocket->close(); + m_socket->close(); } diff --git a/core/backends/pairinghandler.cpp b/core/backends/pairinghandler.cpp --- a/core/backends/pairinghandler.cpp +++ b/core/backends/pairinghandler.cpp @@ -27,7 +27,7 @@ } -void PairingHandler::setDeviceLink(DeviceLink *dl) +void PairingHandler::setDeviceLink(DeviceLink* dl) { setParent(dl); m_deviceLink = dl; diff --git a/core/core_debug.cpp b/core/core_debug.cpp --- a/core/core_debug.cpp +++ b/core/core_debug.cpp @@ -31,9 +31,9 @@ void logBacktrace() { #ifdef Q_OS_LINUX - void *array[32]; + void* array[32]; size_t size = backtrace (array, 32); - char **strings = backtrace_symbols (array, size); + char** strings = backtrace_symbols (array, size); backtrace_symbols_fd(array, size, STDERR_FILENO); free (strings); #endif diff --git a/core/daemon.h b/core/daemon.h --- a/core/daemon.h +++ b/core/daemon.h @@ -42,15 +42,15 @@ Q_PROPERTY(QStringList pairingRequests READ pairingRequests NOTIFY pairingRequestsChanged) public: - explicit Daemon(QObject *parent, bool testMode = false); + explicit Daemon(QObject* parent, bool testMode = false); ~Daemon() override; static Daemon* instance(); QList devicesList() const; - virtual void askPairingConfirmation(Device *device) = 0; - virtual void reportError(const QString &title, const QString &description) = 0; + virtual void askPairingConfirmation(Device* device) = 0; + virtual void reportError(const QString& title, const QString& description) = 0; virtual QNetworkAccessManager* networkAccessManager(); Device* getDevice(const QString& deviceId); @@ -59,25 +59,25 @@ Q_SCRIPTABLE QString selfId() const; public Q_SLOTS: - Q_SCRIPTABLE void acquireDiscoveryMode(const QString &id); - Q_SCRIPTABLE void releaseDiscoveryMode(const QString &id); + Q_SCRIPTABLE void acquireDiscoveryMode(const QString& id); + Q_SCRIPTABLE void releaseDiscoveryMode(const QString& id); Q_SCRIPTABLE void forceOnNetworkChange(); ///don't try to turn into Q_PROPERTY, it doesn't work Q_SCRIPTABLE QString announcedName(); - Q_SCRIPTABLE void setAnnouncedName(const QString &name); + Q_SCRIPTABLE void setAnnouncedName(const QString& name); //Returns a list of ids. The respective devices can be manipulated using the dbus path: "/modules/kdeconnect/Devices/"+id Q_SCRIPTABLE QStringList devices(bool onlyReachable = false, bool onlyPaired = false) const; - Q_SCRIPTABLE QString deviceIdByName(const QString &name) const; + Q_SCRIPTABLE QString deviceIdByName(const QString& name) const; Q_SIGNALS: Q_SCRIPTABLE void deviceAdded(const QString& id); Q_SCRIPTABLE void deviceRemoved(const QString& id); //Note that paired devices will never be removed Q_SCRIPTABLE void deviceVisibilityChanged(const QString& id, bool isVisible); - Q_SCRIPTABLE void announcedNameChanged(const QString &announcedName); + Q_SCRIPTABLE void announcedNameChanged(const QString& announcedName); Q_SCRIPTABLE void pairingRequestsChanged(); private Q_SLOTS: diff --git a/core/daemon.cpp b/core/daemon.cpp --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -44,12 +44,12 @@ struct DaemonPrivate { //Different ways to find devices and connect to them - QSet mLinkProviders; + QSet m_linkProviders; //Every known device - QMap mDevices; + QMap m_devices; - QSet mDiscoveryModeAcquisitions; + QSet m_discoveryModeAcquisitions; }; Daemon* Daemon::instance() @@ -58,7 +58,7 @@ return s_instance; } -Daemon::Daemon(QObject *parent, bool testMode) +Daemon::Daemon(QObject* parent, bool testMode) : QObject(parent) , d(new DaemonPrivate) { @@ -68,9 +68,9 @@ //Load backends if (testMode) - d->mLinkProviders.insert(new LoopbackLinkProvider()); + d->m_linkProviders.insert(new LoopbackLinkProvider()); else { - d->mLinkProviders.insert(new LanLinkProvider()); + d->m_linkProviders.insert(new LanLinkProvider()); #ifdef KDECONNECT_BLUETOOTH d->mLinkProviders.insert(new BluetoothLinkProvider()); #endif @@ -83,7 +83,7 @@ } //Listen to new devices - for (LinkProvider* a : qAsConst(d->mLinkProviders)) { + for (LinkProvider* a : qAsConst(d->m_linkProviders)) { connect(a, &LinkProvider::onConnectionReceived, this, &Daemon::onNewDeviceLink); a->onStart(); @@ -96,38 +96,38 @@ qCDebug(KDECONNECT_CORE) << "KdeConnect daemon started"; } -void Daemon::acquireDiscoveryMode(const QString &key) +void Daemon::acquireDiscoveryMode(const QString& key) { - bool oldState = d->mDiscoveryModeAcquisitions.isEmpty(); + bool oldState = d->m_discoveryModeAcquisitions.isEmpty(); - d->mDiscoveryModeAcquisitions.insert(key); + d->m_discoveryModeAcquisitions.insert(key); - if (oldState != d->mDiscoveryModeAcquisitions.isEmpty()) { + if (oldState != d->m_discoveryModeAcquisitions.isEmpty()) { forceOnNetworkChange(); } } -void Daemon::releaseDiscoveryMode(const QString &key) +void Daemon::releaseDiscoveryMode(const QString& key) { - bool oldState = d->mDiscoveryModeAcquisitions.isEmpty(); + bool oldState = d->m_discoveryModeAcquisitions.isEmpty(); - d->mDiscoveryModeAcquisitions.remove(key); + d->m_discoveryModeAcquisitions.remove(key); - if (oldState != d->mDiscoveryModeAcquisitions.isEmpty()) { + if (oldState != d->m_discoveryModeAcquisitions.isEmpty()) { cleanDevices(); } } void Daemon::removeDevice(Device* device) { - d->mDevices.remove(device->id()); + d->m_devices.remove(device->id()); device->deleteLater(); Q_EMIT deviceRemoved(device->id()); } void Daemon::cleanDevices() { - for (Device* device : qAsConst(d->mDevices)) { + for (Device* device : qAsConst(d->m_devices)) { if (device->isTrusted()) { continue; } @@ -141,15 +141,15 @@ void Daemon::forceOnNetworkChange() { - qCDebug(KDECONNECT_CORE) << "Sending onNetworkChange to " << d->mLinkProviders.size() << " LinkProviders"; - for (LinkProvider* a : qAsConst(d->mLinkProviders)) { + qCDebug(KDECONNECT_CORE) << "Sending onNetworkChange to " << d->m_linkProviders.size() << " LinkProviders"; + for (LinkProvider* a : qAsConst(d->m_linkProviders)) { a->onNetworkChange(); } } Device*Daemon::getDevice(const QString& deviceId) { - for (Device* device : qAsConst(d->mDevices)) { + for (Device* device : qAsConst(d->m_devices)) { if (device->id() == deviceId) { return device; } @@ -160,7 +160,7 @@ QStringList Daemon::devices(bool onlyReachable, bool onlyTrusted) const { QStringList ret; - for (Device* device : qAsConst(d->mDevices)) { + for (Device* device : qAsConst(d->m_devices)) { if (onlyReachable && !device->isReachable()) continue; if (onlyTrusted && !device->isTrusted()) continue; ret.append(device->id()); @@ -174,9 +174,9 @@ //qCDebug(KDECONNECT_CORE) << "Device discovered" << id << "via" << dl->provider()->name(); - if (d->mDevices.contains(id)) { + if (d->m_devices.contains(id)) { qCDebug(KDECONNECT_CORE) << "It is a known device" << identityPackage.get(QStringLiteral("deviceName")); - Device* device = d->mDevices[id]; + Device* device = d->m_devices[id]; bool wasReachable = device->isReachable(); device->addLink(identityPackage, dl); if (!wasReachable) { @@ -210,7 +210,7 @@ } -void Daemon::setAnnouncedName(const QString &name) +void Daemon::setAnnouncedName(const QString& name) { qCDebug(KDECONNECT_CORE()) << "Announcing name"; KdeConnectConfig::instance()->setName(name); @@ -234,17 +234,17 @@ QList Daemon::devicesList() const { - return d->mDevices.values(); + return d->m_devices.values(); } bool Daemon::isDiscoveringDevices() const { - return !d->mDiscoveryModeAcquisitions.isEmpty(); + return !d->m_discoveryModeAcquisitions.isEmpty(); } -QString Daemon::deviceIdByName(const QString &name) const +QString Daemon::deviceIdByName(const QString& name) const { - for (Device* device : qAsConst(d->mDevices)) { + for (Device* device : qAsConst(d->m_devices)) { if (device->name() == name && device->isTrusted()) return device->id(); } @@ -261,7 +261,7 @@ if (hasPairingRequests) askPairingConfirmation(device); } ); - d->mDevices[id] = device; + d->m_devices[id] = device; Q_EMIT deviceAdded(id); } @@ -269,7 +269,7 @@ QStringList Daemon::pairingRequests() const { QStringList ret; - for(Device* dev: d->mDevices) { + for(Device* dev: d->m_devices) { if (dev->hasPairingRequests()) ret += dev->id(); } diff --git a/core/device.h b/core/device.h --- a/core/device.h +++ b/core/device.h @@ -138,10 +138,10 @@ Q_SCRIPTABLE void hasPairingRequestsChanged(bool hasPairingRequests); private: //Methods - static DeviceType str2type(const QString &deviceType); + static DeviceType str2type(const QString& deviceType); static QString type2str(DeviceType deviceType); - void setName(const QString &name); + void setName(const QString& name); QString iconForStatus(bool reachable, bool paired) const; private: //Fields (TODO: dPointer!) diff --git a/core/device.cpp b/core/device.cpp --- a/core/device.cpp +++ b/core/device.cpp @@ -41,7 +41,7 @@ #include "kdeconnectconfig.h" #include "daemon.h" -static void warn(const QString &info) +static void warn(const QString& info) { qWarning() << "Device pairing error" << info; } @@ -49,7 +49,7 @@ Device::Device(QObject* parent, const QString& id) : QObject(parent) , m_deviceId(id) - , m_protocolVersion(NetworkPackage::ProtocolVersion) //We don't know it yet + , m_protocolVersion(NetworkPackage::s_protocolVersion) //We don't know it yet { KdeConnectConfig::DeviceInfo info = KdeConnectConfig::instance()->getTrustedDevice(id); @@ -213,8 +213,8 @@ Q_ASSERT(!m_deviceLinks.contains(link)); m_protocolVersion = identityPackage.get(QStringLiteral("protocolVersion"), -1); - if (m_protocolVersion != NetworkPackage::ProtocolVersion) { - qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; + if (m_protocolVersion != NetworkPackage::s_protocolVersion) { + qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::s_protocolVersion; } connect(link, &QObject::destroyed, @@ -392,7 +392,7 @@ return QHostAddress::Null; } -Device::DeviceType Device::str2type(const QString &deviceType) { +Device::DeviceType Device::str2type(const QString& deviceType) { if (deviceType == QLatin1String("desktop")) return Desktop; if (deviceType == QLatin1String("laptop")) return Laptop; if (deviceType == QLatin1String("smartphone") || deviceType == QLatin1String("phone")) return Phone; @@ -434,7 +434,7 @@ return type+status; } -void Device::setName(const QString &name) +void Device::setName(const QString& name) { if (m_deviceName != name) { m_deviceName = name; diff --git a/core/filetransferjob.h b/core/filetransferjob.h --- a/core/filetransferjob.h +++ b/core/filetransferjob.h @@ -49,10 +49,10 @@ * @p size specifies the expected size of the stream we're reading. * @p destination specifies where these contents should be stored */ - FileTransferJob(const QSharedPointer& origin, qint64 size, const QUrl &destination); + FileTransferJob(const QSharedPointer& origin, qint64 size, const QUrl& destination); void start() override; - QUrl destination() const { return mDestination; } - void setOriginName(const QString& from) { mFrom = from; } + QUrl destination() const { return m_destination; } + void setOriginName(const QString& from) { m_from = from; } private Q_SLOTS: void doStart(); @@ -65,13 +65,13 @@ void transferFailed(QNetworkReply::NetworkError error); void transferFinished(); - QSharedPointer mOrigin; - QNetworkReply* mReply; - QString mFrom; - QUrl mDestination; - QElapsedTimer mTimer; - qulonglong mSpeedBytes; - qint64 mWritten; + QSharedPointer m_origin; + QNetworkReply* m_reply; + QString m_from; + QUrl m_destination; + QElapsedTimer m_timer; + qulonglong m_speedBytes; + qint64 m_written; }; #endif diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -31,18 +31,18 @@ FileTransferJob::FileTransferJob(const QSharedPointer& origin, qint64 size, const QUrl& destination) : KJob() - , mOrigin(origin) - , mReply(Q_NULLPTR) - , mFrom(QStringLiteral("KDE Connect")) - , mDestination(destination) - , mSpeedBytes(0) - , mWritten(0) + , m_origin(origin) + , m_reply(Q_NULLPTR) + , m_from(QStringLiteral("KDE Connect")) + , m_destination(destination) + , m_speedBytes(0) + , m_written(0) { - Q_ASSERT(mOrigin); - Q_ASSERT(mOrigin->isReadable()); - if (mDestination.scheme().isEmpty()) { - qCWarning(KDECONNECT_CORE) << "Destination QUrl" << mDestination << "lacks a scheme. Setting its scheme to 'file'."; - mDestination.setScheme(QStringLiteral("file")); + Q_ASSERT(m_origin); + Q_ASSERT(m_origin->isReadable()); + if (m_destination.scheme().isEmpty()) { + qCWarning(KDECONNECT_CORE) << "Destination QUrl" << m_destination << "lacks a scheme. Setting its scheme to 'file'."; + m_destination.setScheme(QStringLiteral("file")); } if (size >= 0) { @@ -62,71 +62,71 @@ void FileTransferJob::doStart() { description(this, i18n("Receiving file over KDE Connect"), - { i18nc("File transfer origin", "From"), mFrom } + { i18nc("File transfer origin", "From"), m_from } ); - if (mDestination.isLocalFile() && QFile::exists(mDestination.toLocalFile())) { + if (m_destination.isLocalFile() && QFile::exists(m_destination.toLocalFile())) { setError(2); setErrorText(i18n("Filename already present")); emitResult(); return; } - if (mOrigin->bytesAvailable()) + if (m_origin->bytesAvailable()) startTransfer(); - connect(mOrigin.data(), &QIODevice::readyRead, this, &FileTransferJob::startTransfer); + connect(m_origin.data(), &QIODevice::readyRead, this, &FileTransferJob::startTransfer); } void FileTransferJob::startTransfer() { setProcessedAmount(Bytes, 0); - mTimer.start(); + m_timer.start(); description(this, i18n("Receiving file over KDE Connect"), - { i18nc("File transfer origin", "From"), mFrom }, - { i18nc("File transfer destination", "To"), mDestination.toLocalFile() }); + { i18nc("File transfer origin", "From"), m_from }, + { i18nc("File transfer destination", "To"), m_destination.toLocalFile() }); - QNetworkRequest req(mDestination); + QNetworkRequest req(m_destination); req.setHeader(QNetworkRequest::ContentLengthHeader, totalAmount(Bytes)); - mReply = Daemon::instance()->networkAccessManager()->put(req, mOrigin.data()); + m_reply = Daemon::instance()->networkAccessManager()->put(req, m_origin.data()); - connect(mReply, &QNetworkReply::uploadProgress, this, [this](qint64 bytesSent, qint64 /*bytesTotal*/) { + connect(m_reply, &QNetworkReply::uploadProgress, this, [this](qint64 bytesSent, qint64 /*bytesTotal*/) { setProcessedAmount(Bytes, bytesSent); - const auto elapsed = mTimer.elapsed(); + const auto elapsed = m_timer.elapsed(); if (elapsed > 0) { emitSpeed(bytesSent / elapsed); } }); - connect(mReply, static_cast(&QNetworkReply::error), + connect(m_reply, static_cast(&QNetworkReply::error), this, &FileTransferJob::transferFailed); - connect(mReply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished); + connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished); } void FileTransferJob::transferFailed(QNetworkReply::NetworkError error) { - qCDebug(KDECONNECT_CORE) << "Couldn't transfer the file successfully" << error << mReply->errorString(); + qCDebug(KDECONNECT_CORE) << "Couldn't transfer the file successfully" << error << m_reply->errorString(); setError(error); - setErrorText(i18n("Received incomplete file: %1", mReply->errorString())); + setErrorText(i18n("Received incomplete file: %1", m_reply->errorString())); emitResult(); - mReply->close(); + m_reply->close(); } void FileTransferJob::transferFinished() { //TODO: MD5-check the file - qCDebug(KDECONNECT_CORE) << "Finished transfer" << mDestination; + qCDebug(KDECONNECT_CORE) << "Finished transfer" << m_destination; emitResult(); } bool FileTransferJob::doKill() { - if (mReply) { - mReply->close(); + if (m_reply) { + m_reply->close(); } - if (mOrigin) { - mOrigin->close(); + if (m_origin) { + m_origin->close(); } return true; } diff --git a/core/kdeconnectconfig.h b/core/kdeconnectconfig.h --- a/core/kdeconnectconfig.h +++ b/core/kdeconnectconfig.h @@ -63,9 +63,9 @@ */ QStringList trustedDevices(); //list of ids - void removeTrustedDevice(const QString &id); - void addTrustedDevice(const QString &id, const QString &name, const QString &type); - KdeConnectConfig::DeviceInfo getTrustedDevice(const QString &id); + void removeTrustedDevice(const QString& id); + void addTrustedDevice(const QString& id, const QString& name, const QString& type); + KdeConnectConfig::DeviceInfo getTrustedDevice(const QString& id); void setDeviceProperty(const QString& deviceId, const QString& name, const QString& value); QString getDeviceProperty(const QString& deviceId, const QString& name, const QString& defaultValue = QString()); @@ -74,8 +74,8 @@ * Paths for config files, there is no guarantee the directories already exist */ QDir baseConfigDir(); - QDir deviceConfigDir(const QString &deviceId); - QDir pluginConfigDir(const QString &deviceId, const QString &pluginName); //Used by KdeConnectPluginConfig + QDir deviceConfigDir(const QString& deviceId); + QDir pluginConfigDir(const QString& deviceId, const QString& pluginName); //Used by KdeConnectPluginConfig private: KdeConnectConfig(); diff --git a/core/kdeconnectconfig.cpp b/core/kdeconnectconfig.cpp --- a/core/kdeconnectconfig.cpp +++ b/core/kdeconnectconfig.cpp @@ -43,13 +43,13 @@ // The Initializer object sets things up, and also does cleanup when it goes out of scope // Note it's not being used anywhere. That's intended - QCA::Initializer mQcaInitializer; + QCA::Initializer m_qcaInitializer; - QCA::PrivateKey privateKey; - QSslCertificate certificate; // Use QSslCertificate instead of QCA::Certificate due to compatibility with QSslSocket + QCA::PrivateKey m_privateKey; + QSslCertificate m_certificate; // Use QSslCertificate instead of QCA::Certificate due to compatibility with QSslSocket - QSettings* config; - QSettings* trusted_devices; + QSettings* m_config; + QSettings* m_trustedDevices; }; @@ -77,8 +77,8 @@ QDir().mkpath(baseConfigDir().path()); //.config/kdeconnect/config - d->config = new QSettings(baseConfigDir().absoluteFilePath(QStringLiteral("config")), QSettings::IniFormat); - d->trusted_devices = new QSettings(baseConfigDir().absoluteFilePath(QStringLiteral("trusted_devices")), QSettings::IniFormat); + d->m_config = new QSettings(baseConfigDir().absoluteFilePath(QStringLiteral("config")), QSettings::IniFormat); + d->m_trustedDevices = new QSettings(baseConfigDir().absoluteFilePath(QStringLiteral("trusted_devices")), QSettings::IniFormat); const QFile::Permissions strict = QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::WriteUser; @@ -86,17 +86,17 @@ QFile privKey(keyPath); if (privKey.exists() && privKey.open(QIODevice::ReadOnly)) { - d->privateKey = QCA::PrivateKey::fromPEM(privKey.readAll()); + d->m_privateKey = QCA::PrivateKey::fromPEM(privKey.readAll()); } else { - d->privateKey = QCA::KeyGenerator().createRSA(2048); + d->m_privateKey = QCA::KeyGenerator().createRSA(2048); if (!privKey.open(QIODevice::ReadWrite | QIODevice::Truncate)) { Daemon::instance()->reportError(QStringLiteral("KDE Connect"), i18n("Could not store private key file: %1", keyPath)); } else { privKey.setPermissions(strict); - privKey.write(d->privateKey.toPEM().toLatin1()); + privKey.write(d->m_privateKey.toPEM().toLatin1()); } } @@ -104,7 +104,7 @@ QFile cert(certPath); if (cert.exists() && cert.open(QIODevice::ReadOnly)) { - d->certificate = QSslCertificate::fromPath(certPath).at(0); + d->m_certificate = QSslCertificate::fromPath(certPath).at(0); } else { @@ -130,13 +130,13 @@ certificateOptions.setSerialNumber(QCA::BigInteger(10)); certificateOptions.setValidityPeriod(startTime, endTime); - d->certificate = QSslCertificate(QCA::Certificate(certificateOptions, d->privateKey).toPEM().toLatin1()); + d->m_certificate = QSslCertificate(QCA::Certificate(certificateOptions, d->m_privateKey).toPEM().toLatin1()); if (!cert.open(QIODevice::ReadWrite | QIODevice::Truncate)) { Daemon::instance()->reportError(QStringLiteral("KDE Connect"), i18n("Could not store certificate file: %1", certPath)); } else { cert.setPermissions(strict); - cert.write(d->certificate.toPem()); + cert.write(d->m_certificate.toPem()); } } @@ -149,14 +149,14 @@ QString KdeConnectConfig::name() { QString defaultName = qgetenv("USER") + '@' + QHostInfo::localHostName(); - QString name = d->config->value(QStringLiteral("name"), defaultName).toString(); + QString name = d->m_config->value(QStringLiteral("name"), defaultName).toString(); return name; } void KdeConnectConfig::setName(const QString& name) { - d->config->setValue(QStringLiteral("name"), name); - d->config->sync(); + d->m_config->setValue(QStringLiteral("name"), name); + d->m_config->sync(); } QString KdeConnectConfig::deviceType() @@ -166,7 +166,7 @@ QString KdeConnectConfig::deviceId() { - return d->certificate.subjectInfo( QSslCertificate::CommonName ).constFirst(); + return d->m_certificate.subjectInfo( QSslCertificate::CommonName ).constFirst(); } QString KdeConnectConfig::privateKeyPath() @@ -176,12 +176,12 @@ QCA::PrivateKey KdeConnectConfig::privateKey() { - return d->privateKey; + return d->m_privateKey; } QCA::PublicKey KdeConnectConfig::publicKey() { - return d->privateKey.toPublicKey(); + return d->m_privateKey.toPublicKey(); } QString KdeConnectConfig::certificatePath() @@ -191,7 +191,7 @@ QSslCertificate KdeConnectConfig::certificate() { - return d->certificate; + return d->m_certificate; } QDir KdeConnectConfig::baseConfigDir() @@ -203,67 +203,67 @@ QStringList KdeConnectConfig::trustedDevices() { - const QStringList& list = d->trusted_devices->childGroups(); + const QStringList& list = d->m_trustedDevices->childGroups(); return list; } -void KdeConnectConfig::addTrustedDevice(const QString &id, const QString &name, const QString &type) +void KdeConnectConfig::addTrustedDevice(const QString& id, const QString& name, const QString& type) { - d->trusted_devices->beginGroup(id); - d->trusted_devices->setValue(QStringLiteral("name"), name); - d->trusted_devices->setValue(QStringLiteral("type"), type); - d->trusted_devices->endGroup(); - d->trusted_devices->sync(); + d->m_trustedDevices->beginGroup(id); + d->m_trustedDevices->setValue(QStringLiteral("name"), name); + d->m_trustedDevices->setValue(QStringLiteral("type"), type); + d->m_trustedDevices->endGroup(); + d->m_trustedDevices->sync(); QDir().mkpath(deviceConfigDir(id).path()); } -KdeConnectConfig::DeviceInfo KdeConnectConfig::getTrustedDevice(const QString &id) +KdeConnectConfig::DeviceInfo KdeConnectConfig::getTrustedDevice(const QString& id) { - d->trusted_devices->beginGroup(id); + d->m_trustedDevices->beginGroup(id); KdeConnectConfig::DeviceInfo info; - info.deviceName = d->trusted_devices->value(QStringLiteral("name"), QLatin1String("unnamed")).toString(); - info.deviceType = d->trusted_devices->value(QStringLiteral("type"), QLatin1String("unknown")).toString(); + info.deviceName = d->m_trustedDevices->value(QStringLiteral("name"), QLatin1String("unnamed")).toString(); + info.deviceType = d->m_trustedDevices->value(QStringLiteral("type"), QLatin1String("unknown")).toString(); - d->trusted_devices->endGroup(); + d->m_trustedDevices->endGroup(); return info; } -void KdeConnectConfig::removeTrustedDevice(const QString &deviceId) +void KdeConnectConfig::removeTrustedDevice(const QString& deviceId) { - d->trusted_devices->remove(deviceId); - d->trusted_devices->sync(); + d->m_trustedDevices->remove(deviceId); + d->m_trustedDevices->sync(); //We do not remove the config files. } // Utility functions to set and get a value void KdeConnectConfig::setDeviceProperty(const QString& deviceId, const QString& key, const QString& value) { - d->trusted_devices->beginGroup(deviceId); - d->trusted_devices->setValue(key, value); - d->trusted_devices->endGroup(); - d->trusted_devices->sync(); + d->m_trustedDevices->beginGroup(deviceId); + d->m_trustedDevices->setValue(key, value); + d->m_trustedDevices->endGroup(); + d->m_trustedDevices->sync(); } QString KdeConnectConfig::getDeviceProperty(const QString& deviceId, const QString& key, const QString& defaultValue) { QString value; - d->trusted_devices->beginGroup(deviceId); - value = d->trusted_devices->value(key, defaultValue).toString(); - d->trusted_devices->endGroup(); + d->m_trustedDevices->beginGroup(deviceId); + value = d->m_trustedDevices->value(key, defaultValue).toString(); + d->m_trustedDevices->endGroup(); return value; } -QDir KdeConnectConfig::deviceConfigDir(const QString &deviceId) +QDir KdeConnectConfig::deviceConfigDir(const QString& deviceId) { QString deviceConfigPath = baseConfigDir().absoluteFilePath(deviceId); return QDir(deviceConfigPath); } -QDir KdeConnectConfig::pluginConfigDir(const QString &deviceId, const QString &pluginName) +QDir KdeConnectConfig::pluginConfigDir(const QString& deviceId, const QString& pluginName) { QString deviceConfigPath = baseConfigDir().absoluteFilePath(deviceId); QString pluginConfigDir = QDir(deviceConfigPath).absoluteFilePath(pluginName); diff --git a/core/kdeconnectplugin.cpp b/core/kdeconnectplugin.cpp --- a/core/kdeconnectplugin.cpp +++ b/core/kdeconnectplugin.cpp @@ -24,56 +24,56 @@ struct KdeConnectPluginPrivate { - Device* mDevice; - QString mPluginName; - QSet mOutgoingCapabilties; - KdeConnectPluginConfig* mConfig; + Device* m_device; + QString m_pluginName; + QSet m_outgoingCapabilties; + KdeConnectPluginConfig* m_config; }; KdeConnectPlugin::KdeConnectPlugin(QObject* parent, const QVariantList& args) : QObject(parent) , d(new KdeConnectPluginPrivate) { - d->mDevice = qvariant_cast< Device* >(args.at(0)); - d->mPluginName = args.at(1).toString(); - d->mOutgoingCapabilties = args.at(2).toStringList().toSet(); - d->mConfig = nullptr; + d->m_device = qvariant_cast< Device* >(args.at(0)); + d->m_pluginName = args.at(1).toString(); + d->m_outgoingCapabilties = args.at(2).toStringList().toSet(); + d->m_config = nullptr; } KdeConnectPluginConfig* KdeConnectPlugin::config() const { //Create on demand, because not every plugin will use it - if (!d->mConfig) { - d->mConfig = new KdeConnectPluginConfig(d->mDevice->id(), d->mPluginName); + if (!d->m_config) { + d->m_config = new KdeConnectPluginConfig(d->m_device->id(), d->m_pluginName); } - return d->mConfig; + return d->m_config; } KdeConnectPlugin::~KdeConnectPlugin() { - if (d->mConfig) { - delete d->mConfig; + if (d->m_config) { + delete d->m_config; } } const Device* KdeConnectPlugin::device() { - return d->mDevice; + return d->m_device; } Device const* KdeConnectPlugin::device() const { - return d->mDevice; + return d->m_device; } bool KdeConnectPlugin::sendPackage(NetworkPackage& np) const { - if(!d->mOutgoingCapabilties.contains(np.type())) { - qCWarning(KDECONNECT_CORE) << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->mOutgoingCapabilties; + if(!d->m_outgoingCapabilties.contains(np.type())) { + qCWarning(KDECONNECT_CORE) << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->m_outgoingCapabilties; return false; } // qCWarning(KDECONNECT_CORE) << metaObject()->className() << "sends" << np.type() << ". Supported:" << d->mOutgoingTypes; - return d->mDevice->sendPackage(np); + return d->m_device->sendPackage(np); } QString KdeConnectPlugin::dbusPath() const diff --git a/core/kdeconnectpluginconfig.cpp b/core/kdeconnectpluginconfig.cpp --- a/core/kdeconnectpluginconfig.cpp +++ b/core/kdeconnectpluginconfig.cpp @@ -29,69 +29,69 @@ struct KdeConnectPluginConfigPrivate { - QDir mConfigDir; - QSettings* mConfig; - QDBusMessage signal; + QDir m_configDir; + QSettings* m_config; + QDBusMessage m_signal; }; KdeConnectPluginConfig::KdeConnectPluginConfig(const QString& deviceId, const QString& pluginName) : d(new KdeConnectPluginConfigPrivate()) { - d->mConfigDir = KdeConnectConfig::instance()->pluginConfigDir(deviceId, pluginName); - QDir().mkpath(d->mConfigDir.path()); + d->m_configDir = KdeConnectConfig::instance()->pluginConfigDir(deviceId, pluginName); + QDir().mkpath(d->m_configDir.path()); - d->mConfig = new QSettings(d->mConfigDir.absoluteFilePath(QStringLiteral("config")), QSettings::IniFormat); + d->m_config = new QSettings(d->m_configDir.absoluteFilePath(QStringLiteral("config")), QSettings::IniFormat); - d->signal = QDBusMessage::createSignal("/kdeconnect/"+deviceId+"/"+pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged")); + d->m_signal = QDBusMessage::createSignal("/kdeconnect/"+deviceId+"/"+pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged")); QDBusConnection::sessionBus().connect(QLatin1String(""), "/kdeconnect/"+deviceId+"/"+pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged"), this, SLOT(slotConfigChanged())); } KdeConnectPluginConfig::~KdeConnectPluginConfig() { - delete d->mConfig; + delete d->m_config; } QVariant KdeConnectPluginConfig::get(const QString& key, const QVariant& defaultValue) { - d->mConfig->sync(); - return d->mConfig->value(key, defaultValue); + d->m_config->sync(); + return d->m_config->value(key, defaultValue); } QVariantList KdeConnectPluginConfig::getList(const QString& key, const QVariantList& defaultValue) { QVariantList list; - d->mConfig->sync(); // note: need sync() to get recent changes signalled from other process - int size = d->mConfig->beginReadArray(key); + d->m_config->sync(); // note: need sync() to get recent changes signalled from other process + int size = d->m_config->beginReadArray(key); if (size < 1) { - d->mConfig->endArray(); + d->m_config->endArray(); return defaultValue; } for (int i = 0; i < size; ++i) { - d->mConfig->setArrayIndex(i); - list << d->mConfig->value(QStringLiteral("value")); + d->m_config->setArrayIndex(i); + list << d->m_config->value(QStringLiteral("value")); } - d->mConfig->endArray(); + d->m_config->endArray(); return list; } void KdeConnectPluginConfig::set(const QString& key, const QVariant& value) { - d->mConfig->setValue(key, value); - d->mConfig->sync(); - QDBusConnection::sessionBus().send(d->signal); + d->m_config->setValue(key, value); + d->m_config->sync(); + QDBusConnection::sessionBus().send(d->m_signal); } void KdeConnectPluginConfig::setList(const QString& key, const QVariantList& list) { - d->mConfig->beginWriteArray(key); + d->m_config->beginWriteArray(key); for (int i = 0; i < list.size(); ++i) { - d->mConfig->setArrayIndex(i); - d->mConfig->setValue(QStringLiteral("value"), list.at(i)); + d->m_config->setArrayIndex(i); + d->m_config->setValue(QStringLiteral("value"), list.at(i)); } - d->mConfig->endArray(); - d->mConfig->sync(); - QDBusConnection::sessionBus().send(d->signal); + d->m_config->endArray(); + d->m_config->sync(); + QDBusConnection::sessionBus().send(d->m_signal); } void KdeConnectPluginConfig::slotConfigChanged() diff --git a/core/networkpackage.h b/core/networkpackage.h --- a/core/networkpackage.h +++ b/core/networkpackage.h @@ -47,52 +47,52 @@ public: //const static QCA::EncryptionAlgorithm EncryptionAlgorithm; - const static int ProtocolVersion; + const static int s_protocolVersion; - explicit NetworkPackage(const QString& type, const QVariantMap &body = {}); + explicit NetworkPackage(const QString& type, const QVariantMap& body = {}); static void createIdentityPackage(NetworkPackage*); QByteArray serialize() const; static bool unserialize(const QByteArray& json, NetworkPackage* out); - const QString& id() const { return mId; } - const QString& type() const { return mType; } - QVariantMap& body() { return mBody; } - const QVariantMap& body() const { return mBody; } + const QString& id() const { return m_id; } + const QString& type() const { return m_type; } + QVariantMap& body() { return m_body; } + const QVariantMap& body() const { return m_body; } //Get and set info from body. Note that id and type can not be accessed through these. template T get(const QString& key, const T& defaultValue = {}) const { - return mBody.value(key,defaultValue).template value(); //Important note: Awesome template syntax is awesome + return m_body.value(key,defaultValue).template value(); //Important note: Awesome template syntax is awesome } - template void set(const QString& key, const T& value) { mBody[key] = QVariant(value); } - bool has(const QString& key) const { return mBody.contains(key); } + template void set(const QString& key, const T& value) { m_body[key] = QVariant(value); } + bool has(const QString& key) const { return m_body.contains(key); } - QSharedPointer payload() const { return mPayload; } - void setPayload(const QSharedPointer& device, qint64 payloadSize) { mPayload = device; mPayloadSize = payloadSize; Q_ASSERT(mPayloadSize >= -1); } - bool hasPayload() const { return (mPayloadSize != 0); } - qint64 payloadSize() const { return mPayloadSize; } //-1 means it is an endless stream - FileTransferJob* createPayloadTransferJob(const QUrl &destination) const; + QSharedPointer payload() const { return m_payload; } + void setPayload(const QSharedPointer& device, qint64 payloadSize) { m_payload = device; m_payloadSize = payloadSize; Q_ASSERT(m_payloadSize >= -1); } + bool hasPayload() const { return (m_payloadSize != 0); } + qint64 payloadSize() const { return m_payloadSize; } //-1 means it is an endless stream + FileTransferJob* createPayloadTransferJob(const QUrl& destination) const; //To be called by a particular DeviceLink - QVariantMap payloadTransferInfo() const { return mPayloadTransferInfo; } - void setPayloadTransferInfo(const QVariantMap& map) { mPayloadTransferInfo = map; } - bool hasPayloadTransferInfo() const { return !mPayloadTransferInfo.isEmpty(); } + QVariantMap payloadTransferInfo() const { return m_payloadTransferInfo; } + void setPayloadTransferInfo(const QVariantMap& map) { m_payloadTransferInfo = map; } + bool hasPayloadTransferInfo() const { return !m_payloadTransferInfo.isEmpty(); } private: - void setId(const QString& id) { mId = id; } - void setType(const QString& t) { mType = t; } - void setBody(const QVariantMap& b) { mBody = b; } - void setPayloadSize(qint64 s) { mPayloadSize = s; } + void setId(const QString& id) { m_id = id; } + void setType(const QString& t) { m_type = t; } + void setBody(const QVariantMap& b) { m_body = b; } + void setPayloadSize(qint64 s) { m_payloadSize = s; } - QString mId; - QString mType; - QVariantMap mBody; + QString m_id; + QString m_type; + QVariantMap m_body; - QSharedPointer mPayload; - qint64 mPayloadSize; - QVariantMap mPayloadTransferInfo; + QSharedPointer m_payload; + qint64 m_payloadSize; + QVariantMap m_payloadTransferInfo; }; diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp --- a/core/networkpackage.cpp +++ b/core/networkpackage.cpp @@ -44,28 +44,28 @@ return s.space(); } -const int NetworkPackage::ProtocolVersion = 7; - -NetworkPackage::NetworkPackage(const QString& type, const QVariantMap &body) - : mId(QString::number(QDateTime::currentMSecsSinceEpoch())) - , mType(type) - , mBody(body) - , mPayload() - , mPayloadSize(0) +const int NetworkPackage::s_protocolVersion = 7; + +NetworkPackage::NetworkPackage(const QString& type, const QVariantMap& body) + : m_id(QString::number(QDateTime::currentMSecsSinceEpoch())) + , m_type(type) + , m_body(body) + , m_payload() + , m_payloadSize(0) { } void NetworkPackage::createIdentityPackage(NetworkPackage* np) { KdeConnectConfig* config = KdeConnectConfig::instance(); - np->mId = QString::number(QDateTime::currentMSecsSinceEpoch()); - np->mType = PACKAGE_TYPE_IDENTITY; - np->mPayload = QSharedPointer(); - np->mPayloadSize = 0; + np->m_id = QString::number(QDateTime::currentMSecsSinceEpoch()); + np->m_type = PACKAGE_TYPE_IDENTITY; + np->m_payload = QSharedPointer(); + np->m_payloadSize = 0; np->set(QStringLiteral("deviceId"), config->deviceId()); np->set(QStringLiteral("deviceName"), config->name()); np->set(QStringLiteral("deviceType"), config->deviceType()); - np->set(QStringLiteral("protocolVersion"), NetworkPackage::ProtocolVersion); + np->set(QStringLiteral("protocolVersion"), NetworkPackage::s_protocolVersion); np->set(QStringLiteral("incomingCapabilities"), PluginLoader::instance()->incomingCapabilities()); np->set(QStringLiteral("outgoingCapabilities"), PluginLoader::instance()->outgoingCapabilities()); @@ -97,7 +97,7 @@ if (hasPayload()) { //qCDebug(KDECONNECT_CORE) << "Serializing payloadTransferInfo"; variant[QStringLiteral("payloadSize")] = payloadSize(); - variant[QStringLiteral("payloadTransferInfo")] = mPayloadTransferInfo; + variant[QStringLiteral("payloadTransferInfo")] = m_payloadTransferInfo; } //QVariant -> json @@ -147,14 +147,14 @@ auto variant = parser.toVariant().toMap(); qvariant2qobject(variant, np); - np->mPayloadSize = variant[QStringLiteral("payloadSize")].toInt(); //Will return 0 if was not present, which is ok - if (np->mPayloadSize == -1) { - np->mPayloadSize = np->get(QStringLiteral("size"), -1); + np->m_payloadSize = variant[QStringLiteral("payloadSize")].toInt(); //Will return 0 if was not present, which is ok + if (np->m_payloadSize == -1) { + np->m_payloadSize = np->get(QStringLiteral("size"), -1); } - np->mPayloadTransferInfo = variant[QStringLiteral("payloadTransferInfo")].toMap(); //Will return an empty qvariantmap if was not present, which is ok + np->m_payloadTransferInfo = variant[QStringLiteral("payloadTransferInfo")].toMap(); //Will return an empty qvariantmap if was not present, which is ok //Ids containing characters that are not allowed as dbus paths would make app crash - if (np->mBody.contains(QStringLiteral("deviceId"))) + if (np->m_body.contains(QStringLiteral("deviceId"))) { QString deviceId = np->get(QStringLiteral("deviceId")); DbusHelper::filterNonExportableCharacters(deviceId); @@ -165,7 +165,7 @@ } -FileTransferJob* NetworkPackage::createPayloadTransferJob(const QUrl &destination) const +FileTransferJob* NetworkPackage::createPayloadTransferJob(const QUrl& destination) const { return new FileTransferJob(payload(), payloadSize(), destination); } diff --git a/core/pluginloader.h b/core/pluginloader.h --- a/core/pluginloader.h +++ b/core/pluginloader.h @@ -42,7 +42,7 @@ QStringList incomingCapabilities() const; QStringList outgoingCapabilities() const; - QSet pluginsForCapabilities(const QSet &incoming, const QSet &outgoing); + QSet pluginsForCapabilities(const QSet& incoming, const QSet& outgoing); private: PluginLoader(); diff --git a/core/pluginloader.cpp b/core/pluginloader.cpp --- a/core/pluginloader.cpp +++ b/core/pluginloader.cpp @@ -63,7 +63,7 @@ } KPluginLoader loader(service.fileName()); - KPluginFactory *factory = loader.factory(); + KPluginFactory* factory = loader.factory(); if (!factory) { qCDebug(KDECONNECT_CORE) << "KPluginFactory could not load the plugin:" << service.pluginId() << loader.errorString(); return ret; diff --git a/daemon/kdeconnect.desktop b/daemon/kdeconnect.desktop --- a/daemon/kdeconnect.desktop +++ b/daemon/kdeconnect.desktop @@ -23,7 +23,6 @@ Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[et]=KDE Connect -Name[eu]=KDE Connect Name[fi]=KDE Connect Name[fr]=KDE Connect Name[gl]=KDE Connect @@ -64,7 +63,6 @@ Comment[en_GB]=Connect KDE with your smartphone Comment[es]=Conecte KDE con su teléfono móvil Comment[et]=KDE ühendamine oma nutitelefoniga -Comment[eu]=Konektatu KDE zure mugikorrarekin Comment[fi]=Yhdistä KDE älypuhelimeesi Comment[fr]=Connectez KDE avec votre smartphone Comment[gl]=Conectar KDE co seu teléfono móbil. diff --git a/daemon/kdeconnectd.desktop.cmake b/daemon/kdeconnectd.desktop.cmake --- a/daemon/kdeconnectd.desktop.cmake +++ b/daemon/kdeconnectd.desktop.cmake @@ -20,7 +20,6 @@ Name[en_GB]=KDEConnect daemon Name[es]=Demonio de KDE Connect Name[et]=KDEConnecti deemon -Name[eu]=KDEConnect daimona Name[fi]=KDEConnect-taustapalvelu Name[fr]=Démon KDE Connect Name[gl]=Servizo de KDE Connect diff --git a/fileitemactionplugin/kdeconnectsendfile.desktop b/fileitemactionplugin/kdeconnectsendfile.desktop --- a/fileitemactionplugin/kdeconnectsendfile.desktop +++ b/fileitemactionplugin/kdeconnectsendfile.desktop @@ -14,7 +14,6 @@ Name[en_GB]=Send file via KDE Connect service Name[es]=Enviar archivo usando el servicio KDE Connect Name[et]=Faili saatmine KDE Connecti teenuse kaudu -Name[eu]=Bidali fitxategia KDE Connect zerbitzuaren bidez Name[fi]=Lähetä tiedosto KDE Connect -palvelulla Name[fr]=Envoyer un fichier via le service KDE Connect Name[gl]=Enviar un ficheiro mediante o servizo de KDE Connect @@ -54,7 +53,6 @@ X-KDE-Submenu[en_GB]=Connect X-KDE-Submenu[es]=Conectar X-KDE-Submenu[et]=Ühendus -X-KDE-Submenu[eu]=Konektatu X-KDE-Submenu[fi]=Yhdistä X-KDE-Submenu[fr]=Connecter X-KDE-Submenu[gl]=Conectar diff --git a/fileitemactionplugin/sendfileitemaction.h b/fileitemactionplugin/sendfileitemaction.h --- a/fileitemactionplugin/sendfileitemaction.h +++ b/fileitemactionplugin/sendfileitemaction.h @@ -34,7 +34,7 @@ { Q_OBJECT public: - SendFileItemAction(QObject* parent, const QVariantList &args); + SendFileItemAction(QObject* parent, const QVariantList& args); QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override; private Q_SLOTS: diff --git a/fileitemactionplugin/sendfileitemaction.cpp b/fileitemactionplugin/sendfileitemaction.cpp --- a/fileitemactionplugin/sendfileitemaction.cpp +++ b/fileitemactionplugin/sendfileitemaction.cpp @@ -72,8 +72,8 @@ } if (actions.count() > 1) { - QAction *menuAction = new QAction(QIcon::fromTheme(QStringLiteral("preferences-system-network")), i18n("Send via KDE Connect"), parentWidget); - QMenu *menu = new QMenu(parentWidget); + QAction* menuAction = new QAction(QIcon::fromTheme(QStringLiteral("preferences-system-network")), i18n("Send via KDE Connect"), parentWidget); + QMenu* menu = new QMenu(parentWidget); menu->addActions(actions); menuAction->setMenu(menu); return QList() << menuAction; diff --git a/indicator/deviceindicator.h b/indicator/deviceindicator.h --- a/indicator/deviceindicator.h +++ b/indicator/deviceindicator.h @@ -31,7 +31,7 @@ DeviceIndicator(DeviceDbusInterface* device); public Q_SLOTS: - void setText(const QString &text) { setTitle(text); } + void setText(const QString& text) { setTitle(text); } private: DeviceDbusInterface* m_device; diff --git a/indicator/main.cpp b/indicator/main.cpp --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -62,7 +62,7 @@ DevicesModel model; model.setDisplayFilter(DevicesModel::Reachable | DevicesModel::Paired); - QMenu *menu = new QMenu; + QMenu* menu = new QMenu; DaemonDbusInterface iface; auto refreshMenu = [&iface, &model, &menu]() { @@ -85,8 +85,8 @@ if (!requests.isEmpty()) { menu->addSection(i18n("Pairing requests")); - for(const auto &req: requests) { - DeviceDbusInterface *dev = new DeviceDbusInterface(req, menu); + for(const auto& req: requests) { + DeviceDbusInterface* dev = new DeviceDbusInterface(req, menu); auto pairMenu = menu->addMenu(dev->name()); pairMenu->addAction(i18n("Pair"), dev, &DeviceDbusInterface::acceptPairing); pairMenu->addAction(i18n("Reject"), dev, &DeviceDbusInterface::rejectPairing); diff --git a/indicator/org.kde.kdeconnect.nonplasma.desktop b/indicator/org.kde.kdeconnect.nonplasma.desktop --- a/indicator/org.kde.kdeconnect.nonplasma.desktop +++ b/indicator/org.kde.kdeconnect.nonplasma.desktop @@ -6,7 +6,6 @@ Name[da]=KDE Connect-indikator Name[de]=KDE-Connect-Anzeige Name[es]=Indicador de KDE Connect -Name[eu]=KDE Connect adierazlea Name[fr]=Indicateur de KDE Connect Name[gl]=Indicador de KDE Connect Name[it]=Indicatore di KDE Connect @@ -34,7 +33,6 @@ Comment[en_GB]=Display information about your devices Comment[es]=Mostrar información sobre sus dispositivos Comment[et]=Teabe kuvamine seadmete kohta -Comment[eu]=Bistaratu zure gailuei buruzko informazioa Comment[fi]=Näyttää tietoa laitteistasi Comment[fr]=Afficher les informations de vos périphériques Comment[gl]=Mostrar información sobre os dispositivos diff --git a/interfaces/dbusinterfaces.h b/interfaces/dbusinterfaces.h --- a/interfaces/dbusinterfaces.h +++ b/interfaces/dbusinterfaces.h @@ -51,7 +51,7 @@ static QString activatedService(); Q_SIGNALS: - void deviceAdded(const QString &id); + void deviceAdded(const QString& id); void pairingRequestsChangedProxy(); }; @@ -71,10 +71,10 @@ ~DeviceDbusInterface() override; Q_SCRIPTABLE QString id() const; - Q_SCRIPTABLE void pluginCall(const QString &plugin, const QString &method); + Q_SCRIPTABLE void pluginCall(const QString& plugin, const QString& method); Q_SIGNALS: - void nameChangedProxy(const QString &name); + void nameChangedProxy(const QString& name); void trustedChangedProxy(bool paired); void reachableChangedProxy(bool reachable); void hasPairingRequestsChangedProxy(bool); @@ -197,9 +197,9 @@ }; template -static void setWhenAvailable(const QDBusPendingReply &pending, W func, QObject* parent) +static void setWhenAvailable(const QDBusPendingReply& pending, W func, QObject* parent) { - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending, parent); + QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pending, parent); QObject::connect(watcher, &QDBusPendingCallWatcher::finished, parent, [func](QDBusPendingCallWatcher* watcher) { watcher->deleteLater(); diff --git a/interfaces/dbusinterfaces.cpp b/interfaces/dbusinterfaces.cpp --- a/interfaces/dbusinterfaces.cpp +++ b/interfaces/dbusinterfaces.cpp @@ -60,7 +60,7 @@ return m_id; } -void DeviceDbusInterface::pluginCall(const QString &plugin, const QString &method) +void DeviceDbusInterface::pluginCall(const QString& plugin, const QString& method) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), "/modules/kdeconnect/devices/"+id()+'/'+plugin, "org.kde.kdeconnect.device."+plugin, method); QDBusConnection::sessionBus().asyncCall(msg); diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -60,7 +60,7 @@ Q_FLAGS(StatusFilterFlags) Q_ENUM(StatusFilterFlag) - explicit DevicesModel(QObject *parent = nullptr); + explicit DevicesModel(QObject* parent = nullptr); ~DevicesModel() override; void setDisplayFilter(int flags); @@ -87,7 +87,7 @@ int rowForDevice(const QString& id) const; void clearDevices(); void appendDevice(DeviceDbusInterface* dev); - bool passesFilter(DeviceDbusInterface *dev) const; + bool passesFilter(DeviceDbusInterface* dev) const; DaemonDbusInterface* m_dbusInterface; QVector m_deviceList; diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -38,7 +38,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QString, s_keyId, (createId())); -DevicesModel::DevicesModel(QObject *parent) +DevicesModel::DevicesModel(QObject* parent) : QAbstractListModel(parent) , m_dbusInterface(new DaemonDbusInterface(this)) , m_displayFilter(StatusFilterFlag::NoFilter) @@ -137,7 +137,7 @@ qCDebug(KDECONNECT_INTERFACES) << "Adding missing or previously removed device" << id; deviceAdded(id); } else { - DeviceDbusInterface *dev = getDevice(row); + DeviceDbusInterface* dev = getDevice(row); if (! passesFilter(dev)) { beginRemoveRows(QModelIndex(), row, row); delete m_deviceList.takeAt(row); @@ -180,7 +180,7 @@ bool onlyReachable = (m_displayFilter & StatusFilterFlag::Reachable); QDBusPendingReply pendingDeviceIds = m_dbusInterface->devices(onlyReachable, onlyPaired); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingDeviceIds, this); + QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pendingDeviceIds, this); QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &DevicesModel::receivedDeviceList); diff --git a/interfaces/devicessortproxymodel.h b/interfaces/devicessortproxymodel.h --- a/interfaces/devicessortproxymodel.h +++ b/interfaces/devicessortproxymodel.h @@ -33,7 +33,7 @@ explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; - void setSourceModel(QAbstractItemModel *sourceModel) override; + void setSourceModel(QAbstractItemModel* sourceModel) override; public Q_SLOTS: void sourceDataChanged(); diff --git a/interfaces/devicessortproxymodel.cpp b/interfaces/devicessortproxymodel.cpp --- a/interfaces/devicessortproxymodel.cpp +++ b/interfaces/devicessortproxymodel.cpp @@ -29,7 +29,7 @@ setSourceModel(devicesModel); } -void DevicesSortProxyModel::setSourceModel(QAbstractItemModel *devicesModel) +void DevicesSortProxyModel::setSourceModel(QAbstractItemModel* devicesModel) { QSortFilterProxyModel::setSourceModel(devicesModel); if (devicesModel) { diff --git a/interfaces/modeltest.h b/interfaces/modeltest.h --- a/interfaces/modeltest.h +++ b/interfaces/modeltest.h @@ -33,7 +33,7 @@ Q_OBJECT public: - explicit ModelTest(QAbstractItemModel *model, QObject *parent = 0); + explicit ModelTest(QAbstractItemModel* model, QObject* parent = 0); private Q_SLOTS: void nonDestructiveBasicTest(); @@ -48,15 +48,15 @@ void runAllTests(); void layoutAboutToBeChanged(); void layoutChanged(); - void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end); + void rowsAboutToBeInserted(const QModelIndex& parent, int start, int end); void rowsInserted(const QModelIndex & parent, int start, int end); - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end); void rowsRemoved(const QModelIndex & parent, int start, int end); private: - void checkChildren(const QModelIndex &parent, int currentDepth = 0); + void checkChildren(const QModelIndex& parent, int currentDepth = 0); - QAbstractItemModel *model; + QAbstractItemModel* model; struct Changing { diff --git a/interfaces/modeltest.cpp b/interfaces/modeltest.cpp --- a/interfaces/modeltest.cpp +++ b/interfaces/modeltest.cpp @@ -30,7 +30,7 @@ /*! Connect to all of the models signals. Whenever anything happens recheck everything. */ -ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(parent), model(_model), fetchingMore(false) +ModelTest::ModelTest(QAbstractItemModel *_model, QObject* parent) : QObject(parent), model(_model), fetchingMore(false) { Q_ASSERT(model); @@ -215,7 +215,7 @@ Q_ASSERT(model->index(rows, columns) == QModelIndex()); Q_ASSERT(model->index(0, 0).isValid() == true); - // Make sure that the same index is *always* returned + // Make sure that the same index is* always* returned QModelIndex a = model->index(0, 0); QModelIndex b = model->index(0, 0); Q_ASSERT(a == b); diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -132,7 +132,7 @@ } QDBusPendingReply pendingNotificationIds = m_dbusInterface->activeNotifications(); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingNotificationIds, this); + QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pendingNotificationIds, this); QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &NotificationsModel::receivedNotifications); diff --git a/kcm/kcm.h b/kcm/kcm.h --- a/kcm/kcm.h +++ b/kcm/kcm.h @@ -39,7 +39,7 @@ { Q_OBJECT public: - KdeConnectKcm(QWidget *parent, const QVariantList&); + KdeConnectKcm(QWidget* parent, const QVariantList&); ~KdeConnectKcm() override; private: diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -46,14 +46,14 @@ static QString createId() { return QStringLiteral("kcm")+QString::number(QCoreApplication::applicationPid()); } -KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) +KdeConnectKcm::KdeConnectKcm(QWidget* parent, const QVariantList&) : KCModule(KAboutData::pluginData(QStringLiteral("kdeconnect-kcm")), parent) , kcmUi(new Ui::KdeConnectKcmUi()) , daemon(new DaemonDbusInterface(this)) , devicesModel(new DevicesModel(this)) , currentDevice(nullptr) { - KAboutData *about = new KAboutData(QStringLiteral("kdeconnect-kcm"), + KAboutData* about = new KAboutData(QStringLiteral("kdeconnect-kcm"), i18n("KDE Connect Settings"), QStringLiteral(KDECONNECT_VERSION_STRING), i18n("KDE Connect Settings module"), diff --git a/kcm/kcm_kdeconnect.desktop b/kcm/kcm_kdeconnect.desktop --- a/kcm/kcm_kdeconnect.desktop +++ b/kcm/kcm_kdeconnect.desktop @@ -24,7 +24,6 @@ Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[et]=KDE Connect -Name[eu]=KDE Connect Name[fi]=KDE Connect Name[fr]=KDE Connect Name[gl]=KDE Connect @@ -63,7 +62,6 @@ Comment[en_GB]=Connect and sync your devices Comment[es]=Conecte y sincronice sus dispositivos Comment[et]=Oma seadmete ühendamine ja sünkroonimine -Comment[eu]=Konektatu eta sinkronizatu zure gailuak Comment[fi]=Yhdistä ja synkronoi laitteitasi Comment[fr]=Connectez et synchronisez vos périphériques Comment[gl]=Conecte e sincronice os seus dispositivos. @@ -103,7 +101,6 @@ X-KDE-Keywords[en_GB]=Network,Android,Devices X-KDE-Keywords[es]=Red,Android,Dispositivos X-KDE-Keywords[et]=Võrk,Android,Seadmed -X-KDE-Keywords[eu]=Sarea,Android,Gailuak X-KDE-Keywords[fi]=Verkko,Android,Laitteet X-KDE-Keywords[fr]=Réseau,Android,Périphériques X-KDE-Keywords[gl]=rede,Android,dispositivos diff --git a/kcm/org.kde.kdeconnect.kcm.desktop b/kcm/org.kde.kdeconnect.kcm.desktop --- a/kcm/org.kde.kdeconnect.kcm.desktop +++ b/kcm/org.kde.kdeconnect.kcm.desktop @@ -15,7 +15,6 @@ Name[en_GB]=KDE Connect Settings Name[es]=Ajustes de KDE Connect Name[et]=KDE Connecti seadistused -Name[eu]=KDE Connect ezarpenak Name[fi]=KDE Connectin asetukset Name[fr]=Paramètres de KDE Connect Name[gl]=Configuración de KDE Connect @@ -52,7 +51,6 @@ GenericName[en_GB]=Connect and sync your devices GenericName[es]=Conecte y sincronice sus dispositivos GenericName[et]=Oma seadmete ühendamine ja sünkroonimine -GenericName[eu]=Konektatu eta sinkronizatu zure gailuak GenericName[fi]=Yhdistä ja synkronoi laitteitasi GenericName[fr]=Connectez et synchronisez vos périphériques GenericName[gl]=Conecte e sincronice os seus dispositivos diff --git a/kcmplugin/kdeconnectpluginkcm.cpp b/kcmplugin/kdeconnectpluginkcm.cpp --- a/kcmplugin/kdeconnectpluginkcm.cpp +++ b/kcmplugin/kdeconnectpluginkcm.cpp @@ -25,9 +25,9 @@ struct KdeConnectPluginKcmPrivate { - QString mDeviceId; - QString mPluginName; - KdeConnectPluginConfig* mConfig; + QString m_deviceId; + QString m_pluginName; + KdeConnectPluginConfig* m_config; }; KdeConnectPluginKcm::KdeConnectPluginKcm(QWidget* parent, const QVariantList& args, const QString& componentName) @@ -35,26 +35,26 @@ , d(new KdeConnectPluginKcmPrivate()) { - d->mDeviceId = args.at(0).toString(); + d->m_deviceId = args.at(0).toString(); //The parent of the config should be the plugin itself - d->mPluginName = KService::serviceByDesktopName(componentName).constData()->property(QStringLiteral("X-KDE-ParentComponents")).toString(); + d->m_pluginName = KService::serviceByDesktopName(componentName).constData()->property(QStringLiteral("X-KDE-ParentComponents")).toString(); - d->mConfig = new KdeConnectPluginConfig(d->mDeviceId, d->mPluginName); + d->m_config = new KdeConnectPluginConfig(d->m_deviceId, d->m_pluginName); } KdeConnectPluginKcm::~KdeConnectPluginKcm() { - delete d->mConfig; + delete d->m_config; } KdeConnectPluginConfig* KdeConnectPluginKcm::config() const { - return d->mConfig; + return d->m_config; } QString KdeConnectPluginKcm::deviceId() const { - return d->mDeviceId; + return d->m_deviceId; } diff --git a/kio/kiokdeconnect.h b/kio/kiokdeconnect.h --- a/kio/kiokdeconnect.h +++ b/kio/kiokdeconnect.h @@ -35,13 +35,13 @@ Q_OBJECT public: - KioKdeconnect(const QByteArray &pool, const QByteArray &app); + KioKdeconnect(const QByteArray& pool, const QByteArray& app); - void get(const QUrl &url) override; - void listDir(const QUrl &url) override; - void stat(const QUrl &url) override; + void get(const QUrl& url) override; + void listDir(const QUrl& url) override; + void stat(const QUrl& url) override; - void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass) override; + void setHost(const QString& constHostname, quint16 port, const QString& user, const QString& pass) override; void listAllDevices(); //List all devices exported by m_dbusInterface void listDevice(); //List m_currentDevice @@ -57,7 +57,7 @@ /** * KDED DBus interface, used to communicate to the daemon since we need some status (like connected) */ - DaemonDbusInterface *m_dbusInterface; + DaemonDbusInterface* m_dbusInterface; }; diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -30,7 +30,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") -extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv) +extern "C" int Q_DECL_EXPORT kdemain(int argc, char** argv) { if (argc != 4) { fprintf(stderr, "Usage: kio_kdeconnect protocol pool app\n"); @@ -72,7 +72,7 @@ return false; } -KioKdeconnect::KioKdeconnect(const QByteArray &pool, const QByteArray &app) +KioKdeconnect::KioKdeconnect(const QByteArray& pool, const QByteArray& app) : SlaveBase("kdeconnect", pool, app), m_dbusInterface(new DaemonDbusInterface(this)) { @@ -177,7 +177,7 @@ -void KioKdeconnect::listDir(const QUrl &url) +void KioKdeconnect::listDir(const QUrl& url) { qCDebug(KDECONNECT_KIO) << "Listing..." << url; @@ -198,7 +198,7 @@ } } -void KioKdeconnect::stat(const QUrl &url) +void KioKdeconnect::stat(const QUrl& url) { qCDebug(KDECONNECT_KIO) << "Stat: " << url; @@ -209,14 +209,14 @@ finished(); } -void KioKdeconnect::get(const QUrl &url) +void KioKdeconnect::get(const QUrl& url) { qCDebug(KDECONNECT_KIO) << "Get: " << url; mimeType(QLatin1String("")); finished(); } -void KioKdeconnect::setHost(const QString &hostName, quint16 port, const QString &user, const QString &pass) +void KioKdeconnect::setHost(const QString& hostName, quint16 port, const QString& user, const QString& pass) { //This is called before everything else to set the file we want to show diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h @@ -30,7 +30,7 @@ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") void registerTypes(const char* uri) override; - void initializeEngine(QQmlEngine *engine, const char *uri) override; + void initializeEngine(QQmlEngine* engine, const char* uri) override; }; #endif // KDECONNECTDECLARATIVEPLUGIN_H diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp @@ -34,42 +34,42 @@ #include "interfaces/devicesmodel.h" #include "interfaces/notificationsmodel.h" -QObject* createDeviceDbusInterface(const QVariant &deviceId) +QObject* createDeviceDbusInterface(const QVariant& deviceId) { return new DeviceDbusInterface(deviceId.toString()); } -QObject* createDeviceBatteryDbusInterface(const QVariant &deviceId) +QObject* createDeviceBatteryDbusInterface(const QVariant& deviceId) { return new DeviceBatteryDbusInterface(deviceId.toString()); } -QObject* createFindMyPhoneInterface(const QVariant &deviceId) +QObject* createFindMyPhoneInterface(const QVariant& deviceId) { return new FindMyPhoneDeviceDbusInterface(deviceId.toString()); } -QObject* createRemoteKeyboardInterface(const QVariant &deviceId) +QObject* createRemoteKeyboardInterface(const QVariant& deviceId) { return new RemoteKeyboardDbusInterface(deviceId.toString()); } -QObject* createSftpInterface(const QVariant &deviceId) +QObject* createSftpInterface(const QVariant& deviceId) { return new SftpDbusInterface(deviceId.toString()); } -QObject* createRemoteControlInterface(const QVariant &deviceId) +QObject* createRemoteControlInterface(const QVariant& deviceId) { return new RemoteControlDbusInterface(deviceId.toString()); } -QObject* createMprisInterface(const QVariant &deviceId) +QObject* createMprisInterface(const QVariant& deviceId) { return new MprisDbusInterface(deviceId.toString()); } -QObject* createDeviceLockInterface(const QVariant &deviceId) +QObject* createDeviceLockInterface(const QVariant& deviceId) { Q_ASSERT(!deviceId.toString().isEmpty()); return new LockDeviceDbusInterface(deviceId.toString()); diff --git a/plasmoid/declarativeplugin/objectfactory.h b/plasmoid/declarativeplugin/objectfactory.h --- a/plasmoid/declarativeplugin/objectfactory.h +++ b/plasmoid/declarativeplugin/objectfactory.h @@ -26,12 +26,12 @@ return nullptr; } - Q_INVOKABLE QObject* create(const QVariant &arg1) { + Q_INVOKABLE QObject* create(const QVariant& arg1) { if (m_f1) return m_f1(arg1); return nullptr; } - Q_INVOKABLE QObject* create(const QVariant &arg1, const QVariant &arg2) { + Q_INVOKABLE QObject* create(const QVariant& arg1, const QVariant& arg2) { if (m_f2) return m_f2(arg1, arg2); return nullptr; } diff --git a/plasmoid/declarativeplugin/processrunner.h b/plasmoid/declarativeplugin/processrunner.h --- a/plasmoid/declarativeplugin/processrunner.h +++ b/plasmoid/declarativeplugin/processrunner.h @@ -27,7 +27,7 @@ Q_OBJECT public: - explicit ProcessRunner(QObject *parent = nullptr); + explicit ProcessRunner(QObject* parent = nullptr); ~ProcessRunner() override; Q_INVOKABLE void runKdeconnectKCM(); diff --git a/plasmoid/declarativeplugin/processrunner.cpp b/plasmoid/declarativeplugin/processrunner.cpp --- a/plasmoid/declarativeplugin/processrunner.cpp +++ b/plasmoid/declarativeplugin/processrunner.cpp @@ -21,7 +21,7 @@ #include -ProcessRunner::ProcessRunner(QObject *parent) : QObject(parent) +ProcessRunner::ProcessRunner(QObject* parent) : QObject(parent) { } diff --git a/plasmoid/declarativeplugin/responsewaiter.h b/plasmoid/declarativeplugin/responsewaiter.h --- a/plasmoid/declarativeplugin/responsewaiter.h +++ b/plasmoid/declarativeplugin/responsewaiter.h @@ -45,8 +45,8 @@ bool autodelete() const {return m_autodelete;} Q_SIGNALS: - void success(const QVariant &result); - void error(const QString &message); + void success(const QVariant& result); + void error(const QString& message); private Q_SLOTS: void onCallFinished(QDBusPendingCallWatcher* watcher); diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -13,7 +13,6 @@ Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[et]=KDE Connect -Name[eu]=KDE Connect Name[fi]=KDE Connect Name[fr]=KDE Connect Name[gl]=KDE Connect @@ -53,7 +52,6 @@ Comment[en_GB]=Show notifications from your devices using KDE Connect Comment[es]=Mostrar notificaciones de sus dispositivos usando KDE Connect Comment[et]=Seadmete märguannete näitamine KDE Connecti vahendusel -Comment[eu]=Ikusi zure gailuetako jakinarazpenak KDE Connect erabiliz Comment[fi]=Näytä laitteidesi ilmoitukset KDE Connectilla Comment[fr]=Afficher les notifications provenant de vos périphériques à l'aide de KDE Connect Comment[gl]=Mostrar notificacións de dispositivos usando KDE Connect. diff --git a/plugins/battery/batterydbusinterface.h b/plugins/battery/batterydbusinterface.h --- a/plugins/battery/batterydbusinterface.h +++ b/plugins/battery/batterydbusinterface.h @@ -32,11 +32,11 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.battery") public: - explicit BatteryDbusInterface(const Device *device); + explicit BatteryDbusInterface(const Device* device); ~BatteryDbusInterface() override; - Q_SCRIPTABLE int charge() const { return mCharge; } - Q_SCRIPTABLE bool isCharging() const { return mIsCharging; } + Q_SCRIPTABLE int charge() const { return m_charge; } + Q_SCRIPTABLE bool isCharging() const { return m_isCharging; } void updateValues(bool isCharging, int currentCharge); @@ -45,8 +45,8 @@ Q_SCRIPTABLE void chargeChanged(int charge); private: - int mCharge; - bool mIsCharging; + int m_charge; + bool m_isCharging; // Map to save current BatteryDbusInterface for each device. static QMap s_dbusInterfaces; diff --git a/plugins/battery/batterydbusinterface.cpp b/plugins/battery/batterydbusinterface.cpp --- a/plugins/battery/batterydbusinterface.cpp +++ b/plugins/battery/batterydbusinterface.cpp @@ -26,10 +26,10 @@ QMap BatteryDbusInterface::s_dbusInterfaces; -BatteryDbusInterface::BatteryDbusInterface(const Device *device) +BatteryDbusInterface::BatteryDbusInterface(const Device* device) : QDBusAbstractAdaptor(const_cast(device)) - , mCharge(-1) - , mIsCharging(false) + , m_charge(-1) + , m_isCharging(false) { // FIXME: Workaround to prevent memory leak. // This makes the old BatteryDdbusInterface be deleted only after the new one is @@ -53,11 +53,11 @@ void BatteryDbusInterface::updateValues(bool isCharging, int currentCharge) { - mIsCharging = isCharging; - mCharge = currentCharge; + m_isCharging = isCharging; + m_charge = currentCharge; - Q_EMIT stateChanged(mIsCharging); - Q_EMIT chargeChanged(mCharge); + Q_EMIT stateChanged(m_isCharging); + Q_EMIT chargeChanged(m_charge); } diff --git a/plugins/battery/batteryplugin.h b/plugins/battery/batteryplugin.h --- a/plugins/battery/batteryplugin.h +++ b/plugins/battery/batteryplugin.h @@ -35,7 +35,7 @@ Q_OBJECT public: - explicit BatteryPlugin(QObject *parent, const QVariantList &args); + explicit BatteryPlugin(QObject* parent, const QVariantList& args); ~BatteryPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/battery/batteryplugin.cpp b/plugins/battery/batteryplugin.cpp --- a/plugins/battery/batteryplugin.cpp +++ b/plugins/battery/batteryplugin.cpp @@ -31,7 +31,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BATTERY, "kdeconnect.plugin.battery") -BatteryPlugin::BatteryPlugin(QObject *parent, const QVariantList &args) +BatteryPlugin::BatteryPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , batteryDbusInterface(new BatteryDbusInterface(device())) { diff --git a/plugins/battery/kdeconnect_battery.json b/plugins/battery/kdeconnect_battery.json --- a/plugins/battery/kdeconnect_battery.json +++ b/plugins/battery/kdeconnect_battery.json @@ -22,7 +22,6 @@ "Description[el]": "Εμφάνιση μπαταρίας συσκευής δίπλα στη μπαταρία του υπολογιστή", "Description[es]": "Mostrar la batería del teléfono junto a la batería del equipo", "Description[et]": "Telefoniaku näitamine otse arvutiaku kõrval", - "Description[eu]": "Erakutsi telefonoaren bateria ordenagailuaren bateriaren ondoan", "Description[fi]": "Näytä puhelimesi akku tietokoneen akun rinnalla", "Description[fr]": "Affichez la batterie de votre téléphone à côté de la batterie de votre ordinateur", "Description[gl]": "Mostra o nivel de batería do teléfono canda o nivel de batería do computador.", @@ -60,7 +59,6 @@ "Name[el]": "Παρακολούθηση μπαταρίας", "Name[es]": "Monitor de batería", "Name[et]": "Aku jälgija", - "Name[eu]": "Bateriaren monitorea", "Name[fi]": "Akkuvalvonta", "Name[fr]": "Moniteur de batterie", "Name[gl]": "Vixilante da batería", diff --git a/plugins/clipboard/clipboardplugin.h b/plugins/clipboard/clipboardplugin.h --- a/plugins/clipboard/clipboardplugin.h +++ b/plugins/clipboard/clipboardplugin.h @@ -35,7 +35,7 @@ Q_OBJECT public: - explicit ClipboardPlugin(QObject *parent, const QVariantList &args); + explicit ClipboardPlugin(QObject* parent, const QVariantList& args); bool receivePackage(const NetworkPackage& np) override; void connected() override { } diff --git a/plugins/clipboard/clipboardplugin.cpp b/plugins/clipboard/clipboardplugin.cpp --- a/plugins/clipboard/clipboardplugin.cpp +++ b/plugins/clipboard/clipboardplugin.cpp @@ -28,7 +28,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_CLIPBOARD, "kdeconnect.plugin.clipboard") -ClipboardPlugin::ClipboardPlugin(QObject *parent, const QVariantList &args) +ClipboardPlugin::ClipboardPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { connect(ClipboardListener::instance(), &ClipboardListener::clipboardChanged, diff --git a/plugins/clipboard/kdeconnect_clipboard.json b/plugins/clipboard/kdeconnect_clipboard.json --- a/plugins/clipboard/kdeconnect_clipboard.json +++ b/plugins/clipboard/kdeconnect_clipboard.json @@ -22,7 +22,6 @@ "Description[el]": "Διαμοιρασμός του προχείρου μεταξύ συσκευών", "Description[es]": "Compartir portapapeles entre dispositivos", "Description[et]": "Lõikepuhvri jagamine seadmete vahel", - "Description[eu]": "Partekatu arbela gailuen artean", "Description[fi]": "Jaa leikepöytä laitteiden välillä", "Description[fr]": "Partagez le presse-papiers entre périphériques", "Description[gl]": "Comparta o portapapeis entre os dispositivos.", @@ -60,7 +59,6 @@ "Name[el]": "Πρόχειρο", "Name[es]": "Portapapeles", "Name[et]": "Lõikepuhver", - "Name[eu]": "Arbela", "Name[fi]": "Leikepöytä", "Name[fr]": "Presse-papiers", "Name[gl]": "Portapapeis", diff --git a/plugins/findmyphone/findmyphoneplugin.h b/plugins/findmyphone/findmyphoneplugin.h --- a/plugins/findmyphone/findmyphoneplugin.h +++ b/plugins/findmyphone/findmyphoneplugin.h @@ -34,7 +34,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.findmyphone") public: - explicit FindMyPhonePlugin(QObject *parent, const QVariantList &args); + explicit FindMyPhonePlugin(QObject* parent, const QVariantList& args); ~FindMyPhonePlugin() override; Q_SCRIPTABLE void ring(); diff --git a/plugins/findmyphone/kdeconnect_findmyphone.json b/plugins/findmyphone/kdeconnect_findmyphone.json --- a/plugins/findmyphone/kdeconnect_findmyphone.json +++ b/plugins/findmyphone/kdeconnect_findmyphone.json @@ -30,7 +30,6 @@ "Description[el]": "Βρείτε το χαμένο σας τηλέφωνο με ηχητική ειδοποίηση", "Description[es]": "Encuentre su teléfono perdido haciéndole reproducir un sonido de alarma", "Description[et]": "Kaotsi läinud telefoni leidmine sellel häireheli esitamisega", - "Description[eu]": "Aurkitu galdutako telefonoa alarma-soinu bat jo araziz", "Description[fi]": "Löydä hukkaamasi puhelin laittamalla se soittamaan hälytysääntä", "Description[fr]": "Trouver votre téléphone perdu en déclenchant une alarme", "Description[gl]": "Reproducir un son de alarma nun teléfono móbil perdido para atopalo.", @@ -68,7 +67,6 @@ "Name[el]": "Κουδούνισμα του τηλεφώνου μου", "Name[es]": "Hacer sonar mi teléfono", "Name[et]": "Helista minu telefonile", - "Name[eu]": "Jo nire telefonoaren dei-doinua", "Name[fi]": "Soita puhelimeeni", "Name[fr]": "Faire sonner mon téléphone", "Name[gl]": "Facer soar o meu móbil", diff --git a/plugins/kdeconnect.notifyrc b/plugins/kdeconnect.notifyrc --- a/plugins/kdeconnect.notifyrc +++ b/plugins/kdeconnect.notifyrc @@ -14,7 +14,6 @@ Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[et]=KDE Connect -Name[eu]=KDE Connect Name[fi]=KDE Connect Name[fr]=KDE Connect Name[gl]=KDE Connect @@ -54,7 +53,6 @@ Comment[en_GB]=Notifications from your devices Comment[es]=Notificaciones de sus dispositivos Comment[et]=Seadmete märguanded -Comment[eu]=Zure gailuetako jakinarazpenak Comment[fi]=Laitteesi ilmoitukset Comment[fr]=Notifications provenant de vos périphériques Comment[gl]=Notificacións de dispositivos. @@ -96,7 +94,6 @@ Name[en_GB]=Pairing Request Name[es]=Petición de vinculación Name[et]=Paardumissoov -Name[eu]=Parekatzeko eskaria Name[fi]=Paripyyntö Name[fr]=Demande d'association Name[gl]=Solicitude de emparellamento @@ -133,7 +130,6 @@ Comment[en_GB]=Pairing request received from a device Comment[es]=Petición de vinculación recibida desde un dispositivo Comment[et]=Seadmelt saadi paardumissoov -Comment[eu]=Parekatzeko eskaria jaso da gailu batetik Comment[fi]=Saatiin paripyyntö laitteelta Comment[fr]=Demande d'association provenant d'un périphérique Comment[gl]=Recibiuse unha solicitude de emparellamento dun dispositivo. @@ -173,7 +169,6 @@ Name[en_GB]=Incoming Call Name[es]=Llamada entrante Name[et]=Sisenev kõne -Name[eu]=Sarrerako deia Name[fi]=Saapuva puhelu Name[fr]=Appel entrant Name[gl]=Chamada entrante @@ -213,7 +208,6 @@ Comment[en_GB]=Someone is calling you Comment[es]=Alguien le está llamando Comment[et]=Keegi helistab sulle -Comment[eu]=Norbait deitzen ari zaizu Comment[fi]=Sinulle soitetaan Comment[fr]=Quelqu'un vous appelle Comment[gl]=Está a recibir unha chamada de alguén. @@ -255,7 +249,6 @@ Name[en_GB]=Missed Call Name[es]=Llamada perdida Name[et]=Vastamata kõne -Name[eu]=Galdutako deia Name[fi]=Vastaamaton puhelu Name[fr]=Appel manqué Name[gl]=Chamada perdida @@ -294,7 +287,6 @@ Comment[en_GB]=You have a missed call Comment[es]=Tiene una llamada perdida Comment[et]=Kõnele jäi vastamata -Comment[eu]=Galdutako dei bat duzu Comment[fi]=Sinulla on vastaamaton puhelu Comment[fr]=Vous avez un appel manqué Comment[gl]=Ten unha chamada perdida. @@ -336,7 +328,6 @@ Name[en_GB]=SMS Received Name[es]=SMS recibido Name[et]=SMS-i saamine -Name[eu]=SMS bat jaso da Name[fi]=Saatiin tekstiviesti Name[fr]=SMS reçu Name[gl]=Recibiuse un SMS @@ -375,7 +366,6 @@ Comment[en_GB]=Someone sent you an SMS Comment[es]=Alguien le ha enviado un SMS Comment[et]=Keegi saatis sulle SMS-i -Comment[eu]=Norbaitek SMS bat bidali dizu Comment[fi]=Sinulle lähetettiin tekstiviesti Comment[fr]=Quelqu'un vous a envoyé un SMS Comment[gl]=Recibiu unha mensaxe SMS de alguén. @@ -417,7 +407,6 @@ Name[en_GB]=Battery Low Name[es]=Batería baja Name[et]=Aku laetus on madal -Name[eu]=Bateria baxu Name[fi]=Akku vähissä Name[fr]=Batterie faible Name[gl]=Batería baixa @@ -456,7 +445,6 @@ Comment[en_GB]=Your battery is in low state Comment[es]=La batería está en nivel bajo Comment[et]=Aku täituvus on madal -Comment[eu]=Zure bateria egoera baxuan dago Comment[fi]=Akkusi virta on vähissä Comment[fr]=Votre batterie est faible Comment[gl]=A batería está esgotándose. @@ -498,7 +486,6 @@ Name[en_GB]=Ping Received Name[es]=Ping recibido Name[et]=Pingi saamine -Name[eu]=Ping jaso da Name[fi]=Saatiin tiedustelupaketti Name[fr]=Ping reçu Name[gl]=Recibiuse un ping @@ -537,7 +524,6 @@ Comment[en_GB]=Ping received Comment[es]=Ping recibido Comment[et]=Pingi saamine -Comment[eu]=Ping jaso da Comment[fi]=Saatiin tiedustelupaketti Comment[fr]=Ping reçu Comment[gl]=Recibiuse un “ping”. @@ -579,7 +565,6 @@ Name[en_GB]=Generic Notification Name[es]=Notificación genérica Name[et]=Üldine märguanne -Name[eu]=Jakinarazpen arrunta Name[fi]=Yleinen ilmoitus Name[fr]=Notification Name[gl]=Notificación xenérica @@ -618,7 +603,6 @@ Comment[en_GB]=Notification received Comment[es]=Notificación recibida Comment[et]=Saadi märguanne -Comment[eu]=Jakinarazpena jaso da Comment[fi]=Saatiin ilmoitus Comment[fr]=Notification reçue Comment[gl]=Recibiuse unha notificación. @@ -660,7 +644,6 @@ Name[en_GB]=File Transfer Name[es]=Transferencia de archivo Name[et]=Failiedastus -Name[eu]=Fitxategi-transferentzia Name[fi]=Tiedostonsiirto Name[fr]=Transfert de fichiers Name[gl]=Transferencia dun ficheiro @@ -699,7 +682,6 @@ Comment[en_GB]=Incoming file Comment[es]=Archivo entrante Comment[et]=Sisenev fail -Comment[eu]=Sarrerako fitxategia Comment[fi]=Saapuva tiedosto Comment[fr]=Fichier entrant Comment[gl]=Ficheiro entrante diff --git a/plugins/kdeconnect_plugin.desktop b/plugins/kdeconnect_plugin.desktop --- a/plugins/kdeconnect_plugin.desktop +++ b/plugins/kdeconnect_plugin.desktop @@ -16,7 +16,6 @@ Name[en_GB]=KDEConnect Plugin Name[es]=Complemento de KDEConnect Name[et]=KDEConnecti plugin -Name[eu]=KDEConnect plugina Name[fi]=KDE Connect -liitännäinen Name[fr]=Module externe KDEConnect Name[gl]=Complemento de KDE Connect diff --git a/plugins/lockdevice/kdeconnect_lockdevice.json b/plugins/lockdevice/kdeconnect_lockdevice.json --- a/plugins/lockdevice/kdeconnect_lockdevice.json +++ b/plugins/lockdevice/kdeconnect_lockdevice.json @@ -22,7 +22,6 @@ "Description[el]": "Κλειδώνει τα συστήματά σας", "Description[es]": "Bloquear sus sistemas", "Description[et]": "Oma süsteemide lukustamine", - "Description[eu]": "Zure sistemak blokeatzen ditu", "Description[fi]": "Lukitsee järjestelmäsi", "Description[fr]": "Bloque votre système", "Description[gl]": "Bloquea os seus sistemas.", @@ -58,7 +57,6 @@ "Name[de]": "Gerätesperrung", "Name[es]": "Bloquear dispositivo", "Name[et]": "Seadme lukustamine", - "Name[eu]": "BlokeatuGailua", "Name[fi]": "Lukitse laite", "Name[gl]": "Bloqueo do dispositivo", "Name[it]": "Blocco dispositivo", diff --git a/plugins/lockdevice/lockdeviceplugin.h b/plugins/lockdevice/lockdeviceplugin.h --- a/plugins/lockdevice/lockdeviceplugin.h +++ b/plugins/lockdevice/lockdeviceplugin.h @@ -38,7 +38,7 @@ Q_PROPERTY(bool isLocked READ isLocked WRITE setLocked NOTIFY lockedChanged) public: - explicit LockDevicePlugin(QObject *parent, const QVariantList &args); + explicit LockDevicePlugin(QObject* parent, const QVariantList &args); ~LockDevicePlugin() override; bool isLocked() const; diff --git a/plugins/mousepad/kdeconnect_mousepad.json b/plugins/mousepad/kdeconnect_mousepad.json --- a/plugins/mousepad/kdeconnect_mousepad.json +++ b/plugins/mousepad/kdeconnect_mousepad.json @@ -23,7 +23,6 @@ "Description[el]": "Χρήση του τηλεφώνου σας ως οθόνη αφής και πληκτρολογίου", "Description[es]": "Usar teléfono como panel táctil y teclado", "Description[et]": "Telefoni kasutamine puutepadja ja klaviatuurina", - "Description[eu]": "Erabili zure telefonoa touchpad eta teklatu gisa", "Description[fi]": "Käytä puhelintasi kosketuslevynä ja näppäimistönä", "Description[fr]": "Utilisez votre téléphone comme un pavé tactile et un clavier", "Description[gl]": "Usar o teléfono móbil como touchpad e teclado.", @@ -61,7 +60,6 @@ "Name[el]": "Εικονικά στοιχεία εισόδου", "Name[es]": "Entrada virtual", "Name[et]": "Virtuaalsisestus", - "Name[eu]": "Sarrera birtuala", "Name[fi]": "Virtuaalinen syöttö", "Name[fr]": "Entrée virtuelle", "Name[gl]": "Entrada virtual", diff --git a/plugins/mousepad/mousepadplugin.h b/plugins/mousepad/mousepadplugin.h --- a/plugins/mousepad/mousepadplugin.h +++ b/plugins/mousepad/mousepadplugin.h @@ -43,7 +43,7 @@ Q_OBJECT public: - explicit MousepadPlugin(QObject *parent, const QVariantList &args); + explicit MousepadPlugin(QObject* parent, const QVariantList& args); ~MousepadPlugin() override; bool receivePackage(const NetworkPackage& np) override; @@ -63,7 +63,7 @@ #endif const bool m_x11; #if HAVE_WAYLAND - KWayland::Client::FakeInput *m_waylandInput; + KWayland::Client::FakeInput* m_waylandInput; bool m_waylandAuthenticationRequested; #endif }; diff --git a/plugins/mousepad/mousepadplugin.cpp b/plugins/mousepad/mousepadplugin.cpp --- a/plugins/mousepad/mousepadplugin.cpp +++ b/plugins/mousepad/mousepadplugin.cpp @@ -153,7 +153,7 @@ #endif #if HAVE_X11 -bool MousepadPlugin::handlePackageX11(const NetworkPackage &np) +bool MousepadPlugin::handlePackageX11(const NetworkPackage& np) { //qDebug() << np.serialize(); @@ -173,7 +173,7 @@ int specialKey = np.get(QStringLiteral("specialKey"), 0); if (isSingleClick || isDoubleClick || isMiddleClick || isRightClick || isSingleHold || isScroll || !key.isEmpty() || specialKey) { - Display *display = QX11Info::display(); + Display* display = QX11Info::display(); if(!display) { return false; } @@ -274,12 +274,12 @@ return; } using namespace KWayland::Client; - ConnectionThread *connection = ConnectionThread::fromApplication(this); + ConnectionThread* connection = ConnectionThread::fromApplication(this); if (!connection) { // failed to get the Connection from Qt return; } - Registry *registry = new Registry(this); + Registry* registry = new Registry(this); registry->create(connection); connect(registry, &Registry::fakeInputAnnounced, this, [this, registry] (quint32 name, quint32 version) { @@ -289,7 +289,7 @@ registry->setup(); } -bool MousepadPlugin::handPackageWayland(const NetworkPackage &np) +bool MousepadPlugin::handPackageWayland(const NetworkPackage& np) { const float dx = np.get(QStringLiteral("dx"), 0); const float dy = np.get(QStringLiteral("dy"), 0); diff --git a/plugins/mousepad_windows/kdeconnect_mousepad.json b/plugins/mousepad_windows/kdeconnect_mousepad.json --- a/plugins/mousepad_windows/kdeconnect_mousepad.json +++ b/plugins/mousepad_windows/kdeconnect_mousepad.json @@ -23,7 +23,6 @@ "Description[el]": "Χρήση του τηλεφώνου σας ως οθόνη αφής και πληκτρολογίου", "Description[es]": "Usar teléfono como panel táctil y teclado", "Description[et]": "Telefoni kasutamine puutepadja ja klaviatuurina", - "Description[eu]": "Erabili zure telefonoa touchpad eta teklatu gisa", "Description[fi]": "Käytä puhelintasi kosketuslevynä ja näppäimistönä", "Description[fr]": "Utilisez votre téléphone comme un pavé tactile et un clavier", "Description[gl]": "Usar o teléfono móbil como touchpad e teclado.", @@ -61,7 +60,6 @@ "Name[el]": "Εικονικά στοιχεία εισόδου", "Name[es]": "Entrada virtual", "Name[et]": "Virtuaalsisestus", - "Name[eu]": "Sarrera birtuala", "Name[fi]": "Virtuaalinen syöttö", "Name[fr]": "Entrée virtuelle", "Name[gl]": "Entrada virtual", diff --git a/plugins/mousepad_windows/mousepadplugin_windows.h b/plugins/mousepad_windows/mousepadplugin_windows.h --- a/plugins/mousepad_windows/mousepadplugin_windows.h +++ b/plugins/mousepad_windows/mousepadplugin_windows.h @@ -32,7 +32,7 @@ Q_OBJECT public: - explicit MousepadPlugin(QObject *parent, const QVariantList &args); + explicit MousepadPlugin(QObject* parent, const QVariantList &args); ~MousepadPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/mpriscontrol/kdeconnect_mpriscontrol.json b/plugins/mpriscontrol/kdeconnect_mpriscontrol.json --- a/plugins/mpriscontrol/kdeconnect_mpriscontrol.json +++ b/plugins/mpriscontrol/kdeconnect_mpriscontrol.json @@ -22,7 +22,6 @@ "Description[el]": "Απομακρυσμένος έλεγχος της μουσικής σας και των βίντεο", "Description[es]": "Controlar remotamente vídeos y música", "Description[et]": "Oma muusika ja videote kaugjuhtimine", - "Description[eu]": "Kontrolatu urrunetik zure musika eta bideoak", "Description[fi]": "Kauko-ohjain musiikkiisi ja videoihisi", "Description[fr]": "Contrôlez à distance votre musique et vos vidéos", "Description[gl]": "Use o teléfono móbil como mando a distancia para música e vídeos.", @@ -60,7 +59,6 @@ "Name[el]": "Δέκτης ελέγχου πολυμέσων", "Name[es]": "Receptor de control multimedia", "Name[et]": "Multimeedia juhtimine", - "Name[eu]": "Multimedia-kontroladore hartzailea", "Name[fi]": "Multimediakauko-ohjain", "Name[fr]": "Receveur de contrôle multimédia", "Name[gl]": "Receptor de controis multimedia", diff --git a/plugins/mpriscontrol/mpriscontrolplugin.h b/plugins/mpriscontrol/mpriscontrolplugin.h --- a/plugins/mpriscontrol/mpriscontrolplugin.h +++ b/plugins/mpriscontrol/mpriscontrolplugin.h @@ -38,7 +38,7 @@ Q_OBJECT public: - explicit MprisControlPlugin(QObject *parent, const QVariantList &args); + explicit MprisControlPlugin(QObject* parent, const QVariantList& args); bool receivePackage(const NetworkPackage& np) override; void connected() override { } diff --git a/plugins/mprisremote/kdeconnect_mprisremote.json b/plugins/mprisremote/kdeconnect_mprisremote.json --- a/plugins/mprisremote/kdeconnect_mprisremote.json +++ b/plugins/mprisremote/kdeconnect_mprisremote.json @@ -22,7 +22,6 @@ "Description[el]": "Έλεγχος υπηρεσιών MPRIS", "Description[es]": "Controlar los servicios MPRIS", "Description[et]": "MPRIS-teenuste juhtimine", - "Description[eu]": "Kontrolatu MPRIS zerbitzuak", "Description[fi]": "Ohjaa MPRIS-palveluita", "Description[fr]": "Controllez les services MPRIS", "Description[gl]": "Controle servizos de MPRIS.", diff --git a/plugins/mprisremote/mprisremoteplugin.h b/plugins/mprisremote/mprisremoteplugin.h --- a/plugins/mprisremote/mprisremoteplugin.h +++ b/plugins/mprisremote/mprisremoteplugin.h @@ -42,7 +42,7 @@ Q_PROPERTY(QString nowPlaying READ nowPlaying NOTIFY propertiesChanged) public: - explicit MprisRemotePlugin(QObject *parent, const QVariantList &args); + explicit MprisRemotePlugin(QObject* parent, const QVariantList &args); ~MprisRemotePlugin() override; long position() const; diff --git a/plugins/notifications/kdeconnect_notifications.json b/plugins/notifications/kdeconnect_notifications.json --- a/plugins/notifications/kdeconnect_notifications.json +++ b/plugins/notifications/kdeconnect_notifications.json @@ -22,7 +22,6 @@ "Description[el]": "Εμφάνιση ειδοποιήσεων συσκευής στον υπολογιστή αυτόν και συγχρονισμός τους", "Description[es]": "Mostrar notificaciones del dispositivo en este equipo y mantenerlas en sincronía", "Description[et]": "Seadme märguannete näitamine arvutis ja nende sünkroonis hoidmine", - "Description[eu]": "Erakutsi gailuaren jakinarazpenak ordenagailu honetan eta mantendu sinkronizatuta", "Description[fi]": "Näytä laitteen ilmoitukset tällä tietokoneella ja pidä ne ajan tasalla", "Description[fr]": "Affichez les notifications du téléphone sur l'ordinateur et synchronisez-les", "Description[gl]": "Mostrar as notificacións do dispositivo neste computador e mantelas sincronizadas.", @@ -59,7 +58,6 @@ "Name[el]": "Λήψη ειδοποιήσεων", "Name[es]": "Recibir notificaciones", "Name[et]": "Märguannete vastuvõtmine", - "Name[eu]": "Jaso jakinarazpenak", "Name[fi]": "Vastaanota ilmoituksia", "Name[fr]": "Recevoir les notifications", "Name[gl]": "Recibir notificacións", diff --git a/plugins/notifications/notification.h b/plugins/notifications/notification.h --- a/plugins/notifications/notification.h +++ b/plugins/notifications/notification.h @@ -48,19 +48,19 @@ Notification(const NetworkPackage& np, QObject* parent); ~Notification() override; - QString internalId() const { return mInternalId; } - QString appName() const { return mAppName; } - QString ticker() const { return mTicker; } - QString title() const { return mTitle; } - QString text() const { return mText; } - QString iconPath() const { return mIconPath; } - bool dismissable() const { return mDismissable; } - QString replyId() const { return mRequestReplyId; } - bool hasIcon() const { return mHasIcon; } + QString internalId() const { return m_internalId; } + QString appName() const { return m_appName; } + QString ticker() const { return m_ticker; } + QString title() const { return m_title; } + QString text() const { return m_text; } + QString iconPath() const { return m_iconPath; } + bool dismissable() const { return m_dismissable; } + QString replyId() const { return m_requestReplyId; } + bool hasIcon() const { return m_hasIcon; } void show(); - bool silent() const { return mSilent; } - void update(const NetworkPackage &np); - KNotification* createKNotification(bool update, const NetworkPackage &np); + bool silent() const { return m_silent; } + void update(const NetworkPackage& np); + KNotification* createKNotification(bool update, const NetworkPackage& np); public Q_SLOTS: Q_SCRIPTABLE void dismiss(); @@ -69,25 +69,24 @@ void closed(); Q_SIGNALS: - void dismissRequested(const QString& mInternalId); + void dismissRequested(const QString& m_internalId); void replyRequested(); - void ready(); private: - QString mInternalId; - QString mAppName; - QString mTicker; - QString mTitle; - QString mText; - QString mIconPath; - QString mRequestReplyId; - bool mDismissable; - bool mHasIcon; - KNotification* mNotification; - QDir mImagesDir; - bool mSilent; - bool mClosed; - QString mPayloadHash; + QString m_internalId; + QString m_appName; + QString m_ticker; + QString m_title; + QString m_text; + QString m_iconPath; + QString m_requestReplyId; + bool m_dismissable; + bool m_hasIcon; + KNotification* m_notification; + QDir m_imagesDir; + bool m_silent; + bool m_closed; + QString m_payloadHash; void parseNetworkPackage(const NetworkPackage& np); }; diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -33,9 +33,9 @@ Notification::Notification(const NetworkPackage& np, QObject* parent) : QObject(parent) { - mImagesDir = QDir::temp().absoluteFilePath(QStringLiteral("kdeconnect")); - mImagesDir.mkpath(mImagesDir.absolutePath()); - mClosed = false; + m_imagesDir = QDir::temp().absoluteFilePath(QStringLiteral("kdeconnect")); + m_imagesDir.mkpath(m_imagesDir.absolutePath()); + m_closed = false; parseNetworkPackage(np); createKNotification(false, np); @@ -48,86 +48,85 @@ void Notification::dismiss() { - if (mDismissable) { - Q_EMIT dismissRequested(mInternalId); + if (m_dismissable) { + Q_EMIT dismissRequested(m_internalId); } } void Notification::show() { - Q_EMIT ready(); - if (!mSilent) { - mClosed = false; - mNotification->sendEvent(); + if (!m_silent) { + m_closed = false; + m_notification->sendEvent(); } } void Notification::applyIconAndShow() { - if (!mSilent) { - QPixmap icon(mIconPath, "PNG"); - mNotification->setPixmap(icon); + if (!m_silent) { + QPixmap icon(m_iconPath, "PNG"); + m_notification->setPixmap(icon); show(); } } -void Notification::update(const NetworkPackage &np) +void Notification::update(const NetworkPackage& np) { parseNetworkPackage(np); - createKNotification(!mClosed, np); + createKNotification(!m_closed, np); } -KNotification* Notification::createKNotification(bool update, const NetworkPackage &np) +KNotification* Notification::createKNotification(bool update, const NetworkPackage& np) { if (!update) { - mNotification = new KNotification(QStringLiteral("notification"), KNotification::CloseOnTimeout, this); - mNotification->setComponentName(QStringLiteral("kdeconnect")); + m_notification = new KNotification(QStringLiteral("notification"), KNotification::CloseOnTimeout, this); + m_notification->setComponentName(QStringLiteral("kdeconnect")); } - QString escapedTitle = mTitle.toHtmlEscaped(); - QString escapedText = mText.toHtmlEscaped(); - QString escapedTicker = mTicker.toHtmlEscaped(); + QString escapedTitle = m_title.toHtmlEscaped(); + QString escapedText = m_text.toHtmlEscaped(); + QString escapedTicker = m_ticker.toHtmlEscaped(); - mNotification->setTitle(mAppName.toHtmlEscaped()); + m_notification->setTitle(m_appName.toHtmlEscaped()); - if (mTitle.isEmpty() && mText.isEmpty()) { - mNotification->setText(escapedTicker); - } else if (mAppName==mTitle) { - mNotification->setText(escapedText); - } else if (mTitle.isEmpty()){ - mNotification->setText(escapedText); - } else if (mText.isEmpty()){ - mNotification->setText(escapedTitle); + if (m_title.isEmpty() && m_text.isEmpty()) { + m_notification->setText(escapedTicker); + } else if (m_appName==m_title) { + m_notification->setText(escapedText); + } else if (m_title.isEmpty()){ + m_notification->setText(escapedText); + } else if (m_text.isEmpty()){ + m_notification->setText(escapedTitle); } else { - mNotification->setText(escapedTitle+": "+escapedText); + m_notification->setText(escapedTitle+": "+escapedText); } - if (!mHasIcon) { + if (!m_hasIcon) { //HACK The only way to display no icon at all is trying to load a non-existant icon - mNotification->setIconName(QString("not_a_real_icon")); + m_notification->setIconName(QString("not_a_real_icon")); show(); } else { - QString filename = mPayloadHash; + QString filename = m_payloadHash; if (filename.isEmpty()) { - mHasIcon = false; + m_hasIcon = false; } else { - mIconPath = mImagesDir.absoluteFilePath(filename); - QUrl destinationUrl(mIconPath); + m_iconPath = m_imagesDir.absoluteFilePath(filename); + QUrl destinationUrl(m_iconPath); FileTransferJob* job = np.createPayloadTransferJob(destinationUrl); job->start(); connect(job, &FileTransferJob::result, this, &Notification::applyIconAndShow); } } - if(!mRequestReplyId.isEmpty()) { - mNotification->setActions( QStringList(i18n("Reply")) ); - connect(mNotification, &KNotification::action1Activated, this, &Notification::reply); + if(!m_requestReplyId.isEmpty()) { + m_notification->setActions( QStringList(i18n("Reply")) ); + connect(m_notification, &KNotification::action1Activated, this, &Notification::reply); } - connect(mNotification, &KNotification::closed, this, &Notification::closed); + connect(m_notification, &KNotification::closed, this, &Notification::closed); - return mNotification; + return m_notification; } void Notification::reply() @@ -137,19 +136,19 @@ void Notification::closed() { - mClosed = true; + m_closed = true; } -void Notification::parseNetworkPackage(const NetworkPackage &np) +void Notification::parseNetworkPackage(const NetworkPackage& np) { - mInternalId = np.get(QStringLiteral("id")); - mAppName = np.get(QStringLiteral("appName")); - mTicker = np.get(QStringLiteral("ticker")); - mTitle = np.get(QStringLiteral("title")); - mText = np.get(QStringLiteral("text")); - mDismissable = np.get(QStringLiteral("isClearable")); - mHasIcon = np.hasPayload(); - mSilent = np.get(QStringLiteral("silent")); - mPayloadHash = np.get(QStringLiteral("payloadHash")); - mRequestReplyId = np.get(QStringLiteral("requestReplyId"), QString()); + m_internalId = np.get(QStringLiteral("id")); + m_appName = np.get(QStringLiteral("appName")); + m_ticker = np.get(QStringLiteral("ticker")); + m_title = np.get(QStringLiteral("title")); + m_text = np.get(QStringLiteral("text")); + m_dismissable = np.get(QStringLiteral("isClearable")); + m_hasIcon = np.hasPayload(); + m_silent = np.get(QStringLiteral("silent")); + m_payloadHash = np.get(QStringLiteral("payloadHash")); + m_requestReplyId = np.get(QStringLiteral("requestReplyId"), QString()); } diff --git a/plugins/notifications/notificationsdbusinterface.h b/plugins/notifications/notificationsdbusinterface.h --- a/plugins/notifications/notificationsdbusinterface.h +++ b/plugins/notifications/notificationsdbusinterface.h @@ -39,10 +39,6 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.notifications") public: - enum RemoveType{ - KeepNotification, DestroyNotification - }; - explicit NotificationsDbusInterface(KdeConnectPlugin* plugin); ~NotificationsDbusInterface() override; @@ -62,15 +58,15 @@ Q_SCRIPTABLE void allNotificationsRemoved(); private /*methods*/: - void removeNotification(const QString& internalId, RemoveType removetype=DestroyNotification); + void removeNotification(const QString& internalId); QString newId(); //Generates successive identifitiers to use as public ids private /*attributes*/: - const Device* mDevice; - KdeConnectPlugin* mPlugin; - QHash mNotifications; - QHash mInternalIdToPublicId; - int mLastId; + const Device* m_device; + KdeConnectPlugin* m_plugin; + QHash m_notifications; + QHash m_internalIdToPublicId; + int m_lastId; }; #endif diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp --- a/plugins/notifications/notificationsdbusinterface.cpp +++ b/plugins/notifications/notificationsdbusinterface.cpp @@ -32,9 +32,9 @@ NotificationsDbusInterface::NotificationsDbusInterface(KdeConnectPlugin* plugin) : QDBusAbstractAdaptor(const_cast(plugin->device())) - , mDevice(plugin->device()) - , mPlugin(plugin) - , mLastId(0) + , m_device(plugin->device()) + , m_plugin(plugin) + , m_lastId(0) { } @@ -46,14 +46,14 @@ void NotificationsDbusInterface::clearNotifications() { - qDeleteAll(mNotifications); - mNotifications.clear(); + qDeleteAll(m_notifications); + m_notifications.clear(); Q_EMIT allNotificationsRemoved(); } QStringList NotificationsDbusInterface::activeNotifications() { - return mNotifications.keys(); + return m_notifications.keys(); } void NotificationsDbusInterface::processPackage(const NetworkPackage& np) @@ -65,7 +65,7 @@ id = id.mid(id.indexOf(QLatin1String("::")) + 2); removeNotification(id); } else if (np.get(QStringLiteral("isRequest"))) { - for (const auto& n : qAsConst(mNotifications)) { + for (const auto& n : qAsConst(m_notifications)) { NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST, { {"id", n->internalId()}, {"appName", n->appName()}, @@ -73,26 +73,20 @@ {"isClearable", n->dismissable()}, {"requestAnswer", true} }); - mPlugin->sendPackage(np); + m_plugin->sendPackage(np); } } else if(np.get(QStringLiteral("requestAnswer"), false)) { } else { QString id = np.get(QStringLiteral("id")); - Notification* noti; - - if (!mInternalIdToPublicId.contains(id)) { - noti = new Notification(np, this); + if (!m_internalIdToPublicId.contains(id)) { + Notification* noti = new Notification(np, this); + addNotification(noti); } else { - QString pubId = mInternalIdToPublicId[id]; - noti = mNotifications[pubId]; - noti->update(np); + QString pubId = m_internalIdToPublicId[id]; + m_notifications[pubId]->update(np); } - - connect(noti, &Notification::ready, this, [this, noti]{ - addNotification(noti); - }); } } @@ -100,50 +94,47 @@ { const QString& internalId = noti->internalId(); - if (mInternalIdToPublicId.contains(internalId)) { - removeNotification(internalId, KeepNotification); + if (m_internalIdToPublicId.contains(internalId)) { + removeNotification(internalId); } //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "addNotification" << internalId; connect(noti, &Notification::dismissRequested, this, &NotificationsDbusInterface::dismissRequested); - - connect(noti, &Notification::replyRequested, this, [this,noti]{ - replyRequested(noti); + + connect(noti, &Notification::replyRequested, this, [this,noti]{ + replyRequested(noti); }); const QString& publicId = newId(); - mNotifications[publicId] = noti; - mInternalIdToPublicId[internalId] = publicId; + m_notifications[publicId] = noti; + m_internalIdToPublicId[internalId] = publicId; - QDBusConnection::sessionBus().registerObject(mDevice->dbusPath()+"/notifications/"+publicId, noti, QDBusConnection::ExportScriptableContents); + QDBusConnection::sessionBus().registerObject(m_device->dbusPath()+"/notifications/"+publicId, noti, QDBusConnection::ExportScriptableContents); Q_EMIT notificationPosted(publicId); } -void NotificationsDbusInterface::removeNotification(const QString& internalId, RemoveType removetype) +void NotificationsDbusInterface::removeNotification(const QString& internalId) { //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "removeNotification" << internalId; - if (!mInternalIdToPublicId.contains(internalId)) { - //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by internal Id: " << internalId; + if (!m_internalIdToPublicId.contains(internalId)) { + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by internal Id: " << internalId; return; } - QString publicId = mInternalIdToPublicId.take(internalId); + QString publicId = m_internalIdToPublicId.take(internalId); - Notification* noti = mNotifications.take(publicId); + Notification* noti = m_notifications.take(publicId); if (!noti) { - //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by public Id: " << publicId; + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by public Id: " << publicId; return; } //Deleting the notification will unregister it automatically - if (removetype==KeepNotification){ - QDBusConnection::sessionBus().unregisterObject(mDevice->dbusPath()+"/notifications/"+publicId); - } else if (removetype==DestroyNotification){ - noti->deleteLater(); - } + //QDBusConnection::sessionBus().unregisterObject(mDevice->dbusPath()+"/notifications/"+publicId); + noti->deleteLater(); Q_EMIT notificationRemoved(publicId); } @@ -152,7 +143,7 @@ { NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST); np.set(QStringLiteral("cancel"), internalId); - mPlugin->sendPackage(np); + m_plugin->sendPackage(np); //Workaround: we erase notifications without waiting a repsonse from the //phone because we won't receive a response if we are out of sync and this @@ -176,10 +167,10 @@ NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REPLY); np.set(QStringLiteral("requestReplyId"), replyId); np.set(QStringLiteral("message"), message); - mPlugin->sendPackage(np); + m_plugin->sendPackage(np); } QString NotificationsDbusInterface::newId() { - return QString::number(++mLastId); + return QString::number(++m_lastId); } diff --git a/plugins/notifications/notificationsplugin.h b/plugins/notifications/notificationsplugin.h --- a/plugins/notifications/notificationsplugin.h +++ b/plugins/notifications/notificationsplugin.h @@ -42,7 +42,7 @@ Q_OBJECT public: - explicit NotificationsPlugin(QObject *parent, const QVariantList &args); + explicit NotificationsPlugin(QObject* parent, const QVariantList& args); ~NotificationsPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/notifications/sendreplydialog.h b/plugins/notifications/sendreplydialog.h --- a/plugins/notifications/sendreplydialog.h +++ b/plugins/notifications/sendreplydialog.h @@ -33,7 +33,7 @@ Q_OBJECT public: - explicit SendReplyDialog(const QString& originalMessage, const QString& replyId, const QString& topicName, QWidget *parent = nullptr); + explicit SendReplyDialog(const QString& originalMessage, const QString& replyId, const QString& topicName, QWidget* parent = nullptr); QSize sizeHint() const override; private Q_SLOTS: @@ -43,8 +43,8 @@ void sendReply(const QString& replyId, const QString& messageBody); private: - QString mReplyId; - QTextEdit *mTextEdit; + QString m_replyId; + QTextEdit* m_textEdit; }; #endif diff --git a/plugins/notifications/sendreplydialog.cpp b/plugins/notifications/sendreplydialog.cpp --- a/plugins/notifications/sendreplydialog.cpp +++ b/plugins/notifications/sendreplydialog.cpp @@ -29,7 +29,7 @@ SendReplyDialog::SendReplyDialog(const QString& originalMessage, const QString& replyId, const QString& topicName, QWidget* parent) : QDialog(parent) - , mReplyId(replyId) + , m_replyId(replyId) { QVBoxLayout* layout = new QVBoxLayout; @@ -38,8 +38,8 @@ textView->setText(topicName + ": \n" + originalMessage); layout->addWidget(textView); - mTextEdit = new QTextEdit(this); - layout->addWidget(mTextEdit); + m_textEdit = new QTextEdit(this); + layout->addWidget(m_textEdit); QPushButton* sendButton = new QPushButton(i18n("Send"), this); connect(sendButton, &QAbstractButton::clicked, this, &SendReplyDialog::sendButtonClicked); @@ -54,7 +54,7 @@ void SendReplyDialog::sendButtonClicked() { - Q_EMIT sendReply(mReplyId, mTextEdit->toPlainText()); + Q_EMIT sendReply(m_replyId, m_textEdit->toPlainText()); close(); } diff --git a/plugins/pausemusic/kdeconnect_pausemusic.json b/plugins/pausemusic/kdeconnect_pausemusic.json --- a/plugins/pausemusic/kdeconnect_pausemusic.json +++ b/plugins/pausemusic/kdeconnect_pausemusic.json @@ -22,7 +22,6 @@ "Description[el]": "Παύση μουσικής/βίντεο κατά τη διάρκεια κλήσης", "Description[es]": "Pausar música/video durante las llamadas telefónicas", "Description[et]": "Muusika või video peatamine telefonikõne ajal", - "Description[eu]": "Pausatu musika / bideoak deietan", "Description[fi]": "Keskeytä musiikki ja videot puhelun aikana", "Description[fr]": "Mettre en pause la musique / les vidéos pendant un appel téléphonique", "Description[gl]": "Deter a reprodución de música ou vídeos durante as chamadas.", @@ -60,7 +59,6 @@ "Name[el]": "Παύση πολυμέσων στη διάρκεια κλήσεων", "Name[es]": "Pausar medios durante las llamadas", "Name[et]": "Meedia peatamine kõne ajal", - "Name[eu]": "Pausatu media deietan", "Name[fi]": "Keskeytä toisto puhelujen aikana", "Name[fr]": "Mettre en pause le média pendant les appels", "Name[gl]": "Deter a reprodución durante as chamadas.", diff --git a/plugins/pausemusic/kdeconnect_pausemusic_config.desktop b/plugins/pausemusic/kdeconnect_pausemusic_config.desktop --- a/plugins/pausemusic/kdeconnect_pausemusic_config.desktop +++ b/plugins/pausemusic/kdeconnect_pausemusic_config.desktop @@ -19,7 +19,6 @@ Name[en_GB]=Pause Music plugin settings Name[es]=Ajustes del complemento PauseMusic Name[et]=Muusika peatamise plugina seadistused -Name[eu]=Pausatu-musika pluginaren ezarpenak Name[fi]=Keskeytä musiikki -liitännäisen asetukset Name[fr]=Paramètres du module de mise en pause Name[gl]=Configuración do complemento para deter a música diff --git a/plugins/pausemusic/pausemusic_config.h b/plugins/pausemusic/pausemusic_config.h --- a/plugins/pausemusic/pausemusic_config.h +++ b/plugins/pausemusic/pausemusic_config.h @@ -32,7 +32,7 @@ { Q_OBJECT public: - PauseMusicConfig(QWidget *parent, const QVariantList&); + PauseMusicConfig(QWidget* parent, const QVariantList&); ~PauseMusicConfig() override; public Q_SLOTS: diff --git a/plugins/pausemusic/pausemusic_config.cpp b/plugins/pausemusic/pausemusic_config.cpp --- a/plugins/pausemusic/pausemusic_config.cpp +++ b/plugins/pausemusic/pausemusic_config.cpp @@ -25,7 +25,7 @@ K_PLUGIN_FACTORY(PauseMusicConfigFactory, registerPlugin();) -PauseMusicConfig::PauseMusicConfig(QWidget *parent, const QVariantList& args) +PauseMusicConfig::PauseMusicConfig(QWidget* parent, const QVariantList& args) : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_pausemusic_config")) , m_ui(new Ui::PauseMusicConfigUi()) { diff --git a/plugins/pausemusic/pausemusicplugin.h b/plugins/pausemusic/pausemusicplugin.h --- a/plugins/pausemusic/pausemusicplugin.h +++ b/plugins/pausemusic/pausemusicplugin.h @@ -33,7 +33,7 @@ Q_OBJECT public: - explicit PauseMusicPlugin(QObject *parent, const QVariantList &args); + explicit PauseMusicPlugin(QObject* parent, const QVariantList& args); bool receivePackage(const NetworkPackage& np) override; void connected() override { } diff --git a/plugins/ping/kdeconnect_ping.json b/plugins/ping/kdeconnect_ping.json --- a/plugins/ping/kdeconnect_ping.json +++ b/plugins/ping/kdeconnect_ping.json @@ -22,7 +22,6 @@ "Description[el]": "Αποστολή και λήψη pings", "Description[es]": "Enviar y recibir pings", "Description[et]": "Pingide saatmine ja vastuvõtmine", - "Description[eu]": "Bidali eta jaso pingak", "Description[fi]": "Lähetä ja vastaanota tiedustelupaketteja", "Description[fr]": "Envoie et reçoit des commandes « Ping »", "Description[gl]": "Enviar e recibir pings.", diff --git a/plugins/ping/pingplugin.h b/plugins/ping/pingplugin.h --- a/plugins/ping/pingplugin.h +++ b/plugins/ping/pingplugin.h @@ -34,7 +34,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.ping") public: - explicit PingPlugin(QObject *parent, const QVariantList &args); + explicit PingPlugin(QObject* parent, const QVariantList& args); ~PingPlugin() override; Q_SCRIPTABLE void sendPing(); diff --git a/plugins/remotecommands/kdeconnect_remotecommands.json b/plugins/remotecommands/kdeconnect_remotecommands.json --- a/plugins/remotecommands/kdeconnect_remotecommands.json +++ b/plugins/remotecommands/kdeconnect_remotecommands.json @@ -22,7 +22,6 @@ "Description[el]": "Ενεργοποίηση προκαθορισμένων εντολών στην απομακρυσμένη συσκευή", "Description[es]": "Desencadenar órdenes predefinidas en el dispositivo remoto", "Description[et]": "Kaugseadmes määratud käskude käivitamine", - "Description[eu]": "Exekutatu urruneko gailuan aurretiaz zehaztutako komandoak", "Description[fi]": "Suorita ennakkoon määriteltyjä komentoja etälaitteella", "Description[fr]": "Exécuter des commandes prédéfinies sur le périphérique distant", "Description[gl]": "Provocar ordes predefinidas no dispositivo remoto.", @@ -57,7 +56,6 @@ "Name[el]": "Απομακρυσμένη εκτέλεση εντολών", "Name[es]": "Órdenes en servidor remoto", "Name[et]": "Kaugkäsud", - "Name[eu]": "Ostalariaren urruneko komandoak", "Name[fi]": "Etäkomennot", "Name[fr]": "Exécuter des commandes distantes", "Name[gl]": "Ordes remotas do servidor", diff --git a/plugins/remotecommands/remotecommandsplugin.h b/plugins/remotecommands/remotecommandsplugin.h --- a/plugins/remotecommands/remotecommandsplugin.h +++ b/plugins/remotecommands/remotecommandsplugin.h @@ -38,10 +38,10 @@ Q_PROPERTY(QByteArray commands READ commands NOTIFY commandsChanged) public: - explicit RemoteCommandsPlugin(QObject *parent, const QVariantList &args); + explicit RemoteCommandsPlugin(QObject* parent, const QVariantList& args); ~RemoteCommandsPlugin() override; - Q_SCRIPTABLE void triggerCommand(const QString &key); + Q_SCRIPTABLE void triggerCommand(const QString& key); QByteArray commands() const { return m_commands; } bool receivePackage(const NetworkPackage& np) override; @@ -52,7 +52,7 @@ void commandsChanged(const QByteArray& commands); private: - void setCommands(const QByteArray &commands); + void setCommands(const QByteArray& commands); QByteArray m_commands; }; diff --git a/plugins/remotecommands/remotecommandsplugin.cpp b/plugins/remotecommands/remotecommandsplugin.cpp --- a/plugins/remotecommands/remotecommandsplugin.cpp +++ b/plugins/remotecommands/remotecommandsplugin.cpp @@ -68,7 +68,7 @@ return "/modules/kdeconnect/devices/" + device()->id() + "/remotecommands"; } -void RemoteCommandsPlugin::setCommands(const QByteArray &cmds) +void RemoteCommandsPlugin::setCommands(const QByteArray& cmds) { if (m_commands != cmds) { m_commands = cmds; @@ -76,7 +76,7 @@ } } -void RemoteCommandsPlugin::triggerCommand(const QString &key) +void RemoteCommandsPlugin::triggerCommand(const QString& key) { NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND_REQUEST, {{ "key", key }}); sendPackage(np); diff --git a/plugins/remotecontrol/kdeconnect_remotecontrol.json b/plugins/remotecontrol/kdeconnect_remotecontrol.json --- a/plugins/remotecontrol/kdeconnect_remotecontrol.json +++ b/plugins/remotecontrol/kdeconnect_remotecontrol.json @@ -22,7 +22,6 @@ "Description[el]": "Έλεγχος ανταπόκρισης απομακρυσμένων συστημάτων", "Description[es]": "Controlar sistemas remotos", "Description[et]": "Kaugjuhtimissüsteemid", - "Description[eu]": "Kontrolatu urruneko sistemak", "Description[fi]": "Ohjaa järjestelmiä etänä", "Description[fr]": "Controllez les systèmes distants", "Description[gl]": "Controla sistemas remotos.", @@ -58,7 +57,6 @@ "Name[de]": "Fernsteuerung", "Name[es]": "Control remoto", "Name[et]": "Kaugjuhtimine", - "Name[eu]": "UrrunekoKontrola", "Name[fi]": "Kauko-ohjain", "Name[gl]": "Mando a distancia", "Name[it]": "Telecomando", diff --git a/plugins/remotecontrol/remotecontrolplugin.h b/plugins/remotecontrol/remotecontrolplugin.h --- a/plugins/remotecontrol/remotecontrolplugin.h +++ b/plugins/remotecontrol/remotecontrolplugin.h @@ -34,7 +34,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotecontrol") public: - explicit RemoteControlPlugin(QObject *parent, const QVariantList &args); + explicit RemoteControlPlugin(QObject* parent, const QVariantList &args); ~RemoteControlPlugin() override; bool receivePackage(const NetworkPackage& /*np*/) override { return false; } diff --git a/plugins/remotecontrol/remotecontrolplugin.cpp b/plugins/remotecontrol/remotecontrolplugin.cpp --- a/plugins/remotecontrol/remotecontrolplugin.cpp +++ b/plugins/remotecontrol/remotecontrolplugin.cpp @@ -34,7 +34,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTECONTROL, "kdeconnect.plugin.remotecontrol") -RemoteControlPlugin::RemoteControlPlugin(QObject *parent, const QVariantList &args) +RemoteControlPlugin::RemoteControlPlugin(QObject* parent, const QVariantList &args) : KdeConnectPlugin(parent, args) { } diff --git a/plugins/remotekeyboard/kdeconnect_remotekeyboard.json b/plugins/remotekeyboard/kdeconnect_remotekeyboard.json --- a/plugins/remotekeyboard/kdeconnect_remotekeyboard.json +++ b/plugins/remotekeyboard/kdeconnect_remotekeyboard.json @@ -18,7 +18,6 @@ "Description[cs]": "Používejte svoji klávesnici pro odesílání událostí kláves na spárované zařízení", "Description[da]": "Brug dit tastatur til at sende tastehændelser til din parrede enhed", "Description[es]": "Use su teclado para enviar eventos de teclado a su dispositivo vinculado", - "Description[eu]": "Erabili zure teklatua tekla-gertaerak zure parekatutako gailura bidaltzeko", "Description[fr]": "Utiliser votre clavier pour envoyer des évènements de touche au périphérique associé", "Description[gl]": "Usar o teclado para enviar eventos de tecla ao dispositivo emparellado.", "Description[it]": "Utilizza la tua tastiera per inviare eventi di pressione dei tasti al dispositivo associato", @@ -46,7 +45,6 @@ "Name[cs]": "Vzdálená klávesnice pro plochu", "Name[da]": "Eksternt tastatur fra desktoppen", "Name[es]": "Teclado remoto desde el equipo de escritorio", - "Name[eu]": "Urruneko teklatua mahaigainetik", "Name[fr]": "Clavier distant depuis le bureau", "Name[gl]": "Teclado remoto do escritorio", "Name[it]": "Tastiera remota dal desktop", diff --git a/plugins/remotekeyboard/remotekeyboardplugin.h b/plugins/remotekeyboard/remotekeyboardplugin.h --- a/plugins/remotekeyboard/remotekeyboardplugin.h +++ b/plugins/remotekeyboard/remotekeyboardplugin.h @@ -45,7 +45,7 @@ bool m_remoteState; public: - explicit RemoteKeyboardPlugin(QObject *parent, const QVariantList &args); + explicit RemoteKeyboardPlugin(QObject* parent, const QVariantList& args); ~RemoteKeyboardPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/runcommand/kdeconnect_runcommand.json b/plugins/runcommand/kdeconnect_runcommand.json --- a/plugins/runcommand/kdeconnect_runcommand.json +++ b/plugins/runcommand/kdeconnect_runcommand.json @@ -31,7 +31,6 @@ "Description[el]": "Απομακρυσμένη εκτέλεση εντολών του τερματικού", "Description[es]": "Ejecute órdenes de consola remotamente", "Description[et]": "Konsoolikäskude kaugkäivitamine", - "Description[eu]": "Exekutatu kontsolako komandoak urrunetik", "Description[fi]": "Suorita konsolikomentoja etänä", "Description[fr]": "Exécute des commandes console à distance", "Description[gl]": "Executar ordes de consola remotamente.", @@ -68,7 +67,6 @@ "Name[el]": "Εκτέλεση εντολών", "Name[es]": "Ejecutar órdenes", "Name[et]": "Käskude käivitamine", - "Name[eu]": "Exekutatu komandoak", "Name[fi]": "Suorita komentoja", "Name[fr]": "Exécute des commandes", "Name[gl]": "Executar ordes", diff --git a/plugins/runcommand/kdeconnect_runcommand_config.desktop b/plugins/runcommand/kdeconnect_runcommand_config.desktop --- a/plugins/runcommand/kdeconnect_runcommand_config.desktop +++ b/plugins/runcommand/kdeconnect_runcommand_config.desktop @@ -17,7 +17,6 @@ Name[en_GB]=Run Command plugin settings Name[es]=Ajustes del complemento de ejecución de órdenes Name[et]=Käsu käivitamise plugina seadistused -Name[eu]=Exekutatu komandoa pluginaren ezarpenak Name[fi]=Suorita komento -liitännäisen asetukset Name[fr]=Configuration du module externe d'exécution de commande Name[gl]=Configuración do complemento de orde de executar diff --git a/plugins/runcommand/runcommand_config.h b/plugins/runcommand/runcommand_config.h --- a/plugins/runcommand/runcommand_config.h +++ b/plugins/runcommand/runcommand_config.h @@ -30,7 +30,7 @@ { Q_OBJECT public: - RunCommandConfig(QWidget *parent, const QVariantList&); + RunCommandConfig(QWidget* parent, const QVariantList&); ~RunCommandConfig() override; public Q_SLOTS: @@ -39,11 +39,11 @@ void defaults() override; private Q_SLOTS: - void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); private: void insertEmptyRow(); - QStandardItemModel *m_entriesModel; + QStandardItemModel* m_entriesModel; }; diff --git a/plugins/runcommand/runcommand_config.cpp b/plugins/runcommand/runcommand_config.cpp --- a/plugins/runcommand/runcommand_config.cpp +++ b/plugins/runcommand/runcommand_config.cpp @@ -35,13 +35,13 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) -RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList& args) +RunCommandConfig::RunCommandConfig(QWidget* parent, const QVariantList& args) : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_runcommand_config")) { - QTableView *table = new QTableView(this); + QTableView* table = new QTableView(this); table->horizontalHeader()->setStretchLastSection(true); table->verticalHeader()->setVisible(false); - QVBoxLayout *layout = new QVBoxLayout(this); + QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(table); setLayout(layout); @@ -76,10 +76,10 @@ const QString name = entry[QStringLiteral("name")].toString(); const QString command = entry[QStringLiteral("command")].toString(); - QStandardItem *newName = new QStandardItem(name); + QStandardItem* newName = new QStandardItem(name); newName->setEditable(true); newName->setData(key); - QStandardItem *newCommand = new QStandardItem(command); + QStandardItem* newCommand = new QStandardItem(command); newName->setEditable(true); m_entriesModel->appendRow(QList() << newName << newCommand); @@ -124,9 +124,9 @@ void RunCommandConfig::insertEmptyRow() { - QStandardItem *newName = new QStandardItem; + QStandardItem* newName = new QStandardItem; newName->setEditable(true); - QStandardItem *newCommand = new QStandardItem; + QStandardItem* newCommand = new QStandardItem; newName->setEditable(true); m_entriesModel->appendRow(QList() << newName << newCommand); diff --git a/plugins/runcommand/runcommandplugin.h b/plugins/runcommand/runcommandplugin.h --- a/plugins/runcommand/runcommandplugin.h +++ b/plugins/runcommand/runcommandplugin.h @@ -36,7 +36,7 @@ Q_OBJECT public: - explicit RunCommandPlugin(QObject *parent, const QVariantList &args); + explicit RunCommandPlugin(QObject* parent, const QVariantList& args); ~RunCommandPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json b/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json --- a/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json +++ b/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json @@ -20,7 +20,6 @@ "Description[el]": "Απαγόρευση προστασίας οθόνης όταν η συσκευή είναι σε σύνδεση", "Description[es]": "Inhibir el salvapantallas cuando el dispositivo está conectado", "Description[et]": "Ekraanisäästja keelamine, kui seade on ühendatud", - "Description[eu]": "Gelditu pantaila-babeslea gailua konektatuta dagoenean", "Description[fi]": "Estä näytönsäästäjän käynnistyminen, kun laite on yhteydessä", "Description[fr]": "Inhiber l'économiseur d'écran quand le périphérique est connecté", "Description[gl]": "Desactivar o salvapantallas mentres o dispositivo estea conectado.", @@ -58,7 +57,6 @@ "Name[el]": "Απαγόρευση προστασίας οθόνης", "Name[es]": "Inhibir salvapantallas", "Name[et]": "Ekraanisäästja keelamine", - "Name[eu]": "Gelditu pantaila-babeslea", "Name[fi]": "Estä näytönsäästäjän käynnistyminen", "Name[fr]": "Inhiber l'économiseur d'écran", "Name[gl]": "Desactivar o salvapantallas", diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin.h b/plugins/screensaver-inhibit/screensaverinhibitplugin.h --- a/plugins/screensaver-inhibit/screensaverinhibitplugin.h +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin.h @@ -31,7 +31,7 @@ Q_OBJECT public: - explicit ScreensaverInhibitPlugin(QObject *parent, const QVariantList &args); + explicit ScreensaverInhibitPlugin(QObject* parent, const QVariantList& args); ~ScreensaverInhibitPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/sendnotifications/kdeconnect_sendnotifications.json b/plugins/sendnotifications/kdeconnect_sendnotifications.json --- a/plugins/sendnotifications/kdeconnect_sendnotifications.json +++ b/plugins/sendnotifications/kdeconnect_sendnotifications.json @@ -22,7 +22,6 @@ "Description[el]": "Μεταδώστε την ειδοποίηση αυτού του υπολογιστή, ώστε να εμφανιστεί σε άλλες συσκευές.", "Description[es]": "Difundir las notificaciones de este equipo, para que puedan mostrarse en otros dispositivos.", "Description[et]": "Arvuti märguannete levitamine, et neid oleks näha ka teistes seadmetes", - "Description[eu]": "Hedatu ordenagailu honen jakinarazpenak, beste gailuetan erakutsi ahal izateko", "Description[fi]": "Lähetä tämän tietokoneen ilmoitukset, jotta ne voidaan näyttää muilla laitteilla.", "Description[fr]": "Diffuser les notifications de cet ordinateur pour qu'elles puissent être vues par d'autres périphériques.", "Description[gl]": "Emitir as notificacións deste computador para que se mostren noutros dispositivos.", @@ -58,7 +57,6 @@ "Name[el]": "Αποστολή ειδοποιήσεων", "Name[es]": "Enviar notificaciones", "Name[et]": "Märguannete saatmine", - "Name[eu]": "Bidali jakinarazpenak", "Name[fi]": "Lähetä ilmoituksia", "Name[fr]": "Envoyer les notifications", "Name[gl]": "Enviar notificacións", diff --git a/plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop b/plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop --- a/plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop +++ b/plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop @@ -17,7 +17,6 @@ Name[en_GB]=Notification synchronisation plugin settings Name[es]=Preferencias del complemento de sincronización de notificaciones Name[et]=Märguande sünkroonimise plugina seaditused -Name[eu]=Jakinarazpenak sinkronizatzeko pluginaren ezarpenak Name[fi]=Ilmoitusten synkronointiliitännäisen asetukset Name[fr]=Configuration du module externe de synchronisation des notifications Name[gl]=Configuración do complemento de sincronización de notificacións diff --git a/plugins/sendnotifications/notificationslistener.h b/plugins/sendnotifications/notificationslistener.h --- a/plugins/sendnotifications/notificationslistener.h +++ b/plugins/sendnotifications/notificationslistener.h @@ -38,8 +38,8 @@ ~NotificationsListener() override; protected: - KdeConnectPlugin* mPlugin; - QHash applications; + KdeConnectPlugin* m_plugin; + QHash m_applications; // virtual helper function to make testing possible (QDBusArgument can not // be injected without making a DBUS-call): @@ -60,5 +60,5 @@ private: void setTranslatedAppName(); - QString mTranslatedAppName; + QString m_translatedAppName; }; diff --git a/plugins/sendnotifications/notificationslistener.cpp b/plugins/sendnotifications/notificationslistener.cpp --- a/plugins/sendnotifications/notificationslistener.cpp +++ b/plugins/sendnotifications/notificationslistener.cpp @@ -41,7 +41,7 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin* aPlugin) : QDBusAbstractAdaptor(aPlugin), - mPlugin(aPlugin) + m_plugin(aPlugin) { qRegisterMetaTypeStreamOperators("NotifyingApplication"); @@ -52,12 +52,12 @@ if (!ret) qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Error registering notifications listener for device" - << mPlugin->device()->name() << ":" + << m_plugin->device()->name() << ":" << QDBusConnection::sessionBus().lastError(); else qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Registered notifications listener for device" - << mPlugin->device()->name(); + << m_plugin->device()->name(); QDBusInterface iface(QStringLiteral("org.freedesktop.DBus"), QStringLiteral("/org/freedesktop/DBus"), QStringLiteral("org.freedesktop.DBus")); @@ -67,7 +67,7 @@ setTranslatedAppName(); loadApplications(); - connect(mPlugin->config(), &KdeConnectPluginConfig::configChanged, this, &NotificationsListener::loadApplications); + connect(m_plugin->config(), &KdeConnectPluginConfig::configChanged, this, &NotificationsListener::loadApplications); } NotificationsListener::~NotificationsListener() @@ -85,23 +85,23 @@ QString filePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("knotifications5/kdeconnect.notifyrc"), QStandardPaths::LocateFile); if (filePath.isEmpty()) { qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Couldn't find kdeconnect.notifyrc to hide kdeconnect notifications on the devices. Using default name."; - mTranslatedAppName = QStringLiteral("KDE Connect"); + m_translatedAppName = QStringLiteral("KDE Connect"); return; } KConfig config(filePath, KConfig::OpenFlag::SimpleConfig); KConfigGroup globalgroup(&config, QStringLiteral("Global")); - mTranslatedAppName = globalgroup.readEntry(QStringLiteral("Name"), QStringLiteral("KDE Connect")); + m_translatedAppName = globalgroup.readEntry(QStringLiteral("Name"), QStringLiteral("KDE Connect")); } void NotificationsListener::loadApplications() { - applications.clear(); - const QVariantList list = mPlugin->config()->getList(QStringLiteral("applications")); + m_applications.clear(); + const QVariantList list = m_plugin->config()->getList(QStringLiteral("applications")); for (const auto& a : list) { NotifyingApplication app = a.value(); - if (!applications.contains(app.name)) - applications.insert(app.name, app); + if (!m_applications.contains(app.name)) + m_applications.insert(app.name, app); } //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Loaded" << applications.size() << " applications"; } @@ -158,7 +158,7 @@ return buffer; } -QSharedPointer NotificationsListener::iconForIconName(const QString &iconName) const +QSharedPointer NotificationsListener::iconForIconName(const QString& iconName) const { int size = KIconLoader::SizeEnormous; // use big size to allow for good // quality on high-DPI mobile devices @@ -179,11 +179,11 @@ return QSharedPointer(new QFile(iconPath)); return QSharedPointer(); } -uint NotificationsListener::Notify(const QString &appName, uint replacesId, - const QString &appIcon, - const QString &summary, const QString &body, - const QStringList &actions, - const QVariantMap &hints, int timeout) +uint NotificationsListener::Notify(const QString& appName, uint replacesId, + const QString& appIcon, + const QString& summary, const QString& body, + const QStringList& actions, + const QVariantMap& hints, int timeout) { static int id = 0; Q_UNUSED(actions); @@ -191,30 +191,30 @@ //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Got notification appName=" << appName << "replacesId=" << replacesId << "appIcon=" << appIcon << "summary=" << summary << "body=" << body << "actions=" << actions << "hints=" << hints << "timeout=" << timeout; // skip our own notifications - if (appName == mTranslatedAppName) + if (appName == m_translatedAppName) return 0; NotifyingApplication app; - if (!applications.contains(appName)) { + if (!m_applications.contains(appName)) { // new application -> add to config app.name = appName; app.icon = appIcon; app.active = true; app.blacklistExpression = QRegularExpression(); - applications.insert(app.name, app); + m_applications.insert(app.name, app); // update config: QVariantList list; - for (const auto& a : qAsConst(applications)) + for (const auto& a : qAsConst(m_applications)) list << QVariant::fromValue(a); - mPlugin->config()->setList(QStringLiteral("applications"), list); + m_plugin->config()->setList(QStringLiteral("applications"), list); //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Added new application to config:" << app; } else - app = applications.value(appName); + app = m_applications.value(appName); if (!app.active) return 0; - if (timeout > 0 && mPlugin->config()->get(QStringLiteral("generalPersistent"), false)) + if (timeout > 0 && m_plugin->config()->get(QStringLiteral("generalPersistent"), false)) return 0; int urgency = -1; @@ -224,11 +224,11 @@ if (!ok) urgency = -1; } - if (urgency > -1 && urgency < mPlugin->config()->get(QStringLiteral("generalUrgency"), 0)) + if (urgency > -1 && urgency < m_plugin->config()->get(QStringLiteral("generalUrgency"), 0)) return 0; QString ticker = summary; - if (!body.isEmpty() && mPlugin->config()->get(QStringLiteral("generalIncludeBody"), true)) + if (!body.isEmpty() && m_plugin->config()->get(QStringLiteral("generalIncludeBody"), true)) ticker += QStringLiteral(": ") + body; if (app.blacklistExpression.isValid() && @@ -247,7 +247,7 @@ // clearability is pointless // sync any icon data? - if (mPlugin->config()->get(QStringLiteral("generalSynchronizeIcons"), true)) { + if (m_plugin->config()->get(QStringLiteral("generalSynchronizeIcons"), true)) { QSharedPointer iconSource; // try different image sources according to priorities in notifications- // spec version 1.2: @@ -268,7 +268,7 @@ np.setPayload(iconSource, iconSource->size()); } - mPlugin->sendPackage(np); + m_plugin->sendPackage(np); return (replacesId > 0 ? replacesId : id); } diff --git a/plugins/sendnotifications/notifyingapplication.h b/plugins/sendnotifications/notifyingapplication.h --- a/plugins/sendnotifications/notifyingapplication.h +++ b/plugins/sendnotifications/notifyingapplication.h @@ -36,8 +36,8 @@ Q_DECLARE_METATYPE(NotifyingApplication); -QDataStream &operator<<(QDataStream &out, const NotifyingApplication &app); -QDataStream &operator>>(QDataStream &in, NotifyingApplication &app); -QDebug operator<<(QDebug dbg, const NotifyingApplication &a); +QDataStream& operator<<(QDataStream& out, const NotifyingApplication& app); +QDataStream& operator>>(QDataStream& in, NotifyingApplication& app); +QDebug operator<<(QDebug dbg, const NotifyingApplication& a); #endif //NOTIFYINGAPPLICATION_H diff --git a/plugins/sendnotifications/notifyingapplication.cpp b/plugins/sendnotifications/notifyingapplication.cpp --- a/plugins/sendnotifications/notifyingapplication.cpp +++ b/plugins/sendnotifications/notifyingapplication.cpp @@ -23,13 +23,13 @@ #include #include -QDataStream &operator<<(QDataStream &out, const NotifyingApplication &app) +QDataStream& operator<<(QDataStream& out, const NotifyingApplication& app) { out << app.name << app.icon << app.active << app.blacklistExpression.pattern(); return out; } -QDataStream &operator>>(QDataStream &in, NotifyingApplication &app) +QDataStream& operator>>(QDataStream& in, NotifyingApplication& app) { QString pattern; in >> app.name; diff --git a/plugins/sendnotifications/notifyingapplicationmodel.h b/plugins/sendnotifications/notifyingapplicationmodel.h --- a/plugins/sendnotifications/notifyingapplicationmodel.h +++ b/plugins/sendnotifications/notifyingapplicationmodel.h @@ -30,11 +30,11 @@ Q_OBJECT public: - explicit NotifyingApplicationModel(QObject *parent = nullptr); + explicit NotifyingApplicationModel(QObject* parent = nullptr); ~NotifyingApplicationModel() override; QVariant data(const QModelIndex& index, int role) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role) override; + bool setData(const QModelIndex& index, const QVariant& value, int role) override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; Qt::ItemFlags flags(const QModelIndex & index) const override; diff --git a/plugins/sendnotifications/notifyingapplicationmodel.cpp b/plugins/sendnotifications/notifyingapplicationmodel.cpp --- a/plugins/sendnotifications/notifyingapplicationmodel.cpp +++ b/plugins/sendnotifications/notifyingapplicationmodel.cpp @@ -30,7 +30,7 @@ //#include "modeltest.h" -NotifyingApplicationModel::NotifyingApplicationModel(QObject *parent) +NotifyingApplicationModel::NotifyingApplicationModel(QObject* parent) : QAbstractTableModel(parent) { } @@ -149,7 +149,7 @@ return QVariant(); } -bool NotifyingApplicationModel::setData(const QModelIndex &index, const QVariant &value, int role) +bool NotifyingApplicationModel::setData(const QModelIndex& index, const QVariant& value, int role) { if (!index.isValid() || (index.column() != 0 && index.column() != 2) || diff --git a/plugins/sendnotifications/sendnotifications_config.h b/plugins/sendnotifications/sendnotifications_config.h --- a/plugins/sendnotifications/sendnotifications_config.h +++ b/plugins/sendnotifications/sendnotifications_config.h @@ -34,7 +34,7 @@ { Q_OBJECT public: - SendNotificationsConfig(QWidget *parent, const QVariantList&); + SendNotificationsConfig(QWidget* parent, const QVariantList&); ~SendNotificationsConfig() override; public Q_SLOTS: diff --git a/plugins/sendnotifications/sendnotifications_config.cpp b/plugins/sendnotifications/sendnotifications_config.cpp --- a/plugins/sendnotifications/sendnotifications_config.cpp +++ b/plugins/sendnotifications/sendnotifications_config.cpp @@ -27,7 +27,7 @@ K_PLUGIN_FACTORY(SendNotificationsConfigFactory, registerPlugin();) -SendNotificationsConfig::SendNotificationsConfig(QWidget *parent, const QVariantList& args) +SendNotificationsConfig::SendNotificationsConfig(QWidget* parent, const QVariantList& args) : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_sendnotifications_config")) , m_ui(new Ui::SendNotificationsConfigUi()) , appModel(new NotifyingApplicationModel) diff --git a/plugins/sendnotifications/sendnotificationsplugin.h b/plugins/sendnotifications/sendnotificationsplugin.h --- a/plugins/sendnotifications/sendnotificationsplugin.h +++ b/plugins/sendnotifications/sendnotificationsplugin.h @@ -39,7 +39,7 @@ Q_OBJECT public: - explicit SendNotificationsPlugin(QObject *parent, const QVariantList &args); + explicit SendNotificationsPlugin(QObject* parent, const QVariantList& args); ~SendNotificationsPlugin() override; bool receivePackage(const NetworkPackage& np) override; diff --git a/plugins/sftp/kdeconnect_sftp.json b/plugins/sftp/kdeconnect_sftp.json --- a/plugins/sftp/kdeconnect_sftp.json +++ b/plugins/sftp/kdeconnect_sftp.json @@ -24,7 +24,6 @@ "Description[el]": "Περιήγηση του απομακρυσμένου συστήματος αρχείων με χρήση SFTP", "Description[es]": "Navegar por el sistema de archivos del dispositivo remoto usando SFTP", "Description[et]": "Oma seadme failisüsteemi sirvimine SFTP vahendusel", - "Description[eu]": "Arakatu urruneko gailuaren fitxategi-sistema SFTP erabiliz", "Description[fi]": "Selaa etälaitteiden tiedostojärjestelmiä SFTP:llä", "Description[fr]": "Naviguer dans le système de fichiers du périphérique distant en utilisant SFTP", "Description[gl]": "Explore o sistema de ficheiros do dispositivo remoto mediante SFTP.", @@ -62,7 +61,6 @@ "Name[el]": "Περιηγητής απομακρυσμένου συστήματος αρχείων", "Name[es]": "Navegador de sistema de archivos remoto", "Name[et]": "Kaug-failisüsteemi sirvija", - "Name[eu]": "Urruneko fitxategi-sistemaren arakatzailea", "Name[fi]": "Etätiedostojärjestelmäselain", "Name[fr]": "Explorateur à distance du système de fichiers", "Name[gl]": "Navegador do sistema de ficheiros remoto.", diff --git a/plugins/sftp/mounter.h b/plugins/sftp/mounter.h --- a/plugins/sftp/mounter.h +++ b/plugins/sftp/mounter.h @@ -34,7 +34,7 @@ Q_OBJECT public: - explicit Mounter(SftpPlugin *sftp); + explicit Mounter(SftpPlugin* sftp); ~Mounter() override; bool wait(); diff --git a/plugins/sftp/sftpplugin.h b/plugins/sftp/sftpplugin.h --- a/plugins/sftp/sftpplugin.h +++ b/plugins/sftp/sftpplugin.h @@ -35,7 +35,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.sftp") public: - explicit SftpPlugin(QObject *parent, const QVariantList &args); + explicit SftpPlugin(QObject* parent, const QVariantList& args); ~SftpPlugin() override; bool receivePackage(const NetworkPackage& np) override; @@ -69,7 +69,7 @@ private: struct Pimpl; - QScopedPointer m_d; + QScopedPointer d; QString deviceId; //Storing it to avoid accessing device() from the destructor which could cause a crash QVariantMap remoteDirectories; //Actually a QMap, but QDBus preffers this diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -42,16 +42,16 @@ struct SftpPlugin::Pimpl { - Pimpl() : mounter(nullptr) {} + Pimpl() : m_mounter(nullptr) {} //Add KIO entry to Dolphin's Places - KFilePlacesModel placesModel; - Mounter* mounter; + KFilePlacesModel m_placesModel; + Mounter* m_mounter; }; -SftpPlugin::SftpPlugin(QObject *parent, const QVariantList &args) +SftpPlugin::SftpPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) - , m_d(new Pimpl()) + , d(new Pimpl()) { deviceId = device()->id(); addToDolphin(); @@ -69,51 +69,51 @@ { removeFromDolphin(); QUrl kioUrl("kdeconnect://"+deviceId+"/"); - m_d->placesModel.addPlace(device()->name(), kioUrl, QStringLiteral("kdeconnect")); + d->m_placesModel.addPlace(device()->name(), kioUrl, QStringLiteral("kdeconnect")); qCDebug(KDECONNECT_PLUGIN_SFTP) << "add to dolphin"; } void SftpPlugin::removeFromDolphin() { QUrl kioUrl("kdeconnect://"+deviceId+"/"); - QModelIndex index = m_d->placesModel.closestItem(kioUrl); + QModelIndex index = d->m_placesModel.closestItem(kioUrl); while (index.row() != -1) { - m_d->placesModel.removePlace(index); - index = m_d->placesModel.closestItem(kioUrl); + d->m_placesModel.removePlace(index); + index = d->m_placesModel.closestItem(kioUrl); } } void SftpPlugin::mount() { qCDebug(KDECONNECT_PLUGIN_SFTP) << "Mount device:" << device()->name(); - if (m_d->mounter) { + if (d->m_mounter) { return; } - m_d->mounter = new Mounter(this); - connect(m_d->mounter, &Mounter::mounted, this, &SftpPlugin::onMounted); - connect(m_d->mounter, &Mounter::unmounted, this, &SftpPlugin::onUnmounted); - connect(m_d->mounter, &Mounter::failed, this, &SftpPlugin::onFailed); + d->m_mounter = new Mounter(this); + connect(d->m_mounter, &Mounter::mounted, this, &SftpPlugin::onMounted); + connect(d->m_mounter, &Mounter::unmounted, this, &SftpPlugin::onUnmounted); + connect(d->m_mounter, &Mounter::failed, this, &SftpPlugin::onFailed); } void SftpPlugin::unmount() { - if (m_d->mounter) + if (d->m_mounter) { - m_d->mounter->deleteLater(); - m_d->mounter = nullptr; + d->m_mounter->deleteLater(); + d->m_mounter = nullptr; } } bool SftpPlugin::mountAndWait() { mount(); - return m_d->mounter->wait(); + return d->m_mounter->wait(); } bool SftpPlugin::isMounted() const { - return m_d->mounter && m_d->mounter->isMounted(); + return d->m_mounter && d->m_mounter->isMounted(); } bool SftpPlugin::startBrowsing() diff --git a/plugins/share/kdeconnect_share.json b/plugins/share/kdeconnect_share.json --- a/plugins/share/kdeconnect_share.json +++ b/plugins/share/kdeconnect_share.json @@ -22,7 +22,6 @@ "Description[el]": "Εύκολη λήψη και αποστολή αρχείων, URL ή απλού κειμένου", "Description[es]": "Recibir y enviar archivos, URL o texto sin formato fácilmente", "Description[et]": "Failide, URL-ide või lihtteksti hõlpus vastuvõtmine ja saatmine", - "Description[eu]": "Jaso eta bidali fitxategiak, URL-ak, edo testu soila erraz", "Description[fi]": "Vastaanota ja lähetä tiedostoja, verkko-osoitteita tai tekstiä helposti", "Description[fr]": "Recevoir et envoyer des fichiers, des URLs ou du texte brut facilement", "Description[gl]": "Comparta e reciba con facilidade ficheiros, enderezos URL ou texto simple.", @@ -60,7 +59,6 @@ "Name[el]": "Διαμοιρασμός και λήψη", "Name[es]": "Compartir y recibir", "Name[et]": "Jagamine ja vastuvõtmine", - "Name[eu]": "Partekatu eta jaso", "Name[fi]": "Jaa ja vastaanota", "Name[fr]": "Partager et recevoir", "Name[gl]": "Compartir e recibir.", diff --git a/plugins/share/kdeconnect_share_config.desktop b/plugins/share/kdeconnect_share_config.desktop --- a/plugins/share/kdeconnect_share_config.desktop +++ b/plugins/share/kdeconnect_share_config.desktop @@ -19,7 +19,6 @@ Name[en_GB]=Share plugin settings Name[es]=Ajustes del complemento para compartir Name[et]=Jagamisplugina seadistused -Name[eu]=Partekatu pluginaren ezarpenak Name[fi]=Jakoliitännäisen asetukset Name[fr]=Paramètres du module de partage Name[gl]=Configuración do complemento de compartir diff --git a/plugins/share/share_config.h b/plugins/share/share_config.h --- a/plugins/share/share_config.h +++ b/plugins/share/share_config.h @@ -32,7 +32,7 @@ { Q_OBJECT public: - ShareConfig(QWidget *parent, const QVariantList&); + ShareConfig(QWidget* parent, const QVariantList&); ~ShareConfig() override; public Q_SLOTS: diff --git a/plugins/share/share_config.cpp b/plugins/share/share_config.cpp --- a/plugins/share/share_config.cpp +++ b/plugins/share/share_config.cpp @@ -28,7 +28,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) -ShareConfig::ShareConfig(QWidget *parent, const QVariantList& args) +ShareConfig::ShareConfig(QWidget* parent, const QVariantList& args) : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_share_config")) , m_ui(new Ui::ShareConfigUi()) { diff --git a/plugins/share/shareplugin.h b/plugins/share/shareplugin.h --- a/plugins/share/shareplugin.h +++ b/plugins/share/shareplugin.h @@ -35,7 +35,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.share") public: - explicit SharePlugin(QObject *parent, const QVariantList &args); + explicit SharePlugin(QObject* parent, const QVariantList& args); ///Helper method, QDBus won't recognize QUrl Q_SCRIPTABLE void shareUrl(const QString& url) { shareUrl(QUrl(url)); } diff --git a/plugins/telephony/kdeconnect_telephony.json b/plugins/telephony/kdeconnect_telephony.json --- a/plugins/telephony/kdeconnect_telephony.json +++ b/plugins/telephony/kdeconnect_telephony.json @@ -22,7 +22,6 @@ "Description[el]": "Εμφάνιση ειδοποιήσεων για κλήσεις και SMS", "Description[es]": "Mostrar notificaciones de llamadas y SMS", "Description[et]": "Kõnede ja SMS-ide märguannete näitamine", - "Description[eu]": "Erakutsi deien eta SMS mezuen jakinarazpenak", "Description[fi]": "Näytä puhelujen ja tekstiviestien ilmoitukset", "Description[fr]": "Affichez les notifications pour les appels et les SMS", "Description[gl]": "Mostrar notificacións de chamadas e mensaxes SMS.", @@ -57,7 +56,6 @@ "Name[el]": "Ενσωμάτωση τηλεφωνίας", "Name[es]": "Integración con el teléfono", "Name[et]": "Telefoniga lõimimine", - "Name[eu]": "Telefoniarekin integrazioa", "Name[fi]": "Puhelinintegrointi", "Name[fr]": "Intégration de la téléphonie", "Name[gl]": "Integración telefónica", diff --git a/plugins/telephony/sendsmsdialog.h b/plugins/telephony/sendsmsdialog.h --- a/plugins/telephony/sendsmsdialog.h +++ b/plugins/telephony/sendsmsdialog.h @@ -33,7 +33,7 @@ Q_OBJECT public: - explicit SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget *parent = nullptr); + explicit SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget* parent = nullptr); QSize sizeHint() const override; private Q_SLOTS: @@ -43,8 +43,8 @@ void sendSms(const QString& phoneNumber, const QString& messageBody); private: - QString mPhoneNumber; - QTextEdit *mTextEdit; + QString m_phoneNumber; + QTextEdit* m_textEdit; }; #endif diff --git a/plugins/telephony/sendsmsdialog.cpp b/plugins/telephony/sendsmsdialog.cpp --- a/plugins/telephony/sendsmsdialog.cpp +++ b/plugins/telephony/sendsmsdialog.cpp @@ -29,7 +29,7 @@ SendSmsDialog::SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget* parent) : QDialog(parent) - , mPhoneNumber(phoneNumber) + , m_phoneNumber(phoneNumber) { QVBoxLayout* layout = new QVBoxLayout; @@ -38,8 +38,8 @@ textView->setText(contactName + ": \n" + originalMessage); layout->addWidget(textView); - mTextEdit = new QTextEdit(this); - layout->addWidget(mTextEdit); + m_textEdit = new QTextEdit(this); + layout->addWidget(m_textEdit); QPushButton* sendButton = new QPushButton(i18n("Send"), this); connect(sendButton, &QAbstractButton::clicked, this, &SendSmsDialog::sendButtonClicked); @@ -54,7 +54,7 @@ void SendSmsDialog::sendButtonClicked() { - Q_EMIT sendSms(mPhoneNumber, mTextEdit->toPlainText()); + Q_EMIT sendSms(m_phoneNumber, m_textEdit->toPlainText()); close(); } diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telephony/telephonyplugin.h --- a/plugins/telephony/telephonyplugin.h +++ b/plugins/telephony/telephonyplugin.h @@ -40,7 +40,7 @@ Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.telephony") public: - explicit TelephonyPlugin(QObject *parent, const QVariantList &args); + explicit TelephonyPlugin(QObject* parent, const QVariantList& args); bool receivePackage(const NetworkPackage& np) override; void connected() override {} diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp --- a/plugins/telephony/telephonyplugin.cpp +++ b/plugins/telephony/telephonyplugin.cpp @@ -33,7 +33,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY, "kdeconnect.plugin.telephony") -TelephonyPlugin::TelephonyPlugin(QObject *parent, const QVariantList &args) +TelephonyPlugin::TelephonyPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , m_telepathyInterface(QStringLiteral("org.freedesktop.Telepathy.ConnectionManager.kdeconnect"), QStringLiteral("/kdeconnect")) { diff --git a/tests/downloadjobtest.cpp b/tests/downloadjobtest.cpp --- a/tests/downloadjobtest.cpp +++ b/tests/downloadjobtest.cpp @@ -43,37 +43,37 @@ void awaitToBeDestroyedOrTimeOut(); void stopServer(); - QPointer test; - QPointer mServer; + QPointer m_test; + QPointer m_server; }; void DownloadJobTest::initServer() { - delete mServer; - mServer = new QTcpServer(this); - QVERIFY2(mServer->listen(QHostAddress::LocalHost, 8694), "Failed to create local tcp server"); + delete m_server; + m_server = new QTcpServer(this); + QVERIFY2(m_server->listen(QHostAddress::LocalHost, 8694), "Failed to create local tcp server"); } void DownloadJobTest::failToConnectShouldDestroyTheJob() { // no initServer - test = new DownloadJob(QHostAddress::LocalHost, {{"port", 8694}}); + m_test = new DownloadJob(QHostAddress::LocalHost, {{"port", 8694}}); - QSignalSpy spy(test.data(), &KJob::finished); - test->start(); + QSignalSpy spy(m_test.data(), &KJob::finished); + m_test->start(); QVERIFY(spy.count() || spy.wait()); - QCOMPARE(test->error(), 1); + QCOMPARE(m_test->error(), 1); } void DownloadJobTest::closingTheConnectionShouldDestroyTheJob() { initServer(); - test = new DownloadJob(QHostAddress::LocalHost, {{"port", 8694}}); - QSignalSpy spy(test.data(), &KJob::finished); - test->start(); - mServer->close(); + m_test = new DownloadJob(QHostAddress::LocalHost, {{"port", 8694}}); + QSignalSpy spy(m_test.data(), &KJob::finished); + m_test->start(); + m_server->close(); QVERIFY(spy.count() || spy.wait(2000)); } diff --git a/tests/lanlinkprovidertest.cpp b/tests/lanlinkprovidertest.cpp --- a/tests/lanlinkprovidertest.cpp +++ b/tests/lanlinkprovidertest.cpp @@ -41,7 +41,7 @@ Q_OBJECT public: explicit LanLinkProviderTest() - : mLanLinkProvider(true) { + : m_lanLinkProvider(true) { QStandardPaths::setTestModeEnabled(true); } @@ -60,22 +60,22 @@ private: const int TEST_PORT = 8520; // Add some private fields here - LanLinkProvider mLanLinkProvider; - Server* mServer; - SocketLineReader* mReader; - QUdpSocket* mUdpSocket; - QString mIdentityPackage; + LanLinkProvider m_lanLinkProvider; + Server* m_server; + SocketLineReader* m_reader; + QUdpSocket* m_udpSocket; + QString m_identityPackage; // Attributes for test device - QString deviceId; - QString name; - QCA::PrivateKey privateKey; - QSslCertificate certificate; + QString m_deviceId; + QString m_name; + QCA::PrivateKey m_privateKey; + QSslCertificate m_certificate; QSslCertificate generateCertificate(QString&, QCA::PrivateKey&); void addTrustedDevice(); void removeTrustedDevice(); - void setSocketAttributes(QSslSocket *socket); + void setSocketAttributes(QSslSocket* socket); void testIdentityPackage(QByteArray& identityPackage); }; @@ -84,14 +84,14 @@ { removeTrustedDevice(); // Remove trusted device if left by chance by any test - deviceId = QStringLiteral("testdevice"); - name = QStringLiteral("Test Device"); - privateKey = QCA::KeyGenerator().createRSA(2048); - certificate = generateCertificate(deviceId, privateKey); + m_deviceId = QStringLiteral("testdevice"); + m_name = QStringLiteral("Test Device"); + m_privateKey = QCA::KeyGenerator().createRSA(2048); + m_certificate = generateCertificate(m_deviceId, m_privateKey); - mLanLinkProvider.onStart(); + m_lanLinkProvider.onStart(); - mIdentityPackage = QStringLiteral("{\"id\":1439365924847,\"type\":\"kdeconnect.identity\",\"body\":{\"deviceId\":\"testdevice\",\"deviceName\":\"Test Device\",\"protocolVersion\":6,\"deviceType\":\"phone\",\"tcpPort\":") + QString::number(TEST_PORT) + QStringLiteral("}}"); + m_identityPackage = QStringLiteral("{\"id\":1439365924847,\"type\":\"kdeconnect.identity\",\"body\":{\"deviceId\":\"testdevice\",\"deviceName\":\"Test Device\",\"protocolVersion\":6,\"deviceType\":\"phone\",\"tcpPort\":") + QString::number(TEST_PORT) + QStringLiteral("}}"); } void LanLinkProviderTest::pairedDeviceTcpPackageReceived() @@ -104,7 +104,7 @@ QVERIFY(b); QSignalSpy spy(mUdpServer, SIGNAL(readyRead())); - mLanLinkProvider.onNetworkChange(); + m_lanLinkProvider.onNetworkChange(); QVERIFY(!spy.isEmpty() || spy.wait()); QByteArray datagram; @@ -127,7 +127,7 @@ QVERIFY2(socket.isOpen(), "Socket disconnected immediately"); - socket.write(mIdentityPackage.toLatin1()); + socket.write(m_identityPackage.toLatin1()); socket.waitForBytesWritten(2000); QSignalSpy spy3(&socket, SIGNAL(encrypted())); @@ -154,29 +154,29 @@ KdeConnectConfig* kcc = KdeConnectConfig::instance(); addTrustedDevice(); - mServer = new Server(this); - mUdpSocket = new QUdpSocket(this); + m_server = new Server(this); + m_udpSocket = new QUdpSocket(this); - mServer->listen(QHostAddress::LocalHost, TEST_PORT); + m_server->listen(QHostAddress::LocalHost, TEST_PORT); - QSignalSpy spy(mServer, SIGNAL(newConnection())); + QSignalSpy spy(m_server, SIGNAL(newConnection())); - qint64 bytesWritten = mUdpSocket->writeDatagram(mIdentityPackage.toLatin1(), QHostAddress::LocalHost, LanLinkProvider::UDP_PORT); // write an identity package to udp socket here, we do not broadcast it here - QCOMPARE(bytesWritten, mIdentityPackage.size()); + qint64 bytesWritten = m_udpSocket->writeDatagram(m_identityPackage.toLatin1(), QHostAddress::LocalHost, LanLinkProvider::UDP_PORT); // write an identity package to udp socket here, we do not broadcast it here + QCOMPARE(bytesWritten, m_identityPackage.size()); // We should have an incoming connection now, wait for incoming connection QVERIFY(!spy.isEmpty() || spy.wait()); - QSslSocket* serverSocket = mServer->nextPendingConnection(); + QSslSocket* serverSocket = m_server->nextPendingConnection(); QVERIFY2(serverSocket != 0, "Server socket is null"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); - mReader = new SocketLineReader(serverSocket, this); - QSignalSpy spy2(mReader, SIGNAL(readyRead())); + m_reader = new SocketLineReader(serverSocket, this); + QSignalSpy spy2(m_reader, SIGNAL(readyRead())); QVERIFY(spy2.wait()); - QByteArray receivedPackage = mReader->readLine(); + QByteArray receivedPackage = m_reader->readLine(); testIdentityPackage(receivedPackage); // Received identiy package from LanLinkProvider now start ssl @@ -201,8 +201,8 @@ removeTrustedDevice(); - delete mServer; - delete mUdpSocket; + delete m_server; + delete m_udpSocket; } void LanLinkProviderTest::unpairedDeviceTcpPackageReceived() @@ -212,7 +212,7 @@ QVERIFY(b); QSignalSpy spy(mUdpServer, SIGNAL(readyRead())); - mLanLinkProvider.onNetworkChange(); + m_lanLinkProvider.onNetworkChange(); QVERIFY(!spy.isEmpty() || spy.wait()); QByteArray datagram; @@ -235,7 +235,7 @@ QVERIFY2(socket.isOpen(), "Socket disconnected immediately"); - socket.write(mIdentityPackage.toLatin1()); + socket.write(m_identityPackage.toLatin1()); socket.waitForBytesWritten(2000); QSignalSpy spy3(&socket, SIGNAL(encrypted())); @@ -257,27 +257,27 @@ void LanLinkProviderTest::unpairedDeviceUdpPackageReceived() { - mServer = new Server(this); - mUdpSocket = new QUdpSocket(this); + m_server = new Server(this); + m_udpSocket = new QUdpSocket(this); - mServer->listen(QHostAddress::LocalHost, TEST_PORT); + m_server->listen(QHostAddress::LocalHost, TEST_PORT); - QSignalSpy spy(mServer, &Server::newConnection); - qint64 bytesWritten = mUdpSocket->writeDatagram(mIdentityPackage.toLatin1(), QHostAddress::LocalHost, LanLinkProvider::UDP_PORT); // write an identity package to udp socket here, we do not broadcast it here - QCOMPARE(bytesWritten, mIdentityPackage.size()); + QSignalSpy spy(m_server, &Server::newConnection); + qint64 bytesWritten = m_udpSocket->writeDatagram(m_identityPackage.toLatin1(), QHostAddress::LocalHost, LanLinkProvider::UDP_PORT); // write an identity package to udp socket here, we do not broadcast it here + QCOMPARE(bytesWritten, m_identityPackage.size()); QVERIFY(!spy.isEmpty() || spy.wait()); - QSslSocket* serverSocket = mServer->nextPendingConnection(); + QSslSocket* serverSocket = m_server->nextPendingConnection(); QVERIFY2(serverSocket != 0, "Server socket is null"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); - mReader = new SocketLineReader(serverSocket, this); - QSignalSpy spy2(mReader, &SocketLineReader::readyRead); + m_reader = new SocketLineReader(serverSocket, this); + QSignalSpy spy2(m_reader, &SocketLineReader::readyRead); QVERIFY(spy2.wait()); - QByteArray receivedPackage = mReader->readLine(); + QByteArray receivedPackage = m_reader->readLine(); QVERIFY2(!receivedPackage.isEmpty(), "Empty package received"); testIdentityPackage(receivedPackage); @@ -295,11 +295,11 @@ QVERIFY2(serverSocket->isEncrypted(), "Server socket not yet encrypted"); QVERIFY2(!serverSocket->peerCertificate().isNull(), "Peer certificate is null"); - delete mServer; - delete mUdpSocket; + delete m_server; + delete m_udpSocket; } -void LanLinkProviderTest::testIdentityPackage(QByteArray &identityPackage) +void LanLinkProviderTest::testIdentityPackage(QByteArray& identityPackage) { QJsonDocument jsonDocument = QJsonDocument::fromJson(identityPackage); QJsonObject jsonObject = jsonDocument.object(); @@ -331,23 +331,23 @@ return certificate; } -void LanLinkProviderTest::setSocketAttributes(QSslSocket *socket) +void LanLinkProviderTest::setSocketAttributes(QSslSocket* socket) { - socket->setPrivateKey(QSslKey(privateKey.toPEM().toLatin1(), QSsl::Rsa)); - socket->setLocalCertificate(certificate); + socket->setPrivateKey(QSslKey(m_privateKey.toPEM().toLatin1(), QSsl::Rsa)); + socket->setLocalCertificate(m_certificate); } void LanLinkProviderTest::addTrustedDevice() { - KdeConnectConfig *kcc = KdeConnectConfig::instance(); - kcc->addTrustedDevice(deviceId, name, QStringLiteral("phone")); - kcc->setDeviceProperty(deviceId, QStringLiteral("certificate"), QString::fromLatin1(certificate.toPem())); + KdeConnectConfig* kcc = KdeConnectConfig::instance(); + kcc->addTrustedDevice(m_deviceId, m_name, QStringLiteral("phone")); + kcc->setDeviceProperty(m_deviceId, QStringLiteral("certificate"), QString::fromLatin1(m_certificate.toPem())); } void LanLinkProviderTest::removeTrustedDevice() { - KdeConnectConfig *kcc = KdeConnectConfig::instance(); - kcc->removeTrustedDevice(deviceId); + KdeConnectConfig* kcc = KdeConnectConfig::instance(); + kcc->removeTrustedDevice(m_deviceId); } diff --git a/tests/networkpackagetests.cpp b/tests/networkpackagetests.cpp --- a/tests/networkpackagetests.cpp +++ b/tests/networkpackagetests.cpp @@ -74,7 +74,7 @@ NetworkPackage np(QLatin1String("")); NetworkPackage::createIdentityPackage(&np); - QCOMPARE( np.get("protocolVersion", -1) , NetworkPackage::ProtocolVersion ); + QCOMPARE( np.get("protocolVersion", -1) , NetworkPackage::s_protocolVersion ); QCOMPARE( np.type() , PACKAGE_TYPE_IDENTITY ); } diff --git a/tests/pluginloadtest.cpp b/tests/pluginloadtest.cpp --- a/tests/pluginloadtest.cpp +++ b/tests/pluginloadtest.cpp @@ -41,14 +41,14 @@ public: PluginLoadTest() { QStandardPaths::setTestModeEnabled(true); - mDaemon = new TestDaemon; + m_daemon = new TestDaemon; } private Q_SLOTS: void testPlugins() { Device* d = nullptr; - mDaemon->acquireDiscoveryMode(QStringLiteral("plugintest")); - const QList devicesList = mDaemon->devicesList(); + m_daemon->acquireDiscoveryMode(QStringLiteral("plugintest")); + const QList devicesList = m_daemon->devicesList(); for (Device* id : devicesList) { if (id->isReachable()) { if (!id->isTrusted()) @@ -57,7 +57,7 @@ break; } } - mDaemon->releaseDiscoveryMode(QStringLiteral("plugintest")); + m_daemon->releaseDiscoveryMode(QStringLiteral("plugintest")); if (!d->loadedPlugins().contains(QStringLiteral("kdeconnect_remotecontrol"))) { QSKIP("kdeconnect_remotecontrol is required for this test"); @@ -77,7 +77,7 @@ } private: - TestDaemon* mDaemon; + TestDaemon* m_daemon; }; QTEST_MAIN(PluginLoadTest); diff --git a/tests/sendfiletest.cpp b/tests/sendfiletest.cpp --- a/tests/sendfiletest.cpp +++ b/tests/sendfiletest.cpp @@ -45,14 +45,14 @@ public: TestSendFile() { QStandardPaths::setTestModeEnabled(true); - mDaemon = new TestDaemon; + m_daemon = new TestDaemon; } private Q_SLOTS: void testSend() { - mDaemon->acquireDiscoveryMode(QStringLiteral("test")); + m_daemon->acquireDiscoveryMode(QStringLiteral("test")); Device* d = nullptr; - const QList devicesList = mDaemon->devicesList(); + const QList devicesList = m_daemon->devicesList(); for (Device* id : devicesList) { if (id->isReachable()) { if (!id->isTrusted()) @@ -60,7 +60,7 @@ d = id; } } - mDaemon->releaseDiscoveryMode(QStringLiteral("test")); + m_daemon->releaseDiscoveryMode(QStringLiteral("test")); QVERIFY(d); QCOMPARE(d->isReachable(), true); QCOMPARE(d->isTrusted(), true); @@ -141,7 +141,7 @@ } private: - TestDaemon* mDaemon; + TestDaemon* m_daemon; }; QTEST_MAIN(TestSendFile); diff --git a/tests/testnotificationlistener.cpp b/tests/testnotificationlistener.cpp --- a/tests/testnotificationlistener.cpp +++ b/tests/testnotificationlistener.cpp @@ -42,7 +42,7 @@ { Q_OBJECT public: - explicit TestNotificationsPlugin(QObject *parent, const QVariantList &args) + explicit TestNotificationsPlugin(QObject* parent, const QVariantList& args) : SendNotificationsPlugin(parent, args) { } @@ -68,7 +68,7 @@ Q_OBJECT private: int sentPackages; - NetworkPackage *lastPackage; + NetworkPackage* lastPackage; public: explicit TestDevice(QObject* parent, const QString& id) @@ -128,12 +128,12 @@ QHash& getApplications() { - return applications; + return m_applications; } void setApplications(const QHash& value) { - applications = value; + m_applications = value; } protected: @@ -178,7 +178,7 @@ // QString dId(QStringLiteral("testid")); - TestDevice *d = new TestDevice(nullptr, dId); + TestDevice* d = new TestDevice(nullptr, dId); int proxiedNotifications = 0; QCOMPARE(proxiedNotifications, d->getSentPackages()); @@ -416,7 +416,7 @@ // image-data in hints // set up: - QBuffer *buffer; + QBuffer* buffer; QImage image; int width = 2, height = 2, rowStride = 4*width, bitsPerSample = 8, channels = 4; diff --git a/tests/testsocketlinereader.cpp b/tests/testsocketlinereader.cpp --- a/tests/testsocketlinereader.cpp +++ b/tests/testsocketlinereader.cpp @@ -36,31 +36,31 @@ void socketLineReader(); private: - QTimer mTimer; - QEventLoop mLoop; - QList mPackages; - Server *mServer; - QSslSocket *mConn; - SocketLineReader *mReader; + QTimer m_timer; + QEventLoop m_loop; + QList m_packages; + Server* m_server; + QSslSocket* m_conn; + SocketLineReader* m_reader; }; void TestSocketLineReader::initTestCase() { - mServer = new Server(this); + m_server = new Server(this); - QVERIFY2(mServer->listen(QHostAddress::LocalHost, 8694), "Failed to create local tcp server"); + QVERIFY2(m_server->listen(QHostAddress::LocalHost, 8694), "Failed to create local tcp server"); - mTimer.setInterval(4000);//For second is more enough to send some data via local socket - mTimer.setSingleShot(true); - connect(&mTimer, &QTimer::timeout, &mLoop, &QEventLoop::quit); + m_timer.setInterval(4000);//For second is more enough to send some data via local socket + m_timer.setSingleShot(true); + connect(&m_timer, &QTimer::timeout, &m_loop, &QEventLoop::quit); - mConn = new QSslSocket(this); - mConn->connectToHost(QHostAddress::LocalHost, 8694); - connect(mConn, &QAbstractSocket::connected, &mLoop, &QEventLoop::quit); - mTimer.start(); - mLoop.exec(); + m_conn = new QSslSocket(this); + m_conn->connectToHost(QHostAddress::LocalHost, 8694); + connect(m_conn, &QAbstractSocket::connected, &m_loop, &QEventLoop::quit); + m_timer.start(); + m_loop.exec(); - QVERIFY2(mConn->isOpen(), "Could not connect to local tcp server"); + QVERIFY2(m_conn->isOpen(), "Could not connect to local tcp server"); } void TestSocketLineReader::socketLineReader() @@ -68,50 +68,50 @@ QList dataToSend; dataToSend << "foobar\n" << "barfoo\n" << "foobar?\n" << "\n" << "barfoo!\n" << "panda\n"; for (const QByteArray& line : dataToSend) { - mConn->write(line); + m_conn->write(line); } - mConn->flush(); + m_conn->flush(); int maxAttemps = 5; - while(!mServer->hasPendingConnections() && maxAttemps > 0) { + while(!m_server->hasPendingConnections() && maxAttemps > 0) { --maxAttemps; QTest::qSleep(1000); } - QSslSocket *sock = mServer->nextPendingConnection(); + QSslSocket* sock = m_server->nextPendingConnection(); QVERIFY2(sock != nullptr, "Could not open a connection to the client"); - mReader = new SocketLineReader(sock, this); - connect(mReader, &SocketLineReader::readyRead, this, &TestSocketLineReader::newPackage); - mTimer.start(); - mLoop.exec(); + m_reader = new SocketLineReader(sock, this); + connect(m_reader, &SocketLineReader::readyRead, this, &TestSocketLineReader::newPackage); + m_timer.start(); + m_loop.exec(); /* remove the empty line before compare */ dataToSend.removeOne("\n"); - QCOMPARE(mPackages.count(), 5);//We expect 5 Packages + QCOMPARE(m_packages.count(), 5);//We expect 5 Packages for(int x = 0;x < 5; ++x) { - QCOMPARE(mPackages[x], dataToSend[x]); + QCOMPARE(m_packages[x], dataToSend[x]); } } void TestSocketLineReader::newPackage() { - if (!mReader->bytesAvailable()) { + if (!m_reader->bytesAvailable()) { return; } int maxLoops = 5; - while(mReader->bytesAvailable() > 0 && maxLoops > 0) { + while(m_reader->bytesAvailable() > 0 && maxLoops > 0) { --maxLoops; - const QByteArray package = mReader->readLine(); + const QByteArray package = m_reader->readLine(); if (!package.isEmpty()) { - mPackages.append(package); + m_packages.append(package); } - if (mPackages.count() == 5) { - mLoop.exit(); + if (m_packages.count() == 5) { + m_loop.exit(); } } } diff --git a/tests/testsslsocketlinereader.cpp b/tests/testsslsocketlinereader.cpp --- a/tests/testsslsocketlinereader.cpp +++ b/tests/testsslsocketlinereader.cpp @@ -50,13 +50,13 @@ private: const int PORT = 7894; - QTimer mTimer; - QCA::Initializer mQcaInitializer; - QEventLoop mLoop; - QList mPackages; - Server *mServer; - QSslSocket *mClientSocket; - SocketLineReader *mReader; + QTimer m_timer; + QCA::Initializer m_qcaInitializer; + QEventLoop m_loop; + QList m_packages; + Server* m_server; + QSslSocket* m_clientSocket; + SocketLineReader* m_reader; private: void setSocketAttributes(QSslSocket* socket, QString deviceName); @@ -64,224 +64,224 @@ void TestSslSocketLineReader::initTestCase() { - mServer = new Server(this); + m_server = new Server(this); - QVERIFY2(mServer->listen(QHostAddress::LocalHost, PORT), "Failed to create local tcp server"); + QVERIFY2(m_server->listen(QHostAddress::LocalHost, PORT), "Failed to create local tcp server"); - mTimer.setInterval(10 * 1000);//Ten second is more enough for this test, just used this so that to break mLoop if stuck - mTimer.setSingleShot(true); - connect(&mTimer, &QTimer::timeout, &mLoop, &QEventLoop::quit); + m_timer.setInterval(10 * 1000);//Ten second is more enough for this test, just used this so that to break mLoop if stuck + m_timer.setSingleShot(true); + connect(&m_timer, &QTimer::timeout, &m_loop, &QEventLoop::quit); - mTimer.start(); + m_timer.start(); } void TestSslSocketLineReader::init() { - mClientSocket = new QSslSocket(this); - mClientSocket->connectToHost(QHostAddress::LocalHost, PORT); - connect(mClientSocket, &QAbstractSocket::connected, &mLoop, &QEventLoop::quit); + m_clientSocket = new QSslSocket(this); + m_clientSocket->connectToHost(QHostAddress::LocalHost, PORT); + connect(m_clientSocket, &QAbstractSocket::connected, &m_loop, &QEventLoop::quit); - mLoop.exec(); + m_loop.exec(); - QVERIFY2(mClientSocket->isOpen(), "Could not connect to local tcp server"); + QVERIFY2(m_clientSocket->isOpen(), "Could not connect to local tcp server"); } void TestSslSocketLineReader::cleanup() { - mClientSocket->disconnectFromHost(); - delete mClientSocket; + m_clientSocket->disconnectFromHost(); + delete m_clientSocket; } void TestSslSocketLineReader::cleanupTestCase() { - delete mServer; + delete m_server; } void TestSslSocketLineReader::testTrustedDevice() { int maxAttemps = 5; - QCOMPARE(true, mServer->hasPendingConnections()); - while(!mServer->hasPendingConnections() && maxAttemps > 0) { + QCOMPARE(true, m_server->hasPendingConnections()); + while(!m_server->hasPendingConnections() && maxAttemps > 0) { --maxAttemps; QTest::qSleep(1000); } - QSslSocket *serverSocket = mServer->nextPendingConnection(); + QSslSocket* serverSocket = m_server->nextPendingConnection(); QVERIFY2(serverSocket != 0, "Null socket returned by server"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); setSocketAttributes(serverSocket, QStringLiteral("Test Server")); - setSocketAttributes(mClientSocket, QStringLiteral("Test Client")); + setSocketAttributes(m_clientSocket, QStringLiteral("Test Client")); serverSocket->setPeerVerifyName(QStringLiteral("Test Client")); serverSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); - serverSocket->addCaCertificate(mClientSocket->localCertificate()); + serverSocket->addCaCertificate(m_clientSocket->localCertificate()); - mClientSocket->setPeerVerifyName(QStringLiteral("Test Server")); - mClientSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); - mClientSocket->addCaCertificate(serverSocket->localCertificate()); + m_clientSocket->setPeerVerifyName(QStringLiteral("Test Server")); + m_clientSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); + m_clientSocket->addCaCertificate(serverSocket->localCertificate()); - connect(mClientSocket, &QSslSocket::encrypted, &mLoop, &QEventLoop::quit); + connect(m_clientSocket, &QSslSocket::encrypted, &m_loop, &QEventLoop::quit); serverSocket->startServerEncryption(); - mClientSocket->startClientEncryption(); - mLoop.exec(); + m_clientSocket->startClientEncryption(); + m_loop.exec(); // Both client and server socket should be encrypted here and should have remote certificate because VerifyPeer is used - QVERIFY2(mClientSocket->isOpen(), "Client socket already closed"); + QVERIFY2(m_clientSocket->isOpen(), "Client socket already closed"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); - QVERIFY2(mClientSocket->isEncrypted(), "Client is not encrypted"); + QVERIFY2(m_clientSocket->isEncrypted(), "Client is not encrypted"); QVERIFY2(serverSocket->isEncrypted(), "Server is not encrypted"); - QVERIFY2(!mClientSocket->peerCertificate().isNull(), "Server certificate not received"); + QVERIFY2(!m_clientSocket->peerCertificate().isNull(), "Server certificate not received"); QVERIFY2(!serverSocket->peerCertificate().isNull(), "Client certificate not received"); QList dataToSend; dataToSend << "foobar\n" << "barfoo\n" << "foobar?\n" << "\n" << "barfoo!\n" << "panda\n"; - for (const QByteArray &line : dataToSend) { - mClientSocket->write(line); + for (const QByteArray& line : dataToSend) { + m_clientSocket->write(line); } - mClientSocket->flush(); + m_clientSocket->flush(); - mPackages.clear(); + m_packages.clear(); - mReader = new SocketLineReader(serverSocket, this); - connect(mReader, &SocketLineReader::readyRead, this,&TestSslSocketLineReader::newPackage); - mLoop.exec(); + m_reader = new SocketLineReader(serverSocket, this); + connect(m_reader, &SocketLineReader::readyRead, this,&TestSslSocketLineReader::newPackage); + m_loop.exec(); /* remove the empty line before compare */ dataToSend.removeOne("\n"); - QCOMPARE(mPackages.count(), 5);//We expect 5 Packages + QCOMPARE(m_packages.count(), 5);//We expect 5 Packages for(int x = 0;x < 5; ++x) { - QCOMPARE(mPackages[x], dataToSend[x]); + QCOMPARE(m_packages[x], dataToSend[x]); } - delete mReader; + delete m_reader; } void TestSslSocketLineReader::testUntrustedDevice() { int maxAttemps = 5; - QCOMPARE(true, mServer->hasPendingConnections()); - while(!mServer->hasPendingConnections() && maxAttemps > 0) { + QCOMPARE(true, m_server->hasPendingConnections()); + while(!m_server->hasPendingConnections() && maxAttemps > 0) { --maxAttemps; QTest::qSleep(1000); } - QSslSocket *serverSocket = mServer->nextPendingConnection(); + QSslSocket* serverSocket = m_server->nextPendingConnection(); QVERIFY2(serverSocket != 0, "Null socket returned by server"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); setSocketAttributes(serverSocket, QStringLiteral("Test Server")); - setSocketAttributes(mClientSocket, QStringLiteral("Test Client")); + setSocketAttributes(m_clientSocket, QStringLiteral("Test Client")); serverSocket->setPeerVerifyName(QStringLiteral("Test Client")); serverSocket->setPeerVerifyMode(QSslSocket::QueryPeer); - mClientSocket->setPeerVerifyName(QStringLiteral("Test Server")); - mClientSocket->setPeerVerifyMode(QSslSocket::QueryPeer); + m_clientSocket->setPeerVerifyName(QStringLiteral("Test Server")); + m_clientSocket->setPeerVerifyMode(QSslSocket::QueryPeer); - connect(mClientSocket, &QSslSocket::encrypted, &mLoop, &QEventLoop::quit); + connect(m_clientSocket, &QSslSocket::encrypted, &m_loop, &QEventLoop::quit); serverSocket->startServerEncryption(); - mClientSocket->startClientEncryption(); - mLoop.exec(); + m_clientSocket->startClientEncryption(); + m_loop.exec(); - QVERIFY2(mClientSocket->isOpen(), "Client socket already closed"); + QVERIFY2(m_clientSocket->isOpen(), "Client socket already closed"); QVERIFY2(serverSocket->isOpen(), "Server socket already closed"); - QVERIFY2(mClientSocket->isEncrypted(), "Client is not encrypted"); + QVERIFY2(m_clientSocket->isEncrypted(), "Client is not encrypted"); QVERIFY2(serverSocket->isEncrypted(), "Server is not encrypted"); - QVERIFY2(!mClientSocket->peerCertificate().isNull(), "Server certificate not received"); + QVERIFY2(!m_clientSocket->peerCertificate().isNull(), "Server certificate not received"); QVERIFY2(!serverSocket->peerCertificate().isNull(), "Client certificate not received"); QList dataToSend; dataToSend << "foobar\n" << "barfoo\n" << "foobar?\n" << "\n" << "barfoo!\n" << "panda\n"; - for (const QByteArray &line : dataToSend) { - mClientSocket->write(line); + for (const QByteArray& line : dataToSend) { + m_clientSocket->write(line); } - mClientSocket->flush(); + m_clientSocket->flush(); - mPackages.clear(); + m_packages.clear(); - mReader = new SocketLineReader(serverSocket, this); - connect(mReader, &SocketLineReader::readyRead, this, &TestSslSocketLineReader::newPackage); - mLoop.exec(); + m_reader = new SocketLineReader(serverSocket, this); + connect(m_reader, &SocketLineReader::readyRead, this, &TestSslSocketLineReader::newPackage); + m_loop.exec(); /* remove the empty line before compare */ dataToSend.removeOne("\n"); - QCOMPARE(mPackages.count(), 5);//We expect 5 Packages + QCOMPARE(m_packages.count(), 5);//We expect 5 Packages for(int x = 0;x < 5; ++x) { - QCOMPARE(mPackages[x], dataToSend[x]); + QCOMPARE(m_packages[x], dataToSend[x]); } - delete mReader; + delete m_reader; } void TestSslSocketLineReader::testTrustedDeviceWithWrongCertificate() { int maxAttemps = 5; - while(!mServer->hasPendingConnections() && maxAttemps > 0) { + while(!m_server->hasPendingConnections() && maxAttemps > 0) { --maxAttemps; QTest::qSleep(1000); } - QSslSocket *serverSocket = mServer->nextPendingConnection(); + QSslSocket* serverSocket = m_server->nextPendingConnection(); QVERIFY2(serverSocket != 0, "Could not open a connection to the client"); setSocketAttributes(serverSocket, QStringLiteral("Test Server")); - setSocketAttributes(mClientSocket, QStringLiteral("Test Client")); + setSocketAttributes(m_clientSocket, QStringLiteral("Test Client")); // Not adding other device certificate to list of CA certificate, and using VerifyPeer. This should lead to handshake failure serverSocket->setPeerVerifyName(QStringLiteral("Test Client")); serverSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); - mClientSocket->setPeerVerifyName(QStringLiteral("Test Server")); - mClientSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); + m_clientSocket->setPeerVerifyName(QStringLiteral("Test Server")); + m_clientSocket->setPeerVerifyMode(QSslSocket::VerifyPeer); - connect(serverSocket, &QSslSocket::encrypted, &mLoop, &QEventLoop::quit); // Encrypted signal should never be emitted - connect(mClientSocket, &QSslSocket::encrypted, &mLoop, &QEventLoop::quit); // Encrypted signal should never be emitted - connect(serverSocket, &QAbstractSocket::disconnected, &mLoop, &QEventLoop::quit); - connect(mClientSocket, &QAbstractSocket::disconnected, &mLoop, &QEventLoop::quit); + connect(serverSocket, &QSslSocket::encrypted, &m_loop, &QEventLoop::quit); // Encrypted signal should never be emitted + connect(m_clientSocket, &QSslSocket::encrypted, &m_loop, &QEventLoop::quit); // Encrypted signal should never be emitted + connect(serverSocket, &QAbstractSocket::disconnected, &m_loop, &QEventLoop::quit); + connect(m_clientSocket, &QAbstractSocket::disconnected, &m_loop, &QEventLoop::quit); serverSocket->startServerEncryption(); - mClientSocket->startClientEncryption(); - mLoop.exec(); + m_clientSocket->startClientEncryption(); + m_loop.exec(); QVERIFY2(!serverSocket->isEncrypted(), "Server is encrypted, it should not"); - QVERIFY2(!mClientSocket->isEncrypted(), "lient is encrypted, it should now"); + QVERIFY2(!m_clientSocket->isEncrypted(), "lient is encrypted, it should now"); - if (serverSocket->state() != QAbstractSocket::UnconnectedState) mLoop.exec(); // Wait until serverSocket is disconnected, It should be in disconnected state - if (mClientSocket->state() != QAbstractSocket::UnconnectedState) mLoop.exec(); // Wait until mClientSocket is disconnected, It should be in disconnected state + if (serverSocket->state() != QAbstractSocket::UnconnectedState) m_loop.exec(); // Wait until serverSocket is disconnected, It should be in disconnected state + if (m_clientSocket->state() != QAbstractSocket::UnconnectedState) m_loop.exec(); // Wait until mClientSocket is disconnected, It should be in disconnected state - QCOMPARE((int)mClientSocket->state(), 0); + QCOMPARE((int)m_clientSocket->state(), 0); QCOMPARE((int)serverSocket->state(), 0); } void TestSslSocketLineReader::newPackage() { - if (!mReader->bytesAvailable()) { + if (!m_reader->bytesAvailable()) { return; } int maxLoops = 5; - while(mReader->bytesAvailable() > 0 && maxLoops > 0) { + while(m_reader->bytesAvailable() > 0 && maxLoops > 0) { --maxLoops; - const QByteArray package = mReader->readLine(); + const QByteArray package = m_reader->readLine(); if (!package.isEmpty()) { - mPackages.append(package); + m_packages.append(package); } - if (mPackages.count() == 5) { - mLoop.exit(); + if (m_packages.count() == 5) { + m_loop.exit(); } } } -void TestSslSocketLineReader::setSocketAttributes(QSslSocket *socket, QString deviceName) { +void TestSslSocketLineReader::setSocketAttributes(QSslSocket* socket, QString deviceName) { QDateTime startTime = QDateTime::currentDateTime(); QDateTime endTime = startTime.addYears(10); diff --git a/urlhandler/org.kde.kdeconnect.telhandler.desktop b/urlhandler/org.kde.kdeconnect.telhandler.desktop --- a/urlhandler/org.kde.kdeconnect.telhandler.desktop +++ b/urlhandler/org.kde.kdeconnect.telhandler.desktop @@ -5,7 +5,6 @@ Name[cs]=Nástroj pro práci s URL telefonu v KDE Connect Name[da]=Telefon-URL-håndtering til KDE Connect Name[es]=Controlador de URL de teléfonos de KDE Connect -Name[eu]=KDE Connect-en URL-kudeatzailea Name[fr]=Gestionnaire d'URL téléphoniques de KDE Connect Name[gl]=Manexador de URL de teléfono de KDE Connect Name[it]=Gestore URL del telefono di KDE Connect