Commit 3a779ba7 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

* gladeui/glade-project.[ch], gladeui/glade-widget.c, gladeui/glade-command.c:

	  Removing legacy 'old_project' argument from glade_project_add_object().
parent c856737c
......@@ -16,6 +16,9 @@
* Made GladeWidget internalize *everything* into a private data structure,
33 files changed, 1318 insertions(+), 1230 deletions(-)
* gladeui/glade-project.[ch], gladeui/glade-widget.c, gladeui/glade-command.c:
Removing legacy 'old_project' argument from glade_project_add_object().
2010-12-31 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
......
......@@ -1368,13 +1368,13 @@ glade_command_add_execute (GladeCommandAddRemove * me)
}
}
glade_project_add_object (GLADE_COMMAND (me)->project, NULL,
glade_project_add_object (GLADE_COMMAND (me)->project,
glade_widget_get_object (cdata->widget));
for (l = cdata->reffed; l; l = l->next)
{
GladeWidget *reffed = l->data;
glade_project_add_object (GLADE_COMMAND (me)->project, NULL,
glade_project_add_object (GLADE_COMMAND (me)->project,
glade_widget_get_object (reffed));
}
......
......@@ -1496,7 +1496,7 @@ glade_project_load_internal (GladeProject * project)
continue;
if ((widget = glade_widget_read (project, NULL, node, NULL)) != NULL)
glade_project_add_object (project, NULL, glade_widget_get_object (widget));
glade_project_add_object (project, glade_widget_get_object (widget));
if (project->priv->load_cancel)
break;
......@@ -2827,15 +2827,12 @@ glade_project_notify_row_deleted (GladeProject * project, GladeWidget * gwidget)
/**
* glade_project_add_object:
* @project: the #GladeProject the widget is added to
* @old_project: the #GladeProject the widget was previously in
* (or %NULL for the clipboard)
* @object: the #GObject to add
*
* Adds an object to the project.
*/
void
glade_project_add_object (GladeProject * project,
GladeProject * old_project, GObject * object)
glade_project_add_object (GladeProject * project, GObject * object)
{
GladeWidget *gwidget;
GList *list, *children;
......@@ -2906,7 +2903,7 @@ glade_project_add_object (GladeProject * project,
if ((children = glade_widget_get_children (gwidget)) != NULL)
{
for (list = children; list && list->data; list = list->next)
glade_project_add_object (project, old_project, G_OBJECT (list->data));
glade_project_add_object (project, G_OBJECT (list->data));
g_list_free (children);
}
......@@ -3022,7 +3019,7 @@ adjust_naming_policy (GladeProject * project, GladeNamingPolicy policy)
/* Put the toplevels back with the new policy (recursive operation) */
for (list = objects; list; list = list->next)
glade_project_add_object (project, project, G_OBJECT (list->data));
glade_project_add_object (project, G_OBJECT (list->data));
g_list_free (objects);
/* Unref them now */
......
......@@ -39,47 +39,47 @@ typedef enum
**/
typedef enum
{
GLADE_PROJECT_MODEL_COLUMN_ICON_NAME,
GLADE_PROJECT_MODEL_COLUMN_NAME,
GLADE_PROJECT_MODEL_COLUMN_TYPE_NAME,
GLADE_PROJECT_MODEL_COLUMN_OBJECT,
GLADE_PROJECT_MODEL_COLUMN_MISC,
GLADE_PROJECT_MODEL_N_COLUMNS
GLADE_PROJECT_MODEL_COLUMN_ICON_NAME,
GLADE_PROJECT_MODEL_COLUMN_NAME,
GLADE_PROJECT_MODEL_COLUMN_TYPE_NAME,
GLADE_PROJECT_MODEL_COLUMN_OBJECT,
GLADE_PROJECT_MODEL_COLUMN_MISC,
GLADE_PROJECT_MODEL_N_COLUMNS
} GladeProjectModelColumns;
struct _GladeProject
{
GObject parent_instance;
GObject parent_instance;
GladeProjectPrivate *priv;
GladeProjectPrivate *priv;
};
struct _GladeProjectClass
{
GObjectClass parent_class;
void (*add_object) (GladeProject *project,
GladeWidget *widget);
void (*remove_object) (GladeProject *project,
GladeWidget *widget);
void (*undo) (GladeProject *project);
void (*redo) (GladeProject *project);
GladeCommand *(*next_undo_item) (GladeProject *project);
GladeCommand *(*next_redo_item) (GladeProject *project);
void (*push_undo) (GladeProject *project,
GladeCommand *command);
void (*changed) (GladeProject *project,
GladeCommand *command,
gboolean forward);
void (*widget_name_changed) (GladeProject *project,
GladeWidget *widget);
void (*selection_changed) (GladeProject *project);
void (*close) (GladeProject *project);
void (*parse_finished) (GladeProject *project);
GObjectClass parent_class;
void (*add_object) (GladeProject *project,
GladeWidget *widget);
void (*remove_object) (GladeProject *project,
GladeWidget *widget);
void (*undo) (GladeProject *project);
void (*redo) (GladeProject *project);
GladeCommand *(*next_undo_item) (GladeProject *project);
GladeCommand *(*next_redo_item) (GladeProject *project);
void (*push_undo) (GladeProject *project,
GladeCommand *command);
void (*changed) (GladeProject *project,
GladeCommand *command,
gboolean forward);
void (*widget_name_changed) (GladeProject *project,
GladeWidget *widget);
void (*selection_changed) (GladeProject *project);
void (*close) (GladeProject *project);
void (*parse_finished) (GladeProject *project);
};
......@@ -124,7 +124,6 @@ gboolean glade_project_get_readonly (GladeProject *project);
const GList *glade_project_get_objects (GladeProject *project);
void glade_project_add_object (GladeProject *project,
GladeProject *old_project,
GObject *object);
void glade_project_remove_object (GladeProject *project,
......
......@@ -328,8 +328,8 @@ glade_property_sync_impl (GladeProperty * property)
/* Heh, here are the many reasons not to
* sync a property ;-)
*/
if ( /* the class can be NULL during object,
* construction this is just a temporary state */
if (/* the class can be NULL during object,
* construction this is just a temporary state */
property->klass == NULL ||
/* optional properties that are disabled */
property->enabled == FALSE ||
......
......@@ -2525,7 +2525,7 @@ glade_widget_rebuild (GladeWidget * gwidget)
*/
if (project)
{
glade_project_add_object (project, NULL, gwidget->priv->object);
glade_project_add_object (project, gwidget->priv->object);
if (reselect)
glade_project_selection_add (project, gwidget->priv->object, TRUE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment