aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-12 20:45:27 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-12 20:45:27 +0800
commitc57f6e063efe334033061088263d246868477c88 (patch)
tree05929effef160a5aaa9f500dfd9969d28c8f35c6
parent2d9cbe355d22570bbc32d2cde0d7942adab355e0 (diff)
downloadgsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar.gz
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar.bz2
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar.lz
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar.xz
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.tar.zst
gsoc2013-empathy-c57f6e063efe334033061088263d246868477c88.zip
Set XDG_DOWNLOAD_DIR as default directory when receiving a file (#612672)
-rw-r--r--libempathy-gtk/empathy-ui-utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 807b6afaf..4b0f4a404 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1669,6 +1669,7 @@ void
empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
{
GtkWidget *widget;
+ const gchar *dir;
widget = gtk_file_chooser_dialog_new (_("Select a destination"),
NULL,
@@ -1683,6 +1684,13 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
gtk_file_chooser_set_do_overwrite_confirmation
(GTK_FILE_CHOOSER (widget), TRUE);
+ dir = g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD);
+ if (dir == NULL)
+ /* Fallback to $HOME if $XDG_DOWNLOAD_DIR is not set */
+ dir = g_get_home_dir ();
+
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), dir);
+
g_signal_connect (widget, "response",
G_CALLBACK (file_manager_receive_file_response_cb), handler);