You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a new profile adds the new profile at the bottom of the list in the main window. Similarly, editing an existing profile doesn't change its position in the list. I think that in both cases the list should be kept sorted. Restarting Vorta correctly updates the positions of the profiles to be sorted alphabetically.
This was recently noticed during the review of #1899 (comment)
Steps to reproduce the behavior:
Create a new profile using the menu in the main window
The profile is added last on the list, even if it should sort before other entries
Alternatively:
Rename an already existing profile
Its position in the list doesn't change, even if the new alphabetical ordering is no longer valid
Add some additional handling in the profile_add_edit_result function to keep the list sorted. This is a quick commit that does that: Parnassius@59661f9
Use the sortItems method of QListWidget to sort the list after every update, thus removing the need to use the order_by sql method.
The two solutions cannot co-exist since the sql ordering is case-insensitive while QListWidget.sortItems is case-sensitive. In the second case additional care should be taken to ensure the use of sortItems doesn't break anything. From a quick glance I think the way current_profile is set during the initialization of the main window should be updated, and maybe some additional changes are needed as well.
What do you think? Let me know if I should create a small pull request with the commit linked above or if a solution based on option 2 should be preferred
The text was updated successfully, but these errors were encountered:
Description
Creating a new profile adds the new profile at the bottom of the list in the main window. Similarly, editing an existing profile doesn't change its position in the list. I think that in both cases the list should be kept sorted. Restarting Vorta correctly updates the positions of the profiles to be sorted alphabetically.
This was recently noticed during the review of #1899 (comment)
Steps to reproduce the behavior:
Alternatively:
Environment
I see two possible solutions for this:
Add some additional handling in the
profile_add_edit_result
function to keep the list sorted. This is a quick commit that does that: Parnassius@59661f9Use the sortItems method of QListWidget to sort the list after every update, thus removing the need to use the
order_by
sql method.The two solutions cannot co-exist since the sql ordering is case-insensitive while QListWidget.sortItems is case-sensitive. In the second case additional care should be taken to ensure the use of
sortItems
doesn't break anything. From a quick glance I think the waycurrent_profile
is set during the initialization of the main window should be updated, and maybe some additional changes are needed as well.vorta/src/vorta/views/main_window.py
Lines 66 to 68 in 9b8dbce
What do you think? Let me know if I should create a small pull request with the commit linked above or if a solution based on option 2 should be preferred
The text was updated successfully, but these errors were encountered: