aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-sorted-variable.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-05 08:10:32 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-05 08:10:32 +0800
commitccd8e1fedde7a29acb5e10ade7e69b9197e65dbe (patch)
tree5c5d9b1d535b32aca4eb6926df4e968c2b4bd2ab /widgets/table/e-table-sorted-variable.c
parentad3ee0de0244facb7bd2eed03805b68d01022601 (diff)
downloadgsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.gz
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.bz2
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.lz
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.xz
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.zst
gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.zip
Add an e_table_group_add_all function and implement it in the different
2000-05-04 Christopher James Lahey <clahey@helixcode.com> * e-table-group-container.c, e-table-group-leaf.c, e-table-group.c, e-table-group.h: Add an e_table_group_add_all function and implement it in the different ETableGroup classes. * e-table-sort-info.c: Make set_nth not call changed twice if it needs to allocate more space. * e-table-sorted-variable.c, e-table-subset-variable.c, e-table-subset-variable.h: Add and implement an e_table_subset_variable_add_all command. * e-table.c: Use e_table_group_add_all as appropriate. Fix ETable grouping xml to work if there is a text element at the bottom of the grouping tree. svn path=/trunk/; revision=2806
Diffstat (limited to 'widgets/table/e-table-sorted-variable.c')
-rw-r--r--widgets/table/e-table-sorted-variable.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c
index 1cc2557133..e3a0fbc8c5 100644
--- a/widgets/table/e-table-sorted-variable.c
+++ b/widgets/table/e-table-sorted-variable.c
@@ -26,6 +26,7 @@ static void etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, E
static void etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv);
static void etsv_sort (ETableSortedVariable *etsv);
static void etsv_add (ETableSubsetVariable *etssv, gint row);
+static void etsv_add_all (ETableSubsetVariable *etssv);
static void
etsv_destroy (GtkObject *object)
@@ -68,6 +69,7 @@ etsv_class_init (GtkObjectClass *object_class)
object_class->destroy = etsv_destroy;
etssv_class->add = etsv_add;
+ etssv_class->add_all = etsv_add_all;
}
static void
@@ -115,6 +117,29 @@ etsv_add (ETableSubsetVariable *etssv,
e_table_model_changed (etm);
}
+static void
+etsv_add_all (ETableSubsetVariable *etssv)
+{
+ ETableModel *etm = E_TABLE_MODEL(etssv);
+ ETableSubset *etss = E_TABLE_SUBSET(etssv);
+ ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv);
+ int rows = e_table_model_row_count(etss->source);
+ int i;
+
+ if (etss->n_map + rows > etssv->n_vals_allocated){
+ etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows);
+ etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int));
+ }
+ for (i = 0; i < rows; i++)
+ etss->map_table[etss->n_map++] = i;
+
+ if (etsv->sort_idle_id == 0) {
+ etsv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) etsv_sort_idle, etsv, NULL);
+ }
+ if (!etm->frozen)
+ e_table_model_changed (etm);
+}
+
ETableModel *
e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
{