From 9b5bb1365cc05cd3293ce97fc235dd72e650663f Mon Sep 17 00:00:00 2001 From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Sat, 18 Jan 2020 10:30:34 +0100 Subject: [PATCH] Code maintenance - correct some syntax, fix some warnings. Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- src/gui/folder.cpp | 2 ++ src/gui/tray/ActivityListModel.h | 2 +- src/gui/tray/UserModel.cpp | 3 +++ src/libsync/owncloudpropagator.cpp | 4 ++-- src/libsync/syncengine.cpp | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 0e906a420..f9cb8cfe0 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -914,6 +914,8 @@ void Folder::slotItemCompleted(const SyncFileItemPtr &item) _folderWatcher->removePath(path() + item->_file); _folderWatcher->addPath(path() + item->destination()); break; + default: + break; } } diff --git a/src/gui/tray/ActivityListModel.h b/src/gui/tray/ActivityListModel.h index 1c8ae6ee2..37a766907 100644 --- a/src/gui/tray/ActivityListModel.h +++ b/src/gui/tray/ActivityListModel.h @@ -85,7 +85,7 @@ signals: void activityJobStatusCode(int statusCode); protected: - QHash roleNames() const; + QHash roleNames() const override; private: void startFetchJob(); diff --git a/src/gui/tray/UserModel.cpp b/src/gui/tray/UserModel.cpp index 9a6c9e312..2c66894e6 100644 --- a/src/gui/tray/UserModel.cpp +++ b/src/gui/tray/UserModel.cpp @@ -780,6 +780,9 @@ ImageProvider::ImageProvider() QImage ImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) { + Q_UNUSED(size) + Q_UNUSED(requestedSize) + if (id == "currentUser") { return UserModel::instance()->currentUserAvatar(); } else { diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index c728172e6..03d1dbf72 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -376,14 +376,14 @@ void OwncloudPropagator::start(const SyncFileItemVector &items, Q_ASSERT(std::is_sorted(items.begin(), items.end())); } else if (hasChange) { Q_ASSERT(std::is_sorted(items.begin(), items.end(), - [](const SyncFileItemVector::const_reference &a, const SyncFileItemVector::const_reference &b) -> bool { + [](SyncFileItemVector::const_reference &a, SyncFileItemVector::const_reference &b) -> bool { return ((a->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE) && (b->_instruction != CSYNC_INSTRUCTION_TYPE_CHANGE)); })); Q_ASSERT(std::is_sorted(items.begin(), items.begin() + lastChangeInstruction)); if (hasDelete) { Q_ASSERT(std::is_sorted(items.begin() + (lastChangeInstruction + 1), items.end(), - [](const SyncFileItemVector::const_reference &a, const SyncFileItemVector::const_reference &b) -> bool { + [](SyncFileItemVector::const_reference &a, SyncFileItemVector::const_reference &b) -> bool { return ((a->_instruction == CSYNC_INSTRUCTION_REMOVE) && (b->_instruction != CSYNC_INSTRUCTION_REMOVE)); })); Q_ASSERT(std::is_sorted(items.begin() + (lastChangeInstruction + 1), items.begin() + lastDeleteInstruction)); diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 24732d975..42e45b5c8 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -1078,7 +1078,7 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult) // Get CHANGE instructions to the top first if (syncItems.count() > 0) { std::sort(syncItems.begin(), syncItems.end(), - [](const SyncFileItemVector::const_reference &a, const SyncFileItemVector::const_reference &b) -> bool { + [](SyncFileItemVector::const_reference &a, SyncFileItemVector::const_reference &b) -> bool { return ((a->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE) && (b->_instruction != CSYNC_INSTRUCTION_TYPE_CHANGE)); }); if (syncItems.at(0)->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE) { @@ -1089,7 +1089,7 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult) std::sort(syncItems.begin(), syncItems.begin() + lastChangeInstruction); if (syncItems.count() > lastChangeInstruction) { std::sort(syncItems.begin() + (lastChangeInstruction + 1), syncItems.end(), - [](const SyncFileItemVector::const_reference &a, const SyncFileItemVector::const_reference &b) -> bool { + [](SyncFileItemVector::const_reference &a, SyncFileItemVector::const_reference &b) -> bool { return ((a->_instruction == CSYNC_INSTRUCTION_REMOVE) && (b->_instruction != CSYNC_INSTRUCTION_REMOVE)); }); if (syncItems.at(lastChangeInstruction + 1)->_instruction == CSYNC_INSTRUCTION_REMOVE) { -- 2.30.2