aboutsummaryrefslogtreecommitdiffstats
path: root/src/prefs-dialog.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-01-19 22:06:41 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-01-19 22:06:41 +0800
commitdd0b02c40b5d202794d03299f2d190833b63bb22 (patch)
tree4e8dc109ed36ca01584e1a7d39d5649cc6adbd6e /src/prefs-dialog.c
parenteaba78e8dfd1cdad90bed57cc536cbfe40a9509e (diff)
downloadgsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar.gz
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar.bz2
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar.lz
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar.xz
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.tar.zst
gsoc2013-epiphany-dd0b02c40b5d202794d03299f2d190833b63bb22.zip
Add a way to store paths.
2004-01-19 Marco Pesenti Gritti <marco@gnome.org> * lib/eel-gconf-extensions.c: (tilde_compress), (eel_gconf_set_path): * lib/eel-gconf-extensions.h: Add a way to store paths. * embed/mozilla/ContentHandler.cpp: * embed/mozilla/ContentHandler.h: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: Actually save the file in downloads dir and then open it. It doesnt seem to open it but it's prolly a gnome-vfs bug. * src/prefs-dialog.c: (get_download_button_label), (download_path_response_cb): Simplify the label logic using ~.
Diffstat (limited to 'src/prefs-dialog.c')
-rw-r--r--src/prefs-dialog.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index c58515dee..be3bf71b4 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1080,24 +1080,16 @@ create_language_section (EphyDialog *dialog)
static char*
get_download_button_label ()
{
- char *label, *key, *desktop_path, *home_path, *tmp;
- char *downloads_path;
+ char *key, *label;
key = eel_gconf_get_string (CONF_STATE_DOWNLOAD_DIR);
- tmp = g_build_filename (g_get_home_dir (), "Desktop", NULL);
- desktop_path = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL);
- home_path = g_filename_to_utf8 (g_get_home_dir (), -1, NULL, NULL, NULL);
- g_free (tmp);
-
- downloads_path = g_build_filename (g_get_home_dir (), "Downloads", NULL);
-
- if (g_utf8_collate (key, desktop_path) == 0)
+ if (g_utf8_collate (key, "~/Desktop") == 0)
{
g_free (key);
label = g_strdup (_("Desktop"));
}
- else if (g_utf8_collate (key, home_path) == 0)
+ else if (g_utf8_collate (key, "~") == 0)
{
g_free (key);
/* Note that this does NOT refer to the home page but to a
@@ -1106,7 +1098,7 @@ get_download_button_label ()
* filechooser */
label = g_strdup (_("Home"));
}
- else if (g_utf8_collate (key, downloads_path) == 0)
+ else if (g_utf8_collate (key, "~/Downloads") == 0)
{
g_free (key);
label = g_strdup (_("Downloads"));
@@ -1116,8 +1108,6 @@ get_download_button_label ()
label = key;
}
- g_free (desktop_path);
- g_free (home_path);
return label;
}
@@ -1288,17 +1278,15 @@ download_path_response_cb (GtkDialog *fc, gint response, EphyDialog *dialog)
if (dir != NULL)
{
GtkWidget *button;
- char *label, *converted;
+ char *label;
- converted = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL);
- eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, converted);
+ 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,
label);
- g_free (converted);
g_free (dir);
g_free (label);
}