diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-02-13 03:13:54 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-02-13 03:13:54 +0800 |
commit | 4c401b884b4e4529e470346dd9d0e834661b3823 (patch) | |
tree | b2d9cf9be755c67c29d2fed9e4d4d40d6c3a3975 /src | |
parent | 11559ecfcb6420b24b537d9c7b61f60ec20a8cfb (diff) | |
download | gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar.gz gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar.bz2 gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar.lz gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar.xz gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.tar.zst gsoc2013-epiphany-4c401b884b4e4529e470346dd9d0e834661b3823.zip |
Fix numerous places where we weren't properly converting between UTF-8 and
2004-02-12 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-embed-popup-control.c: (save_url),
(embed_popup_set_image_as_background_cmd):
* embed/ephy-favicon-cache.c: (ephy_favicon_cache_get_type),
(ephy_favicon_cache_class_init), (favicon_name_build),
(favicon_download_completed_cb), (ephy_favicon_cache_get):
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/MozDownload.cpp:
* lib/ephy-file-chooser.c: (ephy_file_chooser_set_persist_key):
* lib/ephy-file-helpers.c: (ephy_file_downloads_dir):
* src/popup-commands.c: (popup_cmd_set_image_as_background):
* src/prefs-dialog.c: (get_download_button_label),
(download_path_response_cb):
Fix numerous places where we weren't properly converting between UTF-8
and filename encoding.
* embed/ephy-favicon-cache.c:
Bump favicon cache xml version.
* embed/mozilla/EphyHeaderSniffer.cpp:
Fix mem leak, and use CONF_STATE_SAVE_DIR instead of the download dir
key for directory persistence.
Diffstat (limited to 'src')
-rw-r--r-- | src/popup-commands.c | 6 | ||||
-rw-r--r-- | src/prefs-dialog.c | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/popup-commands.c b/src/popup-commands.c index 8839e1935..6a2280b82 100644 --- a/src/popup-commands.c +++ b/src/popup-commands.c @@ -374,7 +374,7 @@ popup_cmd_set_image_as_background (GtkAction *action, { EphyEmbedEvent *info; const char *location; - char *dest, *base; + char *dest, *base, *base_converted; const GValue *value; EphyEmbedPersist *persist; EphyEmbed *embed; @@ -390,7 +390,8 @@ popup_cmd_set_image_as_background (GtkAction *action, (ephy_embed_factory_new_object ("EphyEmbedPersist")); base = g_path_get_basename (location); - dest = g_build_filename (ephy_dot_dir (), base, NULL); + base_converted = g_filename_from_utf8 (base, -1, NULL, NULL, NULL); + dest = g_build_filename (ephy_dot_dir (), base_converted, NULL); ephy_embed_persist_set_embed (persist, embed); ephy_embed_persist_set_dest (persist, dest); @@ -405,6 +406,7 @@ popup_cmd_set_image_as_background (GtkAction *action, g_free (dest); g_free (base); + g_free (base_converted); } void diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 762b29b46..9b0a228a4 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -1086,18 +1086,20 @@ create_language_section (EphyDialog *dialog) static char* get_download_button_label () { - char *key, *label, *downloads_path; + char *key, *label, *downloads_path, *converted_dp; key = eel_gconf_get_string (CONF_STATE_DOWNLOAD_DIR); + downloads_path = ephy_file_downloads_dir (); + converted_dp = g_filename_to_utf8 (downloads_path, -1, NULL, NULL, NULL); - /* fallback to default downloads directory */ - if (key == NULL) + if (key == NULL || + g_utf8_collate (key, converted_dp) == 0 || + g_utf8_collate (key, "Downloads") == 0) { - key = ephy_file_downloads_dir (); + label = g_strdup (_("Downloads")); } - - if (g_utf8_collate (key, "~/Desktop") == 0) + else if (g_utf8_collate (key, "~/Desktop") == 0) { label = g_strdup (_("Desktop")); } @@ -1109,17 +1111,13 @@ get_download_button_label () * filechooser */ label = g_strdup (_("Home")); } - else if (g_utf8_collate (key, downloads_path) == 0 || - g_utf8_collate (key, "Downloads") == 0) - { - label = g_strdup (_("Downloads")); - } else { label = g_strdup (key); } g_free (downloads_path); + g_free (converted_dp); g_free (key); return label; @@ -1296,7 +1294,7 @@ download_path_response_cb (GtkDialog *fc, gint response, EphyDialog *dialog) char *label; eel_gconf_set_path (CONF_STATE_DOWNLOAD_DIR, dir); - + button = ephy_dialog_get_control (dialog, properties[DOWNLOAD_PATH_BUTTON_PROP].id); label = get_download_button_label (); ephy_ellipsizing_label_set_text ((EphyEllipsizingLabel*) GTK_BIN (button)->child, |