aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-22 03:33:45 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-22 03:33:45 +0800
commit5d4d9eba1c241a12304d74d3c2bea7e80a853cd6 (patch)
treed7ed4d121b1847ac187ee93148b7911dadb87dd5
parent339ba24998303dd302e0223fb0ccd67cd684ce79 (diff)
downloadgsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar.gz
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar.bz2
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar.lz
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar.xz
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.tar.zst
gsoc2013-epiphany-5d4d9eba1c241a12304d74d3c2bea7e80a853cd6.zip
Dont create duped actions, fix crash on exit
2003-02-21 Marco Pesenti Gritti <marco@it.gnome.org> * src/toolbar.c: (get_bookmark_action), (toolbar_get_action): Dont create duped actions, fix crash on exit
-rw-r--r--ChangeLog6
-rwxr-xr-xsrc/toolbar.c37
2 files changed, 24 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index bace23913..af8456d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-21 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * src/toolbar.c: (get_bookmark_action), (toolbar_get_action):
+
+ Dont create duped actions, fix crash on exit
+
2003-02-21 Takayuki KUSANO <AE5T-KSN@asahi-net.or.jp>
* configure.in: added ja.po to ALL_LINGUAS
diff --git a/src/toolbar.c b/src/toolbar.c
index eecac5c11..7eb0ee1ad 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -113,14 +113,12 @@ go_location_cb (EggAction *action, char *location, EphyWindow *window)
}
static EggAction *
-get_bookmark_action (Toolbar *t, EphyBookmarks *bookmarks, gulong id)
+get_bookmark_action (Toolbar *t, EphyBookmarks *bookmarks, gulong id, const char *action_name)
{
- char action_name[255];
EggAction *action;
LOG ("Creating action for bookmark id %ld", id)
- snprintf (action_name, 255, "GoBookmarkId%ld", id);
action = ephy_bookmark_action_new (action_name, id);
g_signal_connect (action, "go_location",
@@ -140,6 +138,7 @@ toolbar_get_action (EphyEditableToolbar *etoolbar,
EggAction *action = NULL;
EphyBookmarks *bookmarks;
gulong id = 0;
+ char action_name[255];
bookmarks = ephy_shell_get_bookmarks (ephy_shell);
@@ -172,32 +171,32 @@ toolbar_get_action (EphyEditableToolbar *etoolbar,
gtk_widget_destroy (new_bookmark);
}
- if (id != 0)
- {
- action = get_bookmark_action (t, bookmarks, id);
- }
- else
- {
- action = NULL;
- }
-
g_list_foreach (uris, (GFunc)g_free, NULL);
g_list_free (uris);
}
-
- if (action == NULL)
+ else if (g_str_has_prefix (name, "GoBookmarkId"))
{
- action = EPHY_EDITABLE_TOOLBAR_CLASS
- (parent_class)->get_action (etoolbar, type, name);
+ if (!ephy_str_to_int (name + strlen ("GoBookmarkId"), &id))
+ {
+ id = 0;
+ }
}
- if (action == NULL && g_str_has_prefix (name, "GoBookmarkId"))
+ if (id != 0)
{
- if (ephy_str_to_int (name + strlen ("GoBookmarkId"), &id))
+ snprintf (action_name, 255, "GoBookmarkId%ld", id);
+ action = EPHY_EDITABLE_TOOLBAR_CLASS
+ (parent_class)->get_action (etoolbar, NULL, action_name);
+ if (action == NULL)
{
- action = get_bookmark_action (t, bookmarks, id);
+ action = get_bookmark_action (t, bookmarks, id, action_name);
}
}
+ else
+ {
+ action = EPHY_EDITABLE_TOOLBAR_CLASS
+ (parent_class)->get_action (etoolbar, type, name);
+ }
return action;
}