Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if an exclude file is deleted, skip it and remove it from internal list #4519

Merged
merged 1 commit into from
May 16, 2022

Conversation

mgallien
Copy link
Collaborator

Signed-off-by: Matthieu Gallien matthieu.gallien@nextcloud.com

@mgallien
Copy link
Collaborator Author

/backport to stable-3.5

if (file.exists() && file.open(QIODevice::ReadOnly)) {
loadExcludeFilePatterns(basePath, file);
if (!file.exists()) {
excludeFileIt = excludeFiles.erase(excludeFileIt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthieugallien All this seems complicated. Can't you just loop through _excludeFiles and remove non-existing exclude files before looping them for loadExcludeFilePatterns(basePath, file);? This will double the loop, but, will improve readability.

@mgallien mgallien force-pushed the bugfix/syncExcludeLstCanBeRemoved branch from da9e3bd to e12572d Compare May 16, 2022 14:54
@allexzander allexzander self-requested a review May 16, 2022 15:03
@mgallien mgallien force-pushed the bugfix/syncExcludeLstCanBeRemoved branch 2 times, most recently from c75e79d to 1357ef6 Compare May 16, 2022 15:32
@mgallien
Copy link
Collaborator Author

/backport to stable-3.5

ignore files can be removed: not an error so adjust tests

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
@mgallien mgallien force-pushed the bugfix/syncExcludeLstCanBeRemoved branch from 1357ef6 to 5f6277b Compare May 16, 2022 19:00
@sonarcloud
Copy link

sonarcloud bot commented May 16, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.0% 90.0% Coverage
0.0% 0.0% Duplication

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4519-5f6277b3ee70ac5668d8421486401524e3d5c364-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien mgallien added this to the 3.6.0 milestone May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants