aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-29 17:23:05 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-29 17:23:05 +0800
commit0677bcd3e3207bf8a0c6a0239a879818f65da15c (patch)
tree4b0013f6d2085f5c5d2c1bb58f1cca485a2b49b7 /lib
parentd588f872540c33afce1f69a006249a630c2474d2 (diff)
downloadgsoc2013-epiphany-0677bcd3e3207bf8a0c6a0239a879818f65da15c.tar.gz
gsoc2013-epiphany-0677bcd3e3207bf8a0c6a0239a879818f65da15c.tar.zst
gsoc2013-epiphany-0677bcd3e3207bf8a0c6a0239a879818f65da15c.zip
Check if there are states before saving, fix a crash closing the nautilus
2003-04-29 Marco Pesenti Gritti <marco@it.gnome.org> * lib/ephy-state.c: (ephy_states_save) Check if there are states before saving, fix a crash closing the nautilus view.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-state.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ephy-state.c b/lib/ephy-state.c
index 44d85909a..746554562 100644
--- a/lib/ephy-state.c
+++ b/lib/ephy-state.c
@@ -41,7 +41,7 @@ enum
EPHY_NODE_STATE_PROP_POSITION_Y = 7
};
-static EphyNode *states;
+static EphyNode *states = NULL;
static void
ephy_states_load (void)
@@ -83,6 +83,8 @@ ephy_states_save (void)
int i;
char *xml_file;
+ if (states == NULL) return;
+
xml_file = g_build_filename (ephy_dot_dir (),
STATES_FILE,
NULL);
@@ -191,7 +193,7 @@ ephy_state_window_set_position (GtkWidget *window, EphyNode *node)
if ((x >= screen_width) || (y >= screen_height))
{
x = y = WINDOW_POSITION_UNSET;
- }
+ }
/* If the window has a saved position set it, otherwise let the WM do it */
if ((x != WINDOW_POSITION_UNSET) && (y != WINDOW_POSITION_UNSET))
@@ -323,13 +325,13 @@ ephy_state_add_window (GtkWidget *window,
/* Metacity and presumably any other sane wm won't let
* you drag the titlebar of a window off the screen, so
* we set the inital cordinate to an impossible value (-1,-1)
- */
+ */
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, WINDOW_POSITION_UNSET);
ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_X,
&value);
g_value_unset (&value);
-
+
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, WINDOW_POSITION_UNSET);
ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_Y,