Fix various krazy2 warnings

Fix following krazy2 warning types:
[explicit], [endswithnewline], [doublequote_chars], [includes], [normalize],
[postfixop], [spelling]

See http://ebn.kde.org/krazy/reports/playground/base/kdeconnect-kde/index.html
for details.

SLOT/SIGNAL normalization done with Qt normalize utility:
https://github.com/qtproject/qtrepotools/tree/master/util/normalize

REVIEW: 124857
This commit is contained in:
Boris Egorov 2015-08-21 22:38:54 +06:00
parent ce354aae44
commit 1924173df2
31 changed files with 67 additions and 69 deletions

View file

@ -223,7 +223,7 @@ void LanLinkProvider::newConnection()
configureSocket(socket); configureSocket(socket);
//This socket is still managed by us (and child of the QTcpServer), if //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 //it disconnects before we manage to pass it to a LanDeviceLink, it's
//our responsability to delete it. We do so with this connection. //our responsibility to delete it. We do so with this connection.
connect(socket, SIGNAL(disconnected()), connect(socket, SIGNAL(disconnected()),
socket, SLOT(deleteLater())); socket, SLOT(deleteLater()));
connect(socket, SIGNAL(readyRead()), connect(socket, SIGNAL(readyRead()),

View file

@ -37,7 +37,7 @@ class SocketLineReader
Q_OBJECT Q_OBJECT
public: public:
SocketLineReader(QTcpSocket* socket, QObject* parent = 0); explicit SocketLineReader(QTcpSocket* socket, QObject* parent = 0);
QByteArray readLine() { return mPackages.dequeue(); } QByteArray readLine() { return mPackages.dequeue(); }
qint64 write(const QByteArray& data) { return mSocket->write(data); } qint64 write(const QByteArray& data) { return mSocket->write(data); }

View file

@ -18,10 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "uploadjob.h"
#include <qalgorithms.h> #include <qalgorithms.h>
#include <QtGlobal> #include <QtGlobal>
#include "uploadjob.h"
#include "core_debug.h" #include "core_debug.h"
UploadJob::UploadJob(const QSharedPointer<QIODevice>& source): KJob() UploadJob::UploadJob(const QSharedPointer<QIODevice>& source): KJob()

View file

@ -34,7 +34,7 @@ class UploadJob
{ {
Q_OBJECT Q_OBJECT
public: public:
UploadJob(const QSharedPointer<QIODevice>& source); explicit UploadJob(const QSharedPointer<QIODevice>& source);
virtual void start(); virtual void start();
QVariantMap getTransferInfo(); QVariantMap getTransferInfo();

View file

@ -31,7 +31,6 @@
#include "backends/lan/lanlinkprovider.h" #include "backends/lan/lanlinkprovider.h"
#include "backends/loopback/loopbacklinkprovider.h" #include "backends/loopback/loopbacklinkprovider.h"
#include "device.h" #include "device.h"
#include "networkpackage.h"
#include "backends/devicelink.h" #include "backends/devicelink.h"
#include "backends/linkprovider.h" #include "backends/linkprovider.h"

View file

@ -39,7 +39,7 @@ class KDECONNECTCORE_EXPORT Daemon
Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.daemon") Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.daemon")
public: public:
Daemon(QObject *parent); explicit Daemon(QObject *parent);
~Daemon(); ~Daemon();
public Q_SLOTS: public Q_SLOTS:

View file

@ -140,7 +140,7 @@ void Device::reloadPlugins()
//If we don't find intersection with the received on one end and the sent on the other, we don't //If we don't find intersection with the received on one end and the sent on the other, we don't
//let the plugin stay //let the plugin stay
//Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as //Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as
//we asume that the other client doesn't know about capabilities. //we assume that the other client doesn't know about capabilities.
if (!m_incomingCapabilities.isEmpty() && !m_outgoingCapabilities.isEmpty() if (!m_incomingCapabilities.isEmpty() && !m_outgoingCapabilities.isEmpty()
&& (m_incomingCapabilities & outgoingInterfaces.toSet()).isEmpty() && (m_incomingCapabilities & outgoingInterfaces.toSet()).isEmpty()
&& (m_outgoingCapabilities & incomingInterfaces.toSet()).isEmpty() && (m_outgoingCapabilities & incomingInterfaces.toSet()).isEmpty()
@ -512,7 +512,7 @@ QString Device::iconForStatus(bool reachable, bool paired) const
QString status = (reachable? (paired? QStringLiteral("connected") : QStringLiteral("disconnected")) : QStringLiteral("trusted")); QString status = (reachable? (paired? QStringLiteral("connected") : QStringLiteral("disconnected")) : QStringLiteral("trusted"));
QString type = type2str(deviceType); QString type = type2str(deviceType);
return type+"-"+status; return type+'-'+status;
} }
void Device::setName(const QString &name) void Device::setName(const QString &name)

View file

@ -27,7 +27,6 @@
#include <QDebug> #include <QDebug>
#include <QFileInfo> #include <QFileInfo>
#include <QUuid> #include <QUuid>
#include <QDebug>
#include <QDir> #include <QDir>
#include <QStandardPaths> #include <QStandardPaths>
#include <QCoreApplication> #include <QCoreApplication>
@ -114,7 +113,7 @@ KdeConnectConfig::KdeConnectConfig()
QString KdeConnectConfig::name() QString KdeConnectConfig::name()
{ {
QString defaultName = qgetenv("USER") + "@" + QHostInfo::localHostName(); QString defaultName = qgetenv("USER") + '@' + QHostInfo::localHostName();
d->config->beginGroup("myself"); d->config->beginGroup("myself");
QString name = d->config->value("name", defaultName).toString(); QString name = d->config->value("name", defaultName).toString();
d->config->endGroup(); d->config->endGroup();

View file

@ -52,7 +52,7 @@ public:
const static QCA::EncryptionAlgorithm EncryptionAlgorithm; const static QCA::EncryptionAlgorithm EncryptionAlgorithm;
const static int ProtocolVersion; const static int ProtocolVersion;
NetworkPackage(const QString& type); explicit NetworkPackage(const QString& type);
static void createIdentityPackage(NetworkPackage*); static void createIdentityPackage(NetworkPackage*);

View file

@ -42,7 +42,7 @@ class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
DaemonDbusInterface(QObject* parent = 0); explicit DaemonDbusInterface(QObject* parent = 0);
virtual ~DaemonDbusInterface(); virtual ~DaemonDbusInterface();
static QString activatedService(); static QString activatedService();
@ -57,7 +57,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface
Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy) Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy)
public: public:
DeviceDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~DeviceDbusInterface(); virtual ~DeviceDbusInterface();
Q_SCRIPTABLE QString id() const; Q_SCRIPTABLE QString id() const;
@ -75,7 +75,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~DeviceBatteryDbusInterface(); virtual ~DeviceBatteryDbusInterface();
}; };
@ -84,7 +84,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~DeviceNotificationsDbusInterface(); virtual ~DeviceNotificationsDbusInterface();
}; };
@ -102,7 +102,7 @@ class KDECONNECTINTERFACES_EXPORT SftpDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
SftpDbusInterface(const QString& deviceId, QObject* parent = 0); explicit SftpDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~SftpDbusInterface(); virtual ~SftpDbusInterface();
}; };
@ -119,7 +119,7 @@ class KDECONNECTINTERFACES_EXPORT MprisDbusInterface
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy) Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy)
Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy) Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy)
public: public:
MprisDbusInterface(const QString& deviceId, QObject* parent = 0); explicit MprisDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~MprisDbusInterface(); virtual ~MprisDbusInterface();
Q_SIGNALS: Q_SIGNALS:
@ -131,7 +131,7 @@ class KDECONNECTINTERFACES_EXPORT RemoteControlDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
RemoteControlDbusInterface(const QString& deviceId, QObject* parent = 0); explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = 0);
~RemoteControlDbusInterface() override; ~RemoteControlDbusInterface() override;
}; };
@ -141,7 +141,7 @@ class KDECONNECTINTERFACES_EXPORT LockDeviceDbusInterface
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy) Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy)
public: public:
LockDeviceDbusInterface(const QString& deviceId, QObject* parent = 0); explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~LockDeviceDbusInterface(); virtual ~LockDeviceDbusInterface();
Q_SIGNALS: Q_SIGNALS:

