glade3 r1820 - in trunk: . gladeui
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r1820 - in trunk: . gladeui
- Date: Sun, 11 May 2008 18:50:16 +0100 (BST)
Author: tvb
Date: Sun May 11 17:50:16 2008
New Revision: 1820
URL: http://svn.gnome.org/viewvc/glade3?rev=1820&view=rev
Log:
* gladeui/glade-property.c: Applied patch from Pavel Kostyuchenko to fix project
modified state flag glitches (bug 532017).
Modified:
trunk/ChangeLog
trunk/gladeui/glade-project.c
trunk/gladeui/glade-widget.c
Modified: trunk/gladeui/glade-project.c
==============================================================================
--- trunk/gladeui/glade-project.c (original)
+++ trunk/gladeui/glade-project.c Sun May 11 17:50:16 2008
@@ -107,7 +107,9 @@
GHashTable *widget_names_allocator; /* hash table with the used widget names */
GHashTable *widget_old_names; /* widget -> old name of the widget */
- GladeCommand *first_modification; /* we record the first modification, so that we
+ gboolean first_modification_is_na; /* the flag indicates that the first_modification item has been lost */
+
+ GList *first_modification; /* we record the first modification, so that we
* can set "modification" to FALSE when we
* undo this modification
*/
@@ -283,8 +285,7 @@
*/
static void
glade_project_set_modified (GladeProject *project,
- gboolean modified,
- GladeCommand *modification)
+ gboolean modified)
{
GladeProjectPrivate *priv = project->priv;
@@ -292,16 +293,10 @@
{
priv->modified = !priv->modified;
- if (priv->modified)
- {
- g_assert (priv->first_modification == NULL);
- g_assert (modification != NULL);
- priv->first_modification = modification;
- }
- else
+ if (!priv->modified)
{
- g_assert (priv->first_modification != NULL);
- priv->first_modification = NULL;
+ priv->first_modification = project->priv->prev_redo_item;
+ priv->first_modification_is_na = FALSE;
}
g_object_notify (G_OBJECT (project), "modified");
@@ -422,9 +417,8 @@
{
g_assert (tmp_redo_item->data);
- /* just for safety, we might not need this */
- if (GLADE_COMMAND (tmp_redo_item->data) == priv->first_modification)
- priv->first_modification = NULL;
+ if (tmp_redo_item == priv->first_modification)
+ priv->first_modification_is_na = TRUE;
g_object_unref (G_OBJECT (tmp_redo_item->data));
@@ -466,10 +460,10 @@
/* if this command is the first modification to cause the project
* to have unsaved changes, then we can now flag the project as unmodified
*/
- if (command == project->priv->first_modification)
- glade_project_set_modified (project, FALSE, NULL);
+ if (!project->priv->first_modification_is_na && project->priv->prev_redo_item == project->priv->first_modification)
+ glade_project_set_modified (project, FALSE);
else
- glade_project_set_modified (project, TRUE, command);
+ glade_project_set_modified (project, TRUE);
}
glade_app_update_ui ();
}
@@ -706,6 +700,7 @@
priv->undo_stack = NULL;
priv->prev_redo_item = NULL;
priv->first_modification = NULL;
+ priv->first_modification_is_na = FALSE;
priv->widget_names_allocator = g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -2612,7 +2607,7 @@
project->priv->mtime = glade_util_get_file_mtime (project->priv->path, NULL);
- glade_project_set_modified (project, FALSE, NULL);
+ glade_project_set_modified (project, FALSE);
if (project->priv->unsaved_number > 0)
{
Modified: trunk/gladeui/glade-widget.c
==============================================================================
--- trunk/gladeui/glade-widget.c (original)
+++ trunk/gladeui/glade-widget.c Sun May 11 17:50:16 2008
@@ -1868,7 +1868,8 @@
if (GTK_WIDGET_REALIZED (layout))
glade_widget_add_to_layout (widget, layout);
else
- g_signal_connect_data (layout, "map", (GCallback) glade_widget_add_to_layout,
+ g_signal_connect_data (G_OBJECT (layout), "map",
+ G_CALLBACK (glade_widget_add_to_layout),
widget, NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
} else if (GTK_IS_WIDGET (widget->object))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]