diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-10-30 05:38:41 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-10-30 05:38:41 +0800 |
commit | bc541864b12e85185251765c99a103718b92b994 (patch) | |
tree | 698d93b981692c29cfad5f113e0795ad6fca01b4 /src/prefs-dialog.c | |
parent | cd07b3ec041e14b8ed23d0457cc8741eaaa1a00d (diff) | |
download | gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar.gz gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar.bz2 gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar.lz gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar.xz gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.tar.zst gsoc2013-epiphany-bc541864b12e85185251765c99a103718b92b994.zip |
Add ephy_file_get_downloads_dir() to get the actual downloads directory,
2005-10-29 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/MozDownload.cpp:
* lib/ephy-file-chooser.c: (ephy_file_chooser_constructor):
* lib/ephy-file-helpers.c: (ephy_file_get_downloads_dir):
* lib/ephy-file-helpers.h:
* src/prefs-dialog.c: (download_path_changed_cb),
(create_download_path_button):
Add ephy_file_get_downloads_dir() to get the actual downloads
directory, and use it in the prefs dialogue, the filechooser, and
the backend.
Diffstat (limited to 'src/prefs-dialog.c')
-rw-r--r-- | src/prefs-dialog.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 2b8d00bd1..60f965d78 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -1117,17 +1117,34 @@ create_language_section (EphyDialog *dialog) static void download_path_changed_cb (GtkFileChooser *button) { - char *dir; + char *dir, *downloads_dir, *desktop_dir; /* FIXME: use _uri variant when we support downloading * to gnome-vfs remote locations */ dir = gtk_file_chooser_get_filename (button); - if (dir != NULL) + if (dir == NULL) return; + + downloads_dir = ephy_file_downloads_dir (); + desktop_dir = ephy_file_desktop_dir (); + g_return_if_fail (downloads_dir != NULL && desktop_dir != NULL); + + if (strcmp (dir, downloads_dir) == 0) + { + eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, "Downloads"); + } + else if (strcmp (dir, desktop_dir) == 0) + { + eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, "Desktop"); + } + else { eel_gconf_set_path (CONF_STATE_DOWNLOAD_DIR, dir); - g_free (dir); } + + g_free (dir); + g_free (downloads_dir); + g_free (desktop_dir); } static void @@ -1137,7 +1154,7 @@ create_download_path_button (EphyDialog *dialog) EphyFileChooser *fc; char *dir; - dir = ephy_file_downloads_dir (); + dir = ephy_file_get_downloads_dir (); ephy_dialog_get_controls (dialog, properties[DOWNLOAD_PATH_HBOX_PROP].id, &hbox, |