[gitg] Fix sorting of remotes
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Fix sorting of remotes
- Date: Sun, 14 Dec 2014 14:43:29 +0000 (UTC)
commit 62b7f9bb9b7255dfd75d0a0c7c5100e6abc35f4f
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sun Dec 14 15:43:01 2014 +0100
Fix sorting of remotes
gitg/history/gitg-history-refs-list.vala | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gitg/history/gitg-history-refs-list.vala b/gitg/history/gitg-history-refs-list.vala
index d1b5e38..8a968ac 100644
--- a/gitg/history/gitg-history-refs-list.vala
+++ b/gitg/history/gitg-history-refs-list.vala
@@ -435,8 +435,21 @@ public class RefsList : Gtk.ListBox
if ((head1 == null) != (head2 == null))
{
- // Only one is a header
- return head1 != null ? -1 : 1;
+ var head = head1 != null ? head1 : head2;
+
+ // One is a header, and the other a normal row
+ if (head.is_sub_header_remote)
+ {
+ // Compare the subheader name
+ var rref = head1 != null ? ref2 : ref1;
+ var cmp =
head.ref_name.casefold().collate(rref.reference.parsed_name.remote_name.casefold());
+
+ return head1 != null ? cmp : -cmp;
+ }
+ else
+ {
+ return head1 != null ? -1 : 1;
+ }
}
else if (head1 != null && head2 != null)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]