View file

@ -57,7 +57,7 @@ public:
Q_FLAGS(StatusFilterFlags) Q_FLAGS(StatusFilterFlags)
Q_ENUMS(StatusFilterFlag) Q_ENUMS(StatusFilterFlag)
DevicesModel(QObject *parent = 0); explicit DevicesModel(QObject *parent = 0);
virtual ~DevicesModel(); virtual ~DevicesModel();
void setDisplayFilter(int flags); void setDisplayFilter(int flags);

View file

@ -30,7 +30,7 @@ class KDECONNECTINTERFACES_EXPORT DevicesSortProxyModel : public QSortFilterProx
{ {
Q_OBJECT Q_OBJECT
public: public:
DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR);
virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const; virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
virtual void setSourceModel(QAbstractItemModel *sourceModel); virtual void setSourceModel(QAbstractItemModel *sourceModel);

View file

@ -21,10 +21,10 @@
** **
****************************************************************************/ ****************************************************************************/
#include <QtGui/QtGui>
#include "modeltest.h" #include "modeltest.h"
#include <QtGui/QtGui>
Q_DECLARE_METATYPE(QModelIndex) Q_DECLARE_METATYPE(QModelIndex)
/*! /*!
@ -34,28 +34,28 @@ ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(pare
{ {
Q_ASSERT(model); Q_ASSERT(model);
connect(model, SIGNAL(columnsAboutToBeInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsAboutToBeRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(columnsRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests())); connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()));
connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests())); connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()));
connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests())); connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(runAllTests())); this, SLOT(runAllTests()));
// Special checks for inserting/removing // Special checks for inserting/removing
@ -64,14 +64,14 @@ ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(pare
connect(model, SIGNAL(layoutChanged()), connect(model, SIGNAL(layoutChanged()),
this, SLOT(layoutChanged())); this, SLOT(layoutChanged()));
connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
this, SLOT(rowsAboutToBeInserted(const QModelIndex &, int, int))); this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int))); this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(const QModelIndex &, int, int))); this, SLOT(rowsInserted(QModelIndex,int,int)));
connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(rowsRemoved(const QModelIndex &, int, int))); this, SLOT(rowsRemoved(QModelIndex,int,int)));
runAllTests(); runAllTests();
} }

View file

@ -33,7 +33,7 @@ class ModelTest : public QObject
Q_OBJECT Q_OBJECT
public: public:
ModelTest(QAbstractItemModel *model, QObject *parent = 0); explicit ModelTest(QAbstractItemModel *model, QObject *parent = 0);
private Q_SLOTS: private Q_SLOTS:
void nonDestructiveBasicTest(); void nonDestructiveBasicTest();

View file

@ -47,7 +47,7 @@ public:
DbusInterfaceRole, DbusInterfaceRole,
}; };
NotificationsModel(QObject* parent = 0); explicit NotificationsModel(QObject* parent = 0);
virtual ~NotificationsModel(); virtual ~NotificationsModel();
QString deviceId() const; QString deviceId() const;

View file

@ -143,7 +143,7 @@ void KioKdeconnect::listDevice()
QVariantMap urls = urlreply.value(); QVariantMap urls = urlreply.value();
for (QVariantMap::iterator it = urls.begin(); it != urls.end(); it++) { for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) {
QString path = it.key(); QString path = it.key();
QString name = it.value().toString(); QString name = it.value().toString();
@ -170,7 +170,7 @@ void KioKdeconnect::listDir(const QUrl &url)
{ {
qCDebug(KDECONNECT_KIO) << "Listing..." << url; qCDebug(KDECONNECT_KIO) << "Listing..." << url;
/// Url is not used here becuase all we could care about the url is the host, and that's already /// Url is not used here because all we could care about the url is the host, and that's already
/// handled in @p setHost /// handled in @p setHost
Q_UNUSED(url); Q_UNUSED(url);

View file

@ -27,7 +27,7 @@ class ProcessRunner : public QObject
Q_OBJECT Q_OBJECT
public: public:
ProcessRunner(QObject *parent = 0); explicit ProcessRunner(QObject *parent = 0);
~ProcessRunner(); ~ProcessRunner();
Q_INVOKABLE void runKdeconnectKCM(); Q_INVOKABLE void runKdeconnectKCM();

View file

@ -1,11 +1,10 @@
#include "responsewaiter.h"
#include <QDBusPendingCall> #include <QDBusPendingCall>
#include <QDBusPendingReply> #include <QDBusPendingReply>
#include <QDebug> #include <QDebug>
#include <QCoreApplication> #include <QCoreApplication>
#include "responsewaiter.h"
Q_DECLARE_METATYPE(QDBusPendingReply<>) Q_DECLARE_METATYPE(QDBusPendingReply<>)
Q_DECLARE_METATYPE(QDBusPendingReply<QVariant>) Q_DECLARE_METATYPE(QDBusPendingReply<QVariant>)
Q_DECLARE_METATYPE(QDBusPendingReply<bool>) Q_DECLARE_METATYPE(QDBusPendingReply<bool>)

View file

@ -36,7 +36,7 @@ class DBusAsyncResponse : public QObject
Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete) Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete)
public: public:
DBusAsyncResponse(QObject* parent = 0); explicit DBusAsyncResponse(QObject* parent = 0);
virtual ~DBusAsyncResponse() {}; virtual ~DBusAsyncResponse() {};
Q_INVOKABLE void setPendingCall(QVariant e); Q_INVOKABLE void setPendingCall(QVariant e);

View file

@ -107,7 +107,7 @@ void Mounter::onPakcageReceived(const NetworkPackage& np)
const QString program = "sshfs"; const QString program = "sshfs";
QString path; QString path;
if (np.has("multiPaths")) path = "/"; if (np.has("multiPaths")) path = '/';
else path = np.get<QString>("path"); else path = np.get<QString>("path");
const QStringList arguments = QStringList() const QStringList arguments = QStringList()

View file

@ -28,7 +28,7 @@ class AutoClosingQFile : public QFile
Q_OBJECT Q_OBJECT
public: public:
AutoClosingQFile(const QString &name); explicit AutoClosingQFile(const QString &name);
qint64 readData(char* data, qint64 maxlen) Q_DECL_OVERRIDE { qint64 readData(char* data, qint64 maxlen) Q_DECL_OVERRIDE {
qint64 read = QFile::readData(data, maxlen); qint64 read = QFile::readData(data, maxlen);
if (read == -1 || read == bytesAvailable()) { if (read == -1 || read == bytesAvailable()) {