[glade3/glade-3-8] * gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion of proj
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion of proj
- Date: Thu, 16 Dec 2010 19:38:41 +0000 (UTC)
commit ffb7166ef644d21bdd1cfe5f7f1d33fe19c64c9a
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Dec 17 04:44:23 2010 +0900
* gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion
of project "instance_count" which is now unused.
ChangeLog | 3 +++
gladeui/glade-app.c | 45 ---------------------------------------------
gladeui/glade-app.h | 3 ---
gladeui/glade-project.c | 19 -------------------
gladeui/glade-project.h | 4 ----
src/glade-window.c | 2 --
6 files changed, 3 insertions(+), 73 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e08b67d..7326032 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,9 @@
* 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>
* gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c
index 070c2e3..0979b20 100644
--- a/gladeui/glade-app.c
+++ b/gladeui/glade-app.c
@@ -942,50 +942,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
glade_app_add_project (GladeProject *project)
{
GladeApp *app;
@@ -1002,7 +958,6 @@ glade_app_add_project (GladeProject *project)
glade_app_set_project (project);
return;
}
- glade_app_update_instance_count (project);
/* Take a reference for GladeApp here... */
app->priv->projects = g_list_append (app->priv->projects,
diff --git a/gladeui/glade-app.h b/gladeui/glade-app.h
index b5f2e04..620dbfa 100644
--- a/gladeui/glade-app.h
+++ b/gladeui/glade-app.h
@@ -166,9 +166,6 @@ void glade_app_set_accel_group (GtkAccelGroup *accel_group);
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_redo_button_new (void);
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index b3416a3..9f4e949 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -82,8 +82,6 @@ struct _GladeProjectPrivate
{
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 */
gboolean readonly; /* A flag that is set if the project is readonly */
@@ -647,7 +645,6 @@ glade_project_init (GladeProject *project)
G_TYPE_INSTANCE_GET_PRIVATE ((project), GLADE_TYPE_PROJECT, GladeProjectPrivate);
priv->path = NULL;
- priv->instance_count = 0;
priv->readonly = FALSE;
priv->tree = NULL;
priv->toplevels = NULL;
@@ -3759,22 +3756,6 @@ glade_project_get_objects (GladeProject *project)
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:
* @project: a #GladeProject
diff --git a/gladeui/glade-project.h b/gladeui/glade-project.h
index b8cf55b..c73a798 100644
--- a/gladeui/glade-project.h
+++ b/gladeui/glade-project.h
@@ -181,10 +181,6 @@ gchar *glade_project_resource_fullpath (GladeProject *project,
gboolean glade_project_is_loading (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);
diff --git a/src/glade-window.c b/src/glade-window.c
index 2ddfdbc..4031f85 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -1188,8 +1188,6 @@ save (GladeWindow *window, GladeProject *project, const gchar *path)
return;
}
- glade_app_update_instance_count (project);
-
/* Get display_name here, it could have changed with "Save As..." */
display_name = glade_project_get_name (project);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]