aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--embed/ephy-embed.c51
-rw-r--r--embed/ephy-embed.h20
-rw-r--r--embed/mozilla/mozilla-embed.cpp44
-rw-r--r--src/ephy-tab.c8
-rw-r--r--src/session.c6
6 files changed, 32 insertions, 111 deletions
diff --git a/ChangeLog b/ChangeLog
index 83b900b79..b9c5d33db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2003-11-09 Marco Pesenti Gritti <marco@gnome.org>
+ * embed/ephy-embed.c: (ephy_embed_base_init):
+ * embed/ephy-embed.h:
+ * embed/mozilla/mozilla-embed.cpp:
+ * src/ephy-tab.c: (ephy_tab_init):
+
+ Do not connect and reemit same signal for nothing.
+ Remove unused/expensive progress signal.
+
+ * src/session.c: (session_save):
+
+ Unlink session file when all windows are removed.
+
+2003-11-09 Marco Pesenti Gritti <marco@gnome.org>
+
* embed/ephy-embed.h:
* idl/EphyAutomation.idl:
* src/ephy-automation.c: (impl_ephy_automation_loadurl),
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 516d6c6d6..5d124c653 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -145,27 +145,6 @@ ephy_embed_base_init (gpointer g_class)
G_TYPE_NONE,
1,
G_TYPE_STRING);
- ephy_embed_signals[TITLE] =
- g_signal_new ("ge_title",
- EPHY_TYPE_EMBED,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyEmbedClass, title),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
- ephy_embed_signals[PROGRESS] =
- g_signal_new ("ge_progress",
- EPHY_TYPE_EMBED,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyEmbedClass, progress),
- NULL, NULL,
- ephy_marshal_VOID__STRING_INT_INT,
- G_TYPE_NONE,
- 3,
- G_TYPE_STRING,
- G_TYPE_INT,
- G_TYPE_INT);
ephy_embed_signals[NET_STATE] =
g_signal_new ("ge_net_state",
EPHY_TYPE_EMBED,
@@ -177,25 +156,6 @@ ephy_embed_base_init (gpointer g_class)
2,
G_TYPE_STRING,
G_TYPE_INT);
- ephy_embed_signals[VISIBILITY] =
- g_signal_new ("ge_visibility",
- EPHY_TYPE_EMBED,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyEmbedClass, visibility),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1,
- G_TYPE_BOOLEAN);
- ephy_embed_signals[DESTROY_BRSR] =
- g_signal_new ("ge_destroy_brsr",
- EPHY_TYPE_EMBED,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyEmbedClass, destroy_brsr),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
ephy_embed_signals[OPEN_URI] =
g_signal_new ("ge_open_uri",
EPHY_TYPE_EMBED,
@@ -206,17 +166,6 @@ ephy_embed_base_init (gpointer g_class)
G_TYPE_INT,
1,
G_TYPE_STRING);
- ephy_embed_signals[SIZE_TO] =
- g_signal_new ("ge_size_to",
- EPHY_TYPE_EMBED,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EphyEmbedClass, size_to),
- NULL, NULL,
- ephy_marshal_VOID__INT_INT,
- G_TYPE_NONE,
- 2,
- G_TYPE_INT,
- G_TYPE_INT);
ephy_embed_signals[DOM_MOUSE_CLICK] =
g_signal_new ("ge_dom_mouse_click",
EPHY_TYPE_EMBED,
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index bf2486953..2ebb51d0a 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -154,7 +154,14 @@ struct EphyEmbedClass
/* Signals that we inherit from gtkmozembed
*
- * void (* net_stop) (GtkMozEmbed *embed);
+ * void (* net_stop) (GtkMozEmbed *embed);
+ * void (* title) (EphyEmbed *embed);
+ * void (* visibility) (EphyEmbed *embed,
+ * gboolean visibility);
+ * void (* destroy_brsr) (EphyEmbed *embed);
+ * void (* size_to) (EphyEmbed *embed,
+ * gint width,
+ * gint height);
*/
gint (* context_menu) (EphyEmbed *embed,
@@ -167,25 +174,14 @@ struct EphyEmbedClass
const char *status);
void (* location) (EphyEmbed *embed,
const char *location);
- void (* title) (EphyEmbed *embed);
- void (* progress) (EphyEmbed *embed,
- const char *uri,
- gint curprogress,
- gint maxprogress);
void (* net_state) (EphyEmbed *embed,
const char *uri,
EmbedState state);
void (* new_window) (EphyEmbed *embed,
EphyEmbed **new_embed,
EmbedChromeMask chromemask);
- void (* visibility) (EphyEmbed *embed,
- gboolean visibility);
- void (* destroy_brsr) (EphyEmbed *embed);
gint (* open_uri) (EphyEmbed *embed,
const char *uri);
- void (* size_to) (EphyEmbed *embed,
- gint width,
- gint height);
gint (* dom_mouse_click) (EphyEmbed *embed,
EphyEmbedEvent *event);
gint (* dom_mouse_down) (EphyEmbed *embed,
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 97aefca23..79c851d62 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -97,16 +97,11 @@ static const struct
signal_connections[] =
{
{ "location", (void *) mozilla_embed_location_changed_cb },
- { "title", (void *) mozilla_embed_title_changed_cb },
{ "net_state_all", (void *) mozilla_embed_net_state_all_cb },
- { "progress_all", (void *) mozilla_embed_progress_cb },
{ "link_message", (void *) mozilla_embed_link_message_cb },
{ "js_status", (void *) mozilla_embed_js_status_cb },
- { "visibility", (void *) mozilla_embed_visibility_cb },
- { "destroy_browser", (void *) mozilla_embed_destroy_brsr_cb },
{ "dom_mouse_click", (void *) mozilla_embed_dom_mouse_click_cb },
{ "dom_mouse_down", (void *) mozilla_embed_dom_mouse_down_cb },
- { "size_to", (void *) mozilla_embed_size_to_cb },
{ "new_window", (void *) mozilla_embed_new_window_cb },
{ "security_change", (void *) mozilla_embed_security_change_cb },
{ "dom_key_down", (void *) mozilla_embed_dom_key_down_cb },
@@ -779,15 +774,6 @@ mozilla_embed_location_changed_cb (GtkMozEmbed *embed,
}
static void
-mozilla_embed_title_changed_cb (GtkMozEmbed *embed,
- MozillaEmbed *membed)
-{
- g_return_if_fail (MOZILLA_IS_EMBED (membed));
- g_return_if_fail (GTK_IS_WIDGET (embed));
- g_signal_emit_by_name (membed, "ge_title");
-}
-
-static void
mozilla_embed_net_state_all_cb (GtkMozEmbed *embed, const char *aURI,
gint state, guint status,
MozillaEmbed *membed)
@@ -825,15 +811,6 @@ mozilla_embed_net_state_all_cb (GtkMozEmbed *embed, const char *aURI,
}
static void
-mozilla_embed_progress_cb (GtkMozEmbed *embed, const char *aURI,
- gint curprogress, gint maxprogress,
- MozillaEmbed *membed)
-{
- g_signal_emit_by_name (membed, "ge_progress", aURI,
- curprogress, maxprogress);
-}
-
-static void
mozilla_embed_link_message_cb (GtkMozEmbed *embed,
MozillaEmbed *membed)
{
@@ -857,13 +834,6 @@ mozilla_embed_js_status_cb (GtkMozEmbed *embed,
NS_ConvertUCS2toUTF8(status).get());
}
-static void
-mozilla_embed_visibility_cb (GtkMozEmbed *embed, gboolean visibility,
- MozillaEmbed *membed)
-{
- g_signal_emit_by_name (membed, "ge_visibility", visibility);
-}
-
static gint
mozilla_embed_dom_key_down_cb (GtkMozEmbed *embed, gpointer dom_event,
MozillaEmbed *membed)
@@ -927,13 +897,6 @@ mozilla_embed_dom_key_down_cb (GtkMozEmbed *embed, gpointer dom_event,
return ret;
}
-static void
-mozilla_embed_destroy_brsr_cb (GtkMozEmbed *embed,
- MozillaEmbed *membed)
-{
- g_signal_emit_by_name (membed, "ge_destroy_brsr");
-}
-
static gint
mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event,
MozillaEmbed *membed)
@@ -1030,13 +993,6 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
}
static void
-mozilla_embed_size_to_cb (GtkMozEmbed *embed, gint width, gint height,
- MozillaEmbed *membed)
-{
- g_signal_emit_by_name (membed, "ge_size_to", width, height);
-}
-
-static void
mozilla_embed_new_window_cb (GtkMozEmbed *embed,
GtkMozEmbed **newEmbed,
guint chromemask,
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 3f016a7a5..35a6a09cc 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -1104,7 +1104,7 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect (embed, "ge_location",
G_CALLBACK (ephy_tab_address_cb),
tab);
- g_signal_connect (embed, "ge_title",
+ g_signal_connect (embed, "title",
G_CALLBACK (ephy_tab_title_cb),
tab);
g_signal_connect (embed, "ge_zoom_change",
@@ -1116,16 +1116,16 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect (embed, "ge_new_window",
G_CALLBACK (ephy_tab_new_window_cb),
tab);
- g_signal_connect (embed, "ge_visibility",
+ g_signal_connect (embed, "visibility",
G_CALLBACK (ephy_tab_visibility_cb),
tab);
- g_signal_connect (embed, "ge_destroy_brsr",
+ g_signal_connect (embed, "destroy_browser",
G_CALLBACK (ephy_tab_destroy_brsr_cb),
tab);
g_signal_connect (embed, "ge_open_uri",
G_CALLBACK (ephy_tab_open_uri_cb),
tab);
- g_signal_connect (embed, "ge_size_to",
+ g_signal_connect (embed, "size_to",
G_CALLBACK (ephy_tab_size_to_cb),
tab);
g_signal_connect (embed, "ge_dom_mouse_click",
diff --git a/src/session.c b/src/session.c
index 958e804b8..9df93ca14 100644
--- a/src/session.c
+++ b/src/session.c
@@ -444,6 +444,12 @@ session_save (Session *session,
xmlDocPtr doc;
char *save_to;
+ if (session->priv->windows == NULL)
+ {
+ session_delete (session, filename);
+ return;
+ }
+
save_to = get_session_filename (filename);
doc = xmlNewDoc ("1.0");