aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-21 21:47:57 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-21 21:47:57 +0800
commit97c70105b71adc9b7cb9f4db15bf44f98133a82c (patch)
tree25c9cf8ddf389568ee3280e52efa3596fdcc7bbc
parent3c2e03fa5c1f013f06c6134d5cb7244c94994936 (diff)
downloadgsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar.gz
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar.bz2
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar.lz
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar.xz
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.tar.zst
gsoc2013-evolution-97c70105b71adc9b7cb9f4db15bf44f98133a82c.zip
ESelectionModel: Don't assume an ESorter is present.
ETree does not provide one anymore.
-rw-r--r--e-util/e-selection-model.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/e-util/e-selection-model.c b/e-util/e-selection-model.c
index 31d6657230..32aac7df31 100644
--- a/e-util/e-selection-model.c
+++ b/e-util/e-selection-model.c
@@ -654,7 +654,7 @@ move_selection (ESelectionModel *model,
gint row_count;
/* there is no selected row when row is -1 */
- if (row != -1)
+ if (row != -1 && model->sorter != NULL)
row = e_sorter_model_to_sorted (model->sorter, row);
if (up)
@@ -666,7 +666,8 @@ move_selection (ESelectionModel *model,
row_count = e_selection_model_row_count (model);
if (row >= row_count)
row = row_count - 1;
- row = e_sorter_sorted_to_model (model->sorter, row);
+ if (model->sorter != NULL)
+ row = e_sorter_sorted_to_model (model->sorter, row);
e_selection_model_select_as_key_press (model, row, col, state);
return TRUE;
@@ -733,7 +734,9 @@ e_selection_model_key_press (ESelectionModel *model,
gint row = 0;
gint cursor_col = e_selection_model_cursor_col (model);
- row = e_sorter_sorted_to_model (model->sorter, row);
+ if (model->sorter != NULL)
+ row = e_sorter_sorted_to_model (
+ model->sorter, row);
e_selection_model_select_as_key_press (
model, row, cursor_col, key->state);
return TRUE;
@@ -745,7 +748,9 @@ e_selection_model_key_press (ESelectionModel *model,
gint row = e_selection_model_row_count (model) - 1;
gint cursor_col = e_selection_model_cursor_col (model);
- row = e_sorter_sorted_to_model (model->sorter, row);
+ if (model->sorter != NULL)
+ row = e_sorter_sorted_to_model (
+ model->sorter, row);
e_selection_model_select_as_key_press (
model, row, cursor_col, key->state);
return TRUE;