Code maintenance - correct some syntax, fix some warnings.

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Dominique Fuchs 2020-01-18 10:30:34 +01:00
parent de74057cc8
commit 9b5bb1365c
5 changed files with 10 additions and 5 deletions

View File

@ -914,6 +914,8 @@ void Folder::slotItemCompleted(const SyncFileItemPtr &item)
_folderWatcher->removePath(path() + item->_file);
_folderWatcher->addPath(path() + item->destination());
break;
default:
break;
}
}

View File

@ -85,7 +85,7 @@ signals:
void activityJobStatusCode(int statusCode);
protected:
QHash<int, QByteArray> roleNames() const;
QHash<int, QByteArray> roleNames() const override;
private:
void startFetchJob();

View File

@ -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 {

View File

@ -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));

View File

@ -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) {