Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit d10761f

Browse files
committed
various code cleanups
1 parent 3f12f7d commit d10761f

25 files changed

+56
-56
lines changed

src/datasync/accountmanager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ LoginRequest::LoginRequest(LoginRequestPrivate *d_ptr) :
293293

294294
LoginRequest::LoginRequest(const LoginRequest &other) = default;
295295

296-
LoginRequest::LoginRequest(LoginRequest &&other) = default;
296+
LoginRequest::LoginRequest(LoginRequest &&other) noexcept = default;
297297

298298
LoginRequest::~LoginRequest() = default;
299299

300300
LoginRequest &LoginRequest::operator=(const LoginRequest &other) = default;
301301

302-
LoginRequest &LoginRequest::operator=(LoginRequest &&other) = default;
302+
LoginRequest &LoginRequest::operator=(LoginRequest &&other) noexcept = default;
303303

304304
DeviceInfo LoginRequest::device() const
305305
{
@@ -354,13 +354,13 @@ DeviceInfo::DeviceInfo(const QUuid &deviceId, const QString &name, const QByteAr
354354

355355
DeviceInfo::DeviceInfo(const DeviceInfo &other) = default;
356356

357-
DeviceInfo::DeviceInfo(DeviceInfo &&other) = default;
357+
DeviceInfo::DeviceInfo(DeviceInfo &&other) noexcept = default;
358358

359359
DeviceInfo::~DeviceInfo() = default;
360360

361361
DeviceInfo &DeviceInfo::operator=(const DeviceInfo &other) = default;
362362

363-
DeviceInfo &DeviceInfo::operator=(DeviceInfo &&other) = default;
363+
DeviceInfo &DeviceInfo::operator=(DeviceInfo &&other) noexcept = default;
364364

365365
QUuid DeviceInfo::deviceId() const
366366
{
@@ -412,7 +412,7 @@ bool DeviceInfo::operator!=(const DeviceInfo &other) const
412412

413413
DeviceInfoPrivate::DeviceInfoPrivate(QUuid deviceId, QString name, QByteArray fingerprint) :
414414
QSharedData{},
415-
deviceId{std::move(deviceId)},
415+
deviceId{deviceId},
416416
name{std::move(name)},
417417
fingerprint{std::move(fingerprint)}
418418
{}

src/datasync/accountmanager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class Q_DATASYNC_EXPORT DeviceInfo
4040
//! Copy constructor
4141
DeviceInfo(const DeviceInfo &other);
4242
//! Move constructor
43-
DeviceInfo(DeviceInfo &&other);
43+
DeviceInfo(DeviceInfo &&other) noexcept;
4444
~DeviceInfo();
4545

4646
//! Copy-Assignment operator
4747
DeviceInfo &operator=(const DeviceInfo &other);
4848
//! Move-Assignment operator
49-
DeviceInfo &operator=(DeviceInfo &&other);
49+
DeviceInfo &operator=(DeviceInfo &&other) noexcept;
5050

5151
//! @readAcFn{DeviceInfo::deviceId}
5252
QUuid deviceId() const;
@@ -92,13 +92,13 @@ class Q_DATASYNC_EXPORT LoginRequest
9292
//! Copy constructor
9393
LoginRequest(const LoginRequest &other);
9494
//! Move constructor
95-
LoginRequest(LoginRequest &&other);
95+
LoginRequest(LoginRequest &&other) noexcept;
9696
~LoginRequest();
9797

9898
//! Copy-Assignment operator
9999
LoginRequest &operator=(const LoginRequest &other);
100100
//! Move-Assignment operator
101-
LoginRequest &operator=(LoginRequest &&other);
101+
LoginRequest &operator=(LoginRequest &&other) noexcept;
102102

103103
//! @readAcFn{LoginRequest::device}
104104
DeviceInfo device() const;

src/datasync/changecontroller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ ChangeController::CachedObjectKey::CachedObjectKey() = default;
222222

223223
ChangeController::CachedObjectKey::CachedObjectKey(ObjectKey other, QUuid deviceId) :
224224
ObjectKey{std::move(other)},
225-
optionalDevice{std::move(deviceId)}
225+
optionalDevice{deviceId}
226226
{}
227227

228228
ChangeController::CachedObjectKey::CachedObjectKey(QByteArray hash, QUuid deviceId) :
229229
ObjectKey{},
230-
optionalDevice{std::move(deviceId)},
230+
optionalDevice{deviceId},
231231
_hash{std::move(hash)}
232232
{}
233233

src/datasync/cryptocontroller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ QStringList CryptoController::allKeystoreKeys()
125125
QStringList CryptoController::availableKeystoreKeys()
126126
{
127127
QStringList keys;
128-
for(const auto &key : factory->allKeys()) {
128+
for(const auto &key : factory->allKeys()) { // clazy:exclude=range-loop
129129
if(factory->isAvailable(key))
130130
keys.append(key);
131131
}

src/datasync/datastore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ QVariantList DataStore::search(int metaTypeId, const QString &query, SearchMode
146146

147147
void DataStore::iterate(int metaTypeId, const function<bool (QVariant)> &iterator) const
148148
{
149-
for(const auto &key : keys(metaTypeId)) {
149+
for(const auto &key : keys(metaTypeId)) { // clazy:exclude=range-loop
150150
if(!iterator(load(metaTypeId, key)))
151151
break;
152152
}

src/datasync/defaults.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Defaults::Defaults(const QSharedPointer<DefaultsPrivate> &d) : //MAJOR pass by m
2929

3030
Defaults &Defaults::operator=(const Defaults &other) = default;
3131

32-
Defaults &Defaults::operator=(Defaults &&other) = default;
32+
Defaults &Defaults::operator=(Defaults &&other) noexcept = default;
3333

3434
Defaults::Defaults(const Defaults &other) = default;
3535

36-
Defaults::Defaults(Defaults &&other) = default;
36+
Defaults::Defaults(Defaults &&other) noexcept = default;
3737

3838
Defaults::~Defaults() = default;
3939

@@ -151,13 +151,13 @@ DatabaseRef::DatabaseRef(DatabaseRefPrivate *d) :
151151
d{d}
152152
{}
153153

154-
DatabaseRef::DatabaseRef(DatabaseRef &&other) :
154+
DatabaseRef::DatabaseRef(DatabaseRef &&other) noexcept :
155155
d{nullptr}
156156
{
157157
d.swap(other.d);
158158
}
159159

160-
DatabaseRef &DatabaseRef::operator=(DatabaseRef &&other)
160+
DatabaseRef &DatabaseRef::operator=(DatabaseRef &&other) noexcept
161161
{
162162
d.reset();
163163
d.swap(other.d);

src/datasync/defaults.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class Q_DATASYNC_EXPORT DatabaseRef
3636
//! @private
3737
DatabaseRef(DatabaseRefPrivate *d);
3838
//! Move constructor
39-
DatabaseRef(DatabaseRef &&other);
39+
DatabaseRef(DatabaseRef &&other) noexcept;
4040
//! Move assignment operator
41-
DatabaseRef &operator=(DatabaseRef &&other);
41+
DatabaseRef &operator=(DatabaseRef &&other) noexcept;
4242

4343
//! Returns true if this reference points to a valid database
4444
bool isValid() const;
@@ -85,11 +85,11 @@ class Q_DATASYNC_EXPORT Defaults
8585
//! Copy constructor
8686
Defaults(const Defaults &other);
8787
//! Move constructor
88-
Defaults(Defaults &&other);
88+
Defaults(Defaults &&other) noexcept;
8989
//! Copy assignment operator
9090
Defaults &operator=(const Defaults &other);
9191
//! Move assignment operator
92-
Defaults &operator=(Defaults &&other);
92+
Defaults &operator=(Defaults &&other) noexcept;
9393
~Defaults();
9494

9595
//! Create a new logger instance

src/datasync/localstore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ LocalStore::SyncScope::SyncScope(const Defaults &defaults, const ObjectKey &key,
836836
}
837837
}
838838

839-
LocalStore::SyncScope::SyncScope(LocalStore::SyncScope &&other) :
839+
LocalStore::SyncScope::SyncScope(LocalStore::SyncScope &&other) noexcept :
840840
d()
841841
{
842842
d.swap(other.d);

src/datasync/localstore_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Q_DATASYNC_EXPORT LocalStore : public QObject
3737
Q_DISABLE_COPY(SyncScope)
3838

3939
public:
40-
SyncScope(SyncScope &&other);
40+
SyncScope(SyncScope &&other) noexcept;
4141
~SyncScope();
4242

4343
private:

src/datasync/migrationhelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void MigrationRunnable::run()
176176
//special: copy headers
177177
oldSettings->beginGroup(QStringLiteral("RemoteConnector/headers"));
178178
currentSettings->beginGroup(QStringLiteral("connector/") + RemoteConnector::keyRemoteHeaders);
179-
for(const auto &key : oldSettings->childKeys()) {
179+
for(const auto &key : oldSettings->childKeys()) { // clazy:exclude=range-loop
180180
copyConf(oldSettings, key,
181181
currentSettings, key);
182182
}

0 commit comments

Comments
 (0)