-
Notifications
You must be signed in to change notification settings - Fork 669
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
Fix overall status computation #10536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the new logic is reasonable. I found a problem, please fix. I'll re-review afterwards.
src/gui/folderman.cpp
Outdated
} | ||
break; | ||
auto status = f->syncPaused() ? SyncResult::Paused : f->syncResult().status(); | ||
if (SyncResult::Undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to compare against status
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow ... 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is nice, but why and how does that solve the problem described in the Bugreport?
Before status done was taking precedence over status in progress |
status = SyncResult::Problem; | ||
} | ||
if (status > _overallStatus.status()) { | ||
_overallStatus.setStatus(status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This somehow looks as if the status can never go to "lower" values any more, because of the if statement. In the code before it could. Or is it reset elsewhere again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commutation happens on a temporary so we always start with undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined
is currently the smallest value. The order is documented above the definition. This should be fine.
f2b3418
to
eba85e4
Compare
Kudos, SonarCloud Quality Gate passed! |
status = SyncResult::Problem; | ||
} | ||
if (status > _overallStatus.status()) { | ||
_overallStatus.setStatus(status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined
is currently the smallest value. The order is documented above the definition. This should be fine.
Please read carefully, I'm not sure what the whole logic here was meant to do (It`s my code).
Fixes: #9270