[sysprof] libsysprof-ui: tweak sorting of marks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof-ui: tweak sorting of marks
- Date: Wed, 29 May 2019 22:33:07 +0000 (UTC)
commit c57258c40cb1435be69ef83abfae43b135d46f96
Author: Christian Hergert <chergert redhat com>
Date: Fri May 17 17:00:44 2019 -0700
libsysprof-ui: tweak sorting of marks
src/libsysprof-ui/sysprof-marks-model.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-marks-model.c b/src/libsysprof-ui/sysprof-marks-model.c
index 219bf42..a9e1e3b 100644
--- a/src/libsysprof-ui/sysprof-marks-model.c
+++ b/src/libsysprof-ui/sysprof-marks-model.c
@@ -298,10 +298,16 @@ item_compare (gconstpointer a,
return -1;
else if (ia->begin_time > ib->begin_time)
return 1;
- else if (ia->end_time > ib->end_time)
+
+ /* Sort items with longer duration first, as they might be
+ * "overarching" marks containing other marks.
+ */
+ if (ia->end_time > ib->end_time)
+ return -1;
+ else if (ib->end_time > ia->end_time)
return 1;
- else
- return 0;
+
+ return 0;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]