Skip to content

Commit

Permalink
Code maintenance - correct some syntax, fix some warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Dominique Fuchs <[email protected]>
  • Loading branch information
DominiqueFuchs committed Jan 18, 2020
1 parent de74057 commit 9b5bb13
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ void Folder::slotItemCompleted(const SyncFileItemPtr &item)
_folderWatcher->removePath(path() + item->_file);
_folderWatcher->addPath(path() + item->destination());
break;
default:
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/ActivityListModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private slots:
void activityJobStatusCode(int statusCode);

protected:
QHash<int, QByteArray> roleNames() const;
QHash<int, QByteArray> roleNames() const override;

private:
void startFetchJob();
Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/UserModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/owncloudpropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 9b5bb13

Please sign in to comment.