Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@nextcloud.com>2020-12-10 21:52:58 +0300
committerKevin Ottens <kevin.ottens@nextcloud.com>2020-12-15 13:01:53 +0300
commitc57eff6fd80b1685237f1e782ed1c640c2350a9f (patch)
tree1845a1e5ca665b09add42fab6151030fad960600 /src/common
parentc03a5da6709a57c0456ca9d83158fe839ab7a3c1 (diff)
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/checksums.cpp6
-rw-r--r--src/common/filesystembase.cpp6
-rw-r--r--src/common/remotepermissions.cpp2
-rw-r--r--src/common/syncjournaldb.cpp2
-rw-r--r--src/common/vfs.h6
5 files changed, 10 insertions, 12 deletions
diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp
index f75e84f28..c604842a3 100644
--- a/src/common/checksums.cpp
+++ b/src/common/checksums.cpp
@@ -121,7 +121,7 @@ QByteArray calcAdler32(QIODevice *device)
QByteArray buf(BUFSIZE, Qt::Uninitialized);
unsigned int adler = adler32(0L, Z_NULL, 0);
- qint64 size;
+ qint64 size = 0;
while (!device->atEnd()) {
size = device->read(buf.data(), BUFSIZE);
if (size > 0)
@@ -204,9 +204,7 @@ ComputeChecksum::ComputeChecksum(QObject *parent)
{
}
-ComputeChecksum::~ComputeChecksum()
-{
-}
+ComputeChecksum::~ComputeChecksum() = default;
void ComputeChecksum::setChecksumType(const QByteArray &type)
{
diff --git a/src/common/filesystembase.cpp b/src/common/filesystembase.cpp
index f41b3a617..6b2271777 100644
--- a/src/common/filesystembase.cpp
+++ b/src/common/filesystembase.cpp
@@ -518,9 +518,9 @@ QString FileSystem::pathtoUNC(const QString &str)
/* replace all occurences of / with the windows native \ */
- for (auto it = longStr.begin(); it != longStr.end(); ++it) {
- if (*it == QLatin1Char('/')) {
- *it = QLatin1Char('\\');
+ for (auto &c : longStr) {
+ if (c == QLatin1Char('/')) {
+ c = QLatin1Char('\\');
}
}
return longStr;
diff --git a/src/common/remotepermissions.cpp b/src/common/remotepermissions.cpp
index f714277ed..00827f8f1 100644
--- a/src/common/remotepermissions.cpp
+++ b/src/common/remotepermissions.cpp
@@ -62,7 +62,7 @@ QString RemotePermissions::toString() const
RemotePermissions RemotePermissions::fromDbValue(const QByteArray &value)
{
if (value.isEmpty())
- return RemotePermissions();
+ return {};
RemotePermissions perm;
perm.fromArray(value.constData());
return perm;
diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp
index 79fb9c561..8e2a6d81a 100644
--- a/src/common/syncjournaldb.cpp
+++ b/src/common/syncjournaldb.cpp
@@ -706,7 +706,7 @@ bool SyncJournalDb::updateMetadataTableStructure()
commitInternal(QStringLiteral("update database structure: add path index"));
}
- if (1) {
+ if (true) {
SqlQuery query(_db);
query.prepare("CREATE INDEX IF NOT EXISTS metadata_parent ON metadata(parent_hash(path));");
if (!query.exec()) {
diff --git a/src/common/vfs.h b/src/common/vfs.h
index 66fae7e4b..f4ea3d8fa 100644
--- a/src/common/vfs.h
+++ b/src/common/vfs.h
@@ -25,12 +25,12 @@
#include "syncfilestatus.h"
#include "pinstate.h"
-typedef struct csync_file_stat_s csync_file_stat_t;
+using csync_file_stat_t = struct csync_file_stat_s;
namespace OCC {
class Account;
-typedef QSharedPointer<Account> AccountPtr;
+using AccountPtr = QSharedPointer<Account>;
class SyncJournalDb;
class VfsPrivate;
class SyncFileItem;
@@ -329,7 +329,7 @@ OCSYNC_EXPORT std::unique_ptr<Vfs> createVfsFromPlugin(Vfs::Mode mode);
namespace { \
void initPlugin() \
{ \
- OCC::Vfs::registerPlugin(QStringLiteral(name), []() -> OCC::Vfs * { return new Type; }); \
+ OCC::Vfs::registerPlugin(QStringLiteral(name), []() -> OCC::Vfs * { return new (Type); }); \
} \
Q_COREAPP_STARTUP_FUNCTION(initPlugin) \
}