aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-commands.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-08-02 03:28:53 +0800
committerChristian Persch <chpe@src.gnome.org>2005-08-02 03:28:53 +0800
commitefdde3ff63b9f0c3c3ff8c418c451be494360601 (patch)
tree6a6c07b01fc1066c12edebee0a2047777412a5cb /src/window-commands.c
parentdd0039f8b586bee1e77bddc23bc4c67107f3c14c (diff)
downloadgsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar.gz
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar.bz2
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar.lz
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar.xz
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.tar.zst
gsoc2013-epiphany-efdde3ff63b9f0c3c3ff8c418c451be494360601.zip
Now that the tab's address is always correct (isn't the typed address
2005-08-01 Christian Persch <chpe@cvs.gnome.org> * src/ephy-location-action.c: (get_location_cb): * src/ephy-session.c: (write_tab): * src/ephy-tab.c: * src/ephy-window.c: (modal_alert_cb): * src/prefs-dialog.c: (set_homepage_entry), (prefs_homepage_current_button_clicked_cb): * src/window-commands.c: (window_cmd_file_send_to), (window_cmd_file_bookmark_page), (window_cmd_view_page_source): Now that the tab's address is always correct (isn't the typed address anymore), always use ephy_tab_get_address instead of ephy_embed_get_location, since the former also gets the right address when the page loading but still blank. Should fix bug #147840.
Diffstat (limited to 'src/window-commands.c')
-rw-r--r--src/window-commands.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/window-commands.c b/src/window-commands.c
index 5f012e0a8..ba490736d 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -129,10 +129,8 @@ window_cmd_file_send_to (GtkAction *action,
{
EphyTab *tab;
EphyEmbed *embed;
- char *url;
- char *embed_location;
- char *location;
- char *title;
+ const char *address;
+ char *url, *location, *title;
tab = ephy_window_get_active_tab (window);
g_return_if_fail (tab != NULL);
@@ -140,9 +138,8 @@ window_cmd_file_send_to (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- embed_location = ephy_embed_get_location (embed, TRUE);
- location = gnome_vfs_escape_string (embed_location);
- g_free (embed_location);
+ address = ephy_tab_get_address (tab);
+ location = gnome_vfs_escape_string (address);
title = ephy_embed_get_title (embed);
if (title != NULL)
@@ -291,9 +288,8 @@ window_cmd_file_bookmark_page (GtkAction *action,
EphyEmbed *embed;
EphyBookmarks *bookmarks;
GtkWidget *new_bookmark;
- char *location;
- const char *icon;
- char *title = NULL;
+ const char *location, *icon;
+ char *title;
tab = ephy_window_get_active_tab (window);
g_return_if_fail (tab != NULL);
@@ -301,7 +297,7 @@ window_cmd_file_bookmark_page (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- location = ephy_embed_get_location (embed, TRUE);
+ location = ephy_tab_get_address (tab);
title = ephy_embed_get_title (embed);
if (title == NULL)
@@ -325,7 +321,6 @@ window_cmd_file_bookmark_page (GtkAction *action,
}
g_free (title);
- g_free (location);
}
static void
@@ -676,19 +671,21 @@ void
window_cmd_view_page_source (GtkAction *action,
EphyWindow *window)
{
+ EphyTab *tab;
EphyEmbed *embed;
- char *address;
- char *scheme;
+ const char *address;
guint32 user_time;
+ tab = ephy_window_get_active_tab (window);
+ g_return_if_fail (tab != NULL);
+
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- address = ephy_embed_get_location (embed, TRUE);
- scheme = gnome_vfs_get_uri_scheme (address);
+ address = ephy_tab_get_address (tab);
user_time = gtk_get_current_event_time ();
- if (strcmp (scheme, "file") == 0)
+ if (g_str_has_prefix (address, "file://"))
{
ephy_file_launch_handler ("text/plain", address, user_time);
}
@@ -696,9 +693,6 @@ window_cmd_view_page_source (GtkAction *action,
{
save_temp_source (embed, user_time);
}
-
- g_free (scheme);
- g_free (address);
}
void