diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-07-05 10:12:39 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-07-06 04:40:49 +0800 |
commit | 70bce028f771c5366fc2d4c6e3bc49fcd3da1a10 (patch) | |
tree | 81292dd1282f37555e474155f0411cdb071519e3 /e-util | |
parent | 031d11b437f62673c4ef89e741cd7a9935792db0 (diff) | |
download | gsoc2013-evolution-70bce028f771c5366fc2d4c6e3bc49fcd3da1a10.tar.gz gsoc2013-evolution-70bce028f771c5366fc2d4c6e3bc49fcd3da1a10.tar.zst gsoc2013-evolution-70bce028f771c5366fc2d4c6e3bc49fcd3da1a10.zip |
Remove GalDefineViewsModel.
No longer used.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/Makefile.am | 2 | ||||
-rw-r--r-- | e-util/e-util.h | 1 | ||||
-rw-r--r-- | e-util/gal-define-views-model.c | 364 | ||||
-rw-r--r-- | e-util/gal-define-views-model.h | 87 | ||||
-rw-r--r-- | e-util/gal-view-instance-save-as-dialog.c | 1 | ||||
-rw-r--r-- | e-util/gal-view-new-dialog.c | 1 |
6 files changed, 0 insertions, 456 deletions
diff --git a/e-util/Makefile.am b/e-util/Makefile.am index bdffb0f8af..479a6dc818 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -328,7 +328,6 @@ evolution_util_include_HEADERS = \ gal-a11y-e-tree.h \ gal-a11y-factory.h \ gal-a11y-util.h \ - gal-define-views-model.h \ gal-view-collection.h \ gal-view-etable.h \ gal-view-factory-etable.h \ @@ -566,7 +565,6 @@ libevolution_util_la_SOURCES = \ gal-a11y-e-tree-factory.c \ gal-a11y-e-tree.c \ gal-a11y-util.c \ - gal-define-views-model.c \ gal-view-collection.c \ gal-view-etable.c \ gal-view-factory-etable.c \ diff --git a/e-util/e-util.h b/e-util/e-util.h index eb59765e44..ebd44b6af1 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -222,7 +222,6 @@ #include <e-util/e-xml-utils.h> #include <e-util/ea-cell-table.h> #include <e-util/ea-factory.h> -#include <e-util/gal-define-views-model.h> #include <e-util/gal-view-collection.h> #include <e-util/gal-view-etable.h> #include <e-util/gal-view-factory-etable.h> diff --git a/e-util/gal-define-views-model.c b/e-util/gal-define-views-model.c deleted file mode 100644 index d05ac53e67..0000000000 --- a/e-util/gal-define-views-model.c +++ /dev/null @@ -1,364 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <libxml/tree.h> -#include <libxml/parser.h> -#include <libxml/xmlmemory.h> - -#include <glib/gi18n.h> - -#include "gal-define-views-model.h" - -enum { - PROP_0, - PROP_EDITABLE, - PROP_COLLECTION -}; - -/* Forward Declarations */ -static void gal_define_views_model_table_model_init - (ETableModelInterface *interface); - -G_DEFINE_TYPE_WITH_CODE ( - GalDefineViewsModel, - gal_define_views_model, - G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE ( - E_TYPE_TABLE_MODEL, - gal_define_views_model_table_model_init)) - -static void -gal_define_views_model_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - GalDefineViewsModel *model; - - model = GAL_DEFINE_VIEWS_MODEL (object); - - switch (property_id) { - case PROP_EDITABLE: - model->editable = g_value_get_boolean (value); - return; - - case PROP_COLLECTION: - e_table_model_pre_change (E_TABLE_MODEL (object)); - if (g_value_get_object (value)) - model->collection = GAL_VIEW_COLLECTION ( - g_value_get_object (value)); - else - model->collection = NULL; - e_table_model_changed (E_TABLE_MODEL (object)); - return; - } - - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -} - -static void -gal_define_views_model_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - GalDefineViewsModel *model; - - model = GAL_DEFINE_VIEWS_MODEL (object); - - switch (property_id) { - case PROP_EDITABLE: - g_value_set_boolean (value, model->editable); - return; - - case PROP_COLLECTION: - g_value_set_object (value, model->collection); - return; - } - - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -} - -static void -gdvm_dispose (GObject *object) -{ - GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL (object); - - if (model->collection) - g_object_unref (model->collection); - model->collection = NULL; - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (gal_define_views_model_parent_class)->dispose (object); -} - -/* This function returns the number of columns in our ETableModel. */ -static gint -gdvm_col_count (ETableModel *etc) -{ - return 1; -} - -/* This function returns the number of rows in our ETableModel. */ -static gint -gdvm_row_count (ETableModel *etc) -{ - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); - if (views->collection) - return gal_view_collection_get_count (views->collection); - else - return 0; -} - -static void -gdvm_append_row (ETableModel *etm, - ETableModel *source, - gint row) -{ -} - -/* This function returns the value at a particular point in our ETableModel. */ -static gpointer -gdvm_value_at (ETableModel *etc, - gint col, - gint row) -{ - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); - GalView *view; - const gchar *value; - - view = gal_view_collection_get_view (views->collection, row); - value = gal_view_get_title (view); - - return (gpointer) ((value != NULL) ? value : ""); -} - -/* This function sets the value at a particular point in our ETableModel. */ -static void -gdvm_set_value_at (ETableModel *etc, - gint col, - gint row, - gconstpointer val) -{ - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); - if (views->editable) { - GalView *view; - - view = gal_view_collection_get_view (views->collection, row); - - e_table_model_pre_change (etc); - gal_view_set_title (view, val); - e_table_model_cell_changed (etc, col, row); - } -} - -/* This function returns whether a particular cell is editable. */ -static gboolean -gdvm_is_cell_editable (ETableModel *etc, - gint col, - gint row) -{ - return GAL_DEFINE_VIEWS_MODEL (etc)->editable; -} - -/* This function duplicates the value passed to it. */ -static gpointer -gdvm_duplicate_value (ETableModel *etc, - gint col, - gconstpointer value) -{ - return g_strdup (value); -} - -/* This function frees the value passed to it. */ -static void -gdvm_free_value (ETableModel *etc, - gint col, - gpointer value) -{ - g_free (value); -} - -static gpointer -gdvm_initialize_value (ETableModel *etc, - gint col) -{ - return g_strdup (""); -} - -static gboolean -gdvm_value_is_empty (ETableModel *etc, - gint col, - gconstpointer value) -{ - return !(value && *(gchar *) value); -} - -static gchar * -gdvm_value_to_string (ETableModel *etc, - gint col, - gconstpointer value) -{ - return g_strdup (value); -} - -/** - * gal_define_views_model_append - * @model: The model to add to. - * @view: The view to add. - * - * Adds the given view to the gal define views model. - */ -void -gal_define_views_model_append (GalDefineViewsModel *model, - GalView *view) -{ - ETableModel *etm = E_TABLE_MODEL (model); - - e_table_model_pre_change (etm); - gal_view_collection_append (model->collection, view); - e_table_model_row_inserted ( - etm, gal_view_collection_get_count (model->collection) - 1); -} - -static void -gal_define_views_model_class_init (GalDefineViewsModelClass *class) -{ - GObjectClass *object_class; - - object_class = G_OBJECT_CLASS (class); - object_class->set_property = gal_define_views_model_set_property; - object_class->get_property = gal_define_views_model_get_property; - object_class->dispose = gdvm_dispose; - - g_object_class_install_property ( - object_class, - PROP_EDITABLE, - g_param_spec_boolean ( - "editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property ( - object_class, - PROP_COLLECTION, - g_param_spec_object ( - "collection", - "Collection", - NULL, - GAL_TYPE_VIEW_COLLECTION, - G_PARAM_READWRITE)); -} - -static void -gal_define_views_model_table_model_init (ETableModelInterface *interface) -{ - interface->column_count = gdvm_col_count; - interface->row_count = gdvm_row_count; - interface->append_row = gdvm_append_row; - - interface->value_at = gdvm_value_at; - interface->set_value_at = gdvm_set_value_at; - interface->is_cell_editable = gdvm_is_cell_editable; - - interface->duplicate_value = gdvm_duplicate_value; - interface->free_value = gdvm_free_value; - interface->initialize_value = gdvm_initialize_value; - interface->value_is_empty = gdvm_value_is_empty; - interface->value_to_string = gdvm_value_to_string; -} - -static void -gal_define_views_model_init (GalDefineViewsModel *model) -{ - model->collection = NULL; -} - -/** - * gal_define_views_model_new - * - * Returns a new define views model. This is a list of views as an - * ETable for use in the GalDefineViewsDialog. - * - * Returns: The new GalDefineViewsModel. - */ -ETableModel * -gal_define_views_model_new (void) -{ - return g_object_new (GAL_TYPE_DEFINE_VIEWS_MODEL, NULL); -} - -/** - * gal_define_views_model_get_view: - * @model: The GalDefineViewsModel. - * @n: Which view to get. - * - * Gets the nth view. - * - * Returns: The view. - */ -GalView * -gal_define_views_model_get_view (GalDefineViewsModel *model, - gint n) -{ - return gal_view_collection_get_view (model->collection, n); -} - -/** - * gal_define_views_model_delete_view: - * @model: The GalDefineViewsModel. - * @n: Which view to delete. - * - * Deletes the nth view. - */ -void -gal_define_views_model_delete_view (GalDefineViewsModel *model, - gint n) -{ - e_table_model_pre_change (E_TABLE_MODEL (model)); - gal_view_collection_delete_view (model->collection, n); - e_table_model_row_deleted (E_TABLE_MODEL (model), n); -} - -/** - * gal_define_views_model_copy_view: - * @model: The GalDefineViewsModel. - * @n: Which view to copy. - * - * Copys the nth view. - */ -void -gal_define_views_model_copy_view (GalDefineViewsModel *model, - gint n) -{ - ETableModel *etm = E_TABLE_MODEL (model); - e_table_model_pre_change (etm); - gal_view_collection_copy_view (model->collection, n); - e_table_model_row_inserted ( - etm, gal_view_collection_get_count (model->collection) - 1); -} diff --git a/e-util/gal-define-views-model.h b/e-util/gal-define-views-model.h deleted file mode 100644 index cd4d44ccf7..0000000000 --- a/e-util/gal-define-views-model.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) -#error "Only <e-util/e-util.h> should be included directly." -#endif - -#ifndef GAL_DEFINE_VIEWS_MODEL_H -#define GAL_DEFINE_VIEWS_MODEL_H - -#include <e-util/e-table-model.h> -#include <e-util/gal-view.h> -#include <e-util/gal-view-collection.h> - -/* Standard GObject macros */ -#define GAL_TYPE_DEFINE_VIEWS_MODEL \ - (gal_define_views_model_get_type ()) -#define GAL_DEFINE_VIEWS_MODEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST \ - ((obj), GAL_TYPE_DEFINE_VIEWS_MODEL, GalDefineViewsModel)) -#define GAL_DEFINE_VIEWS_MODEL_CLASS(cls) \ - (G_TYPE_CHECK_CLASS_CAST \ - ((cls), GAL_TYPE_DEFINE_VIEWS_MODEL, GalDefineViewsModelClass)) -#define GAL_IS_DEFINE_VIEWS_MODEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE \ - ((obj), GAL_TYPE_DEFINE_VIEWS_MODEL)) -#define GAL_IS_DEFINE_VIEWS_MODEL_CLASS(cls) \ - (G_TYPE_CHECK_CLASS_TYPE \ - ((cls), GAL_TYPE_DEFINE_VIEWS_MODEL)) -#define GAL_DEFINE_VIEWS_MODEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS \ - ((obj), GAL_TYPE_DEFINE_VIEWS_MODEL, GalDefineViewsModelClass)) - -G_BEGIN_DECLS - -typedef struct _GalDefineViewsModel GalDefineViewsModel; -typedef struct _GalDefineViewsModelClass GalDefineViewsModelClass; - -struct _GalDefineViewsModel { - GObject parent; - - /* item specific fields */ - GalViewCollection *collection; - - guint editable : 1; -}; - -struct _GalDefineViewsModelClass { - GObjectClass parent_class; -}; - -GType gal_define_views_model_get_type (void) G_GNUC_CONST; -ETableModel * gal_define_views_model_new (void); -void gal_define_views_model_append (GalDefineViewsModel *model, - GalView *view); -GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, - gint n); -void gal_define_views_model_delete_view - (GalDefineViewsModel *model, - gint n); -void gal_define_views_model_copy_view - (GalDefineViewsModel *model, - gint n); - -G_END_DECLS - -#endif /* GAL_DEFINE_VIEWS_MODEL_H */ diff --git a/e-util/gal-view-instance-save-as-dialog.c b/e-util/gal-view-instance-save-as-dialog.c index b383001c17..71ac113049 100644 --- a/e-util/gal-view-instance-save-as-dialog.c +++ b/e-util/gal-view-instance-save-as-dialog.c @@ -30,7 +30,6 @@ #include "e-misc-utils.h" #include "e-util-private.h" -#include "gal-define-views-model.h" #include "gal-view-new-dialog.h" G_DEFINE_TYPE (GalViewInstanceSaveAsDialog, gal_view_instance_save_as_dialog, GTK_TYPE_DIALOG) diff --git a/e-util/gal-view-new-dialog.c b/e-util/gal-view-new-dialog.c index aef751b9fc..d17dd94f82 100644 --- a/e-util/gal-view-new-dialog.c +++ b/e-util/gal-view-new-dialog.c @@ -32,7 +32,6 @@ #include "e-misc-utils.h" #include "e-util-private.h" #include "e-unicode.h" -#include "gal-define-views-model.h" enum { PROP_0, |