From 05b6e0b330f423d5b163c07fffb1183abe75c3fa Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 13 Oct 2012 10:49:11 +0200 Subject: [PATCH] By default, use /downloads for DCC file transfers when in portable mode --- src/common/cfgfiles.c | 11 +++++++---- src/fe-gtk/dccgui.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index f3bb54b8..61df96c6 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -763,11 +763,14 @@ load_config (void) { char out[256]; - if (get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\" - "Explorer\\Shell Folders", "Personal", out, sizeof (out))) - snprintf (prefs.dccdir, sizeof (prefs.dccdir), "%s\\Downloads", out); + if (portable_mode () || !get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", out, sizeof (out))) + { + snprintf (prefs.dccdir, sizeof (prefs.dccdir), "%s\\downloads", get_xdir_utf8 ()); + } else - snprintf (prefs.dccdir, sizeof (prefs.dccdir), "%s\\Downloads", get_xdir_utf8 ()); + { + snprintf (prefs.dccdir, sizeof (prefs.dccdir), "%s\\Downloads", out); + } } #else snprintf (prefs.sounddir, sizeof (prefs.sounddir), "%s/sounds", get_xdir_utf8 ()); diff --git a/src/fe-gtk/dccgui.c b/src/fe-gtk/dccgui.c index 6019b3b2..c003d1ab 100644 --- a/src/fe-gtk/dccgui.c +++ b/src/fe-gtk/dccgui.c @@ -165,7 +165,7 @@ fe_dcc_send_filereq (struct session *sess, char *nick, int maxcps, int passive) mdc->passive = passive; snprintf (tbuf, sizeof tbuf, _("Send file to %s"), nick); - gtkutil_file_req (tbuf, dcc_send_filereq_file, mdc, NULL, NULL, FRF_MULTIPLE); + gtkutil_file_req (tbuf, dcc_send_filereq_file, mdc, prefs.dccdir, NULL, FRF_MULTIPLE|FRF_FILTERISINITIAL); } static void