diff options
author | Martin Szulecki | 2009-03-20 11:00:59 +0100 |
---|---|---|
committer | Martin Szulecki | 2009-03-20 11:00:59 +0100 |
commit | 2f09cc7cd6c86ece05864055eca4ddfd78c03179 (patch) | |
tree | 0f313ff11a4cbc7b0161c643bd6dc13b45ff3bea /src/guitools.cs | |
parent | 4e57bfa0652a3c4eb42c79ddbe7a1d00b4aea79c (diff) | |
download | gfax-2f09cc7cd6c86ece05864055eca4ddfd78c03179.tar.gz gfax-2f09cc7cd6c86ece05864055eca4ddfd78c03179.tar.bz2 |
Diffstat (limited to 'src/guitools.cs')
-rwxr-xr-x | src/guitools.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/guitools.cs b/src/guitools.cs index 8828941..bdc9e8a 100755 --- a/src/guitools.cs +++ b/src/guitools.cs @@ -306,10 +306,19 @@ namespace gfax { bool is_sorted = ((Gtk.ListStore)model).GetSortColumnId (out col, out sort); if(!is_sorted) return 0; - - DateTime dateA = (DateTime)model.GetValue (a, col); - DateTime dateB = (DateTime)model.GetValue (b, col); - + + object oA = model.GetValue (a, col); + object oB = model.GetValue (b, col); + + if(oB == null) + return 1; + + if(oA == null) + return -1; + + DateTime dateA = (DateTime)oA; + DateTime dateB = (DateTime)oB; + return dateA.CompareTo(dateB); } |