[hyena] [ListView] Reload model if not properly sorted
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] [ListView] Reload model if not properly sorted
- Date: Thu, 18 Nov 2010 19:27:01 +0000 (UTC)
commit c370de7581706102a60621b2943fda925981dac3
Author: Gabriel Burt <gabriel burt gmail com>
Date: Thu Nov 18 13:26:25 2010 -0600
[ListView] Reload model if not properly sorted
.../Hyena.Data.Gui/ListView/ListView_Model.cs | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
index aa384a6..05290d3 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
@@ -65,11 +65,17 @@ namespace Hyena.Data.Gui
IsEverReorderable = model.CanReorder;
}
+ if (ViewLayout != null) {
+ ViewLayout.Model = Model;
+ }
+
ISortable sortable = model as ISortable;
if (sortable != null && ColumnController != null) {
ISortableColumn sort_column = ColumnController.SortColumn ?? ColumnController.DefaultSortColumn;
if (sort_column != null) {
- sortable.Sort (sort_column);
+ if (sortable.Sort (sort_column)) {
+ model.Reload ();
+ }
RecalculateColumnSizes ();
RegenerateColumnCache ();
InvalidateHeader ();
@@ -77,10 +83,6 @@ namespace Hyena.Data.Gui
}
}
- if (ViewLayout != null) {
- ViewLayout.Model = Model;
- }
-
RefreshViewForModel (vpos);
var handler = ModelChanged;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]