DVCS Branch Manager with filtering and sorting proposal

Authored by christiant on Mar 31 2019, 10:20 AM.



The porposal is to utilize QSortFilterProxyModel for sorting and filtering.

When working with on a bigger project with multiple branches some means to find a desired branch for switching or creating a new branch may be considered helpful.
So I added a line edit and a QSortFilterProxyModel to do that for me.

Additionally: new branches are currently appended. Though this makes them easy to find, I think it's counter intuitive and a tad ugly. While the sort mechanism of the Proxy does not help initially, it does upon adding branches.

Drawback: the line edit for filtering may be associated with the "New" button by users. This could make the workflow for that less intuitive.

Test Plan

Fire up Git->Branches on a git project.

Make sure all branches are there.
Type in the line edit to filter. Only branches that match should be included.
Clearing the line edit should result in all elements to become visible again.
Create New branch, that should be added to list in alphabetical order.

Diff Detail

Lint Skipped
Unit Tests Skipped
christiant created this revision.Mar 31 2019, 10:20 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptMar 31 2019, 10:20 AM
christiant requested review of this revision.Mar 31 2019, 10:20 AM

How it looks.

apol added a subscriber: apol.Mar 31 2019, 2:47 PM

Looks good to me overall, Let's clean it up so we can get it in.

Maybe it would make sense to have some placeholder text in the filter text field, could you add that? Something that says Search... or so.


Just pass QString()


Unrelated unnecessary change


Why's the icons changes? These seem unrelated.

kfunk added a subscriber: kfunk.Apr 1 2019, 6:39 AM
kfunk added inline comments.

Current Qt designer automatically adds these when saving files, noticed this as well...

I will do that.

I will also remove the unnecarry nested QVBoxLayout. I had something in mind with that and forgot about it when submitting.

For the "Search ..." term: I would set the content of the QLineEdit to the text but keep the initial filter of the proxymodel as QString(). Originally I had a "*" on both.
Though I actually don't know how to do that in the correct way regarding localization - so maybe you have some pointers for me on how to do that.

christiant updated this revision to Diff 55508.Apr 5 2019, 11:12 PM

Work through feedback:

  • remove changes to iconset
  • QString() on setWildcard
  • remove newline
  • placholderText "Search..."
christiant marked 4 inline comments as done.Apr 5 2019, 11:13 PM
apol added a comment.Apr 8 2019, 12:04 AM

I think you uploaded the patch against the last version, not against master.

Yeah, you're right.

I'll fix that.

christiant updated this revision to Diff 55779.Apr 8 2019, 8:34 PM

Upload correct patch

apol accepted this revision.Apr 9 2019, 1:04 AM

Good stuff, do you have push rights?

This revision is now accepted and ready to land.Apr 9 2019, 1:04 AM

Probably not - this is my first commit. Where do I need to apply :-D

Anything I need to do?

apol closed this revision.Apr 19 2019, 11:41 PM
apol added a comment.Apr 19 2019, 11:42 PM

Probably not - this is my first commit. Where do I need to apply :-D

Here it's explained how to apply: https://community.kde.org/Infrastructure/Get_a_Developer_Account

You don't need to apply to keep fixing stuff though, sorry for the delay! :)

No problem. I don't think I'm yet involved enough to apply - besides being a user.