Merge pull request #5291 from nextcloud/bugfix/qfileinfo-exists

Use QFileInfo::exists where we are only creating a QFileInfo to check if file exists
This commit is contained in:
Claudio Cambra 2022-12-20 12:07:09 +01:00 committed by GitHub
commit cdc58c3053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -493,24 +493,24 @@ void User::slotProgressInfo(const QString &folder, const ProgressInfo &progress)
continue;
}
if (activity._syncFileItemStatus == SyncFileItem::Conflict && !QFileInfo(f->path() + activity._file).exists()) {
if (activity._syncFileItemStatus == SyncFileItem::Conflict && !QFileInfo::exists(f->path() + activity._file)) {
_activityModel->removeActivityFromActivityList(activity);
continue;
}
if (activity._syncFileItemStatus == SyncFileItem::FileLocked && !QFileInfo(f->path() + activity._file).exists()) {
if (activity._syncFileItemStatus == SyncFileItem::FileLocked && !QFileInfo::exists(f->path() + activity._file)) {
_activityModel->removeActivityFromActivityList(activity);
continue;
}
if (activity._syncFileItemStatus == SyncFileItem::FileIgnored && !QFileInfo(f->path() + activity._file).exists()) {
if (activity._syncFileItemStatus == SyncFileItem::FileIgnored && !QFileInfo::exists(f->path() + activity._file)) {
_activityModel->removeActivityFromActivityList(activity);
continue;
}
if (!QFileInfo(f->path() + activity._file).exists()) {
if (!QFileInfo::exists(f->path() + activity._file)) {
_activityModel->removeActivityFromActivityList(activity);
continue;
}

View file

@ -286,7 +286,7 @@ void SyncEngine::conflictRecordMaintenance()
const auto conflictRecordPaths = _journal->conflictRecordPaths();
for (const auto &path : conflictRecordPaths) {
auto fsPath = _propagator->fullLocalPath(QString::fromUtf8(path));
if (!QFileInfo(fsPath).exists()) {
if (!QFileInfo::exists(fsPath)) {
_journal->deleteConflictRecord(path);
}
}