Commit 82cb22c4 authored by Tristan Van Berkom's avatar Tristan Van Berkom

* gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion

	  of project "instance_count" which is now unused.
parent f380b403
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
* plugins/gtk+/glade-gtk.c: Fixed floating project menus when context menu is fired (bug 141714). * plugins/gtk+/glade-gtk.c: Fixed floating project menus when context menu is fired (bug 141714).
* gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion
of project "instance_count" which is now unused.
2010-12-15 Tristan Van Berkom <tristanvb@openismus.com> 2010-12-15 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is * gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
......
...@@ -930,50 +930,6 @@ glade_app_hide_properties (void) ...@@ -930,50 +930,6 @@ glade_app_hide_properties (void)
} }
void
glade_app_update_instance_count (GladeProject *project)
{
GladeApp *app;
GList *l;
gint temp, max = 0, i = 0, uncounted_projects = 0;
gchar *project_name;
g_return_if_fail (GLADE_IS_PROJECT (project));
if (glade_project_get_instance_count (project) > 0)
return;
project_name = glade_project_get_name (project);
app = glade_app_get ();
for (l = app->priv->projects; l; l = l->next)
{
GladeProject *prj = GLADE_PROJECT (l->data);
gchar *name = glade_project_get_name (project);
if (prj != project && !g_utf8_collate (name, project_name))
{
i++;
temp = MAX (glade_project_get_instance_count (prj) + 1, i);
max = MAX (temp, max);
if (glade_project_get_instance_count (prj) < 1)
uncounted_projects++;
}
g_free (name);
}
g_free (project_name);
/* Dont reset the initially opened project */
if (uncounted_projects > 1 || g_list_find (app->priv->projects, project) == NULL)
{
glade_project_set_instance_count (project, MAX (max, i));
}
}
void void
glade_app_add_project (GladeProject *project) glade_app_add_project (GladeProject *project)
{ {
...@@ -991,7 +947,6 @@ glade_app_add_project (GladeProject *project) ...@@ -991,7 +947,6 @@ glade_app_add_project (GladeProject *project)
glade_app_set_project (project); glade_app_set_project (project);
return; return;
} }
glade_app_update_instance_count (project);
/* Take a reference for GladeApp here... */ /* Take a reference for GladeApp here... */
app->priv->projects = g_list_append (app->priv->projects, app->priv->projects = g_list_append (app->priv->projects,
......
...@@ -166,9 +166,6 @@ void glade_app_set_accel_group (GtkAccelGroup *accel_group); ...@@ -166,9 +166,6 @@ void glade_app_set_accel_group (GtkAccelGroup *accel_group);
GtkAccelGroup *glade_app_get_accel_group (void); GtkAccelGroup *glade_app_get_accel_group (void);
void glade_app_update_instance_count (GladeProject *project);
GtkWidget *glade_app_undo_button_new (void); GtkWidget *glade_app_undo_button_new (void);
GtkWidget *glade_app_redo_button_new (void); GtkWidget *glade_app_redo_button_new (void);
......
...@@ -82,8 +82,6 @@ struct _GladeProjectPrivate ...@@ -82,8 +82,6 @@ struct _GladeProjectPrivate
{ {
gchar *path; /* The full canonical path of the glade file for this project */ gchar *path; /* The full canonical path of the glade file for this project */
guint instance_count; /* How many projects with this name */
gint unsaved_number; /* A unique number for this project if it is untitled */ gint unsaved_number; /* A unique number for this project if it is untitled */
gboolean readonly; /* A flag that is set if the project is readonly */ gboolean readonly; /* A flag that is set if the project is readonly */
...@@ -647,7 +645,6 @@ glade_project_init (GladeProject *project) ...@@ -647,7 +645,6 @@ glade_project_init (GladeProject *project)
G_TYPE_INSTANCE_GET_PRIVATE ((project), GLADE_TYPE_PROJECT, GladeProjectPrivate); G_TYPE_INSTANCE_GET_PRIVATE ((project), GLADE_TYPE_PROJECT, GladeProjectPrivate);
priv->path = NULL; priv->path = NULL;
priv->instance_count = 0;
priv->readonly = FALSE; priv->readonly = FALSE;
priv->tree = NULL; priv->tree = NULL;
priv->toplevels = NULL; priv->toplevels = NULL;
...@@ -3759,22 +3756,6 @@ glade_project_get_objects (GladeProject *project) ...@@ -3759,22 +3756,6 @@ glade_project_get_objects (GladeProject *project)
return project->priv->objects; return project->priv->objects;
} }
guint
glade_project_get_instance_count (GladeProject *project)
{
g_return_val_if_fail (GLADE_IS_PROJECT (project), 0);
return project->priv->instance_count;
}
void
glade_project_set_instance_count (GladeProject *project, guint instance_count)
{
g_return_if_fail (GLADE_IS_PROJECT (project));
project->priv->instance_count = instance_count;
}
/** /**
* glade_project_get_modified: * glade_project_get_modified:
* @project: a #GladeProject * @project: a #GladeProject
......
...@@ -181,10 +181,6 @@ gchar *glade_project_resource_fullpath (GladeProject *project, ...@@ -181,10 +181,6 @@ gchar *glade_project_resource_fullpath (GladeProject *project,
gboolean glade_project_is_loading (GladeProject *project); gboolean glade_project_is_loading (GladeProject *project);
time_t glade_project_get_file_mtime (GladeProject *project); time_t glade_project_get_file_mtime (GladeProject *project);
guint glade_project_get_instance_count (GladeProject *project);
void glade_project_set_instance_count (GladeProject *project, guint instance_count);
gboolean glade_project_get_modified (GladeProject *project); gboolean glade_project_get_modified (GladeProject *project);
......
...@@ -1188,8 +1188,6 @@ save (GladeWindow *window, GladeProject *project, const gchar *path) ...@@ -1188,8 +1188,6 @@ save (GladeWindow *window, GladeProject *project, const gchar *path)
return; return;
} }
glade_app_update_instance_count (project);
/* Get display_name here, it could have changed with "Save As..." */ /* Get display_name here, it could have changed with "Save As..." */
display_name = glade_project_get_name (project); display_name = glade_project_get_name (project);
......
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