-
Notifications
You must be signed in to change notification settings - Fork 671
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
Allow to filter issue table by issue type #9023
Conversation
PLEASE TEST BEFORE MERGING :-) |
Oh and please change the target branch, it should be 2.9. I cannot find a way to do that... (I forgot to do that when creating the MR) |
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 failed to choose the right checkbox...
Please fix the test runs.
2debfa7
to
484ebc9
Compare
484ebc9
to
ce53e6b
Compare
|
src/gui/issueswidget.cpp
Outdated
} | ||
|
||
private: | ||
QSet<SyncFileItem::Status> _filter; |
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.
Could you see an issue in converting the enum to QFlags? It would simplify the filter by a lot.
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.
A comment at the enum states that it fits in 4 bits, so I thought that turning that into flags would break something...
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.
Ah yes the 4bit optimisation ......
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.
So should I change it or not?
3552006
to
07baaae
Compare
07baaae
to
883031a
Compare
ea3cc84
to
f6e8b36
Compare
src/gui/issueswidget.cpp
Outdated
|
||
void resetFilter() | ||
{ | ||
setFilter({ false, true, true, true, true, true, true, true, true, true, true }); |
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.
.fill(true);
?
src/gui/issueswidget.cpp
Outdated
_statusSortModel->resetFilter(); | ||
|
||
for (QAction *action : menu->actions()) { | ||
if (action->objectName() == Models::NoFilterObjectName) { |
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.
Not optimal but I can't come up by something better atm, can you add a todo?
also
QObject::findChild
@@ -77,11 +83,13 @@ ProtocolWidget::~ProtocolWidget() | |||
delete _ui; | |||
} | |||
|
|||
void ProtocolWidget::showHeaderContextMenu(ExpandingHeaderView *header, QSortFilterProxyModel *model) | |||
void ProtocolWidget::showHeaderContextMenu(ExpandingHeaderView *header) | |||
{ |
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.
Please re add the filter menu, make sure to not duplicate the code.
src/libsync/syncfileitem.h
Outdated
@@ -94,6 +94,7 @@ class OWNCLOUDSYNC_EXPORT SyncFileItem | |||
Excluded | |||
}; | |||
Q_ENUM(Status) | |||
static constexpr int StatusCount = Excluded + 1; |
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 prefer to have the count in the enum it self. Yes that means we would need to touch the switch statements where the status is used. This would also allow us to drop cases where default: is define and ensure we handle all cases.
f6e8b36
to
952e401
Compare
c79d27e
to
b56fbca
Compare
b56fbca
to
a79cd3b
Compare
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.
Yay thx
Please retry analysis of this Pull-Request directly on SonarCloud. |
Fixes: #9000