# HG changeset patch # User Mark Doliner # Date 1162772070 0 # Node ID dff16b654f146c153001f1173418ebb147f9a544 # Parent 0512fddbaaf2aca9f6724ac2880c92422a242eb9 [gaim-migrate @ 17677] sf patch #1588433, from Ka-Hing Cheung "prompt again if non-writable dir selected for FT" committer: Tailor Script diff -r 0512fddbaaf2 -r dff16b654f14 libgaim/ft.c --- a/libgaim/ft.c Mon Nov 06 00:08:00 2006 +0000 +++ b/libgaim/ft.c Mon Nov 06 00:14:30 2006 +0000 @@ -33,6 +33,8 @@ static GaimXferUiOps *xfer_ui_ops = NULL; +static int gaim_xfer_choose_file(GaimXfer *xfer); + GaimXfer * gaim_xfer_new(GaimAccount *account, GaimXferType type, const char *who) { @@ -210,13 +212,26 @@ { GaimXfer *xfer; struct stat st; + gchar *dir; xfer = (GaimXfer *)user_data; if (g_stat(filename, &st) != 0) { /* File not found. */ if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) { - gaim_xfer_request_accepted(xfer, filename); + dir = g_path_get_dirname(filename); + + if (g_access(dir, W_OK) == 0) { + gaim_xfer_request_accepted(xfer, filename); + } else { + gaim_xfer_ref(xfer); + gaim_notify_message( + NULL, GAIM_NOTIFY_MSG_ERROR, NULL, + _("Directory is not writable."), NULL, + (GaimNotifyCloseCallback)gaim_xfer_choose_file, xfer); + } + + g_free(dir); } else { gaim_xfer_show_file_error(xfer, filename);