comparison src/ft.c @ 13598:41e40b323dc3

[gaim-migrate @ 15984] Previously our file transfer dialog showed "time elapsed" as the current time minus the time when the transfer was added to the ft dialog. When sending a file, the transfer is added when you offer the file to the remote user, not when the transfer actually starts. This meant the "time elapsed" was longer than it should have been, which threw off the transfer rate. This should fix that. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 09 Apr 2006 17:38:38 +0000
parents 893ef02b6e28
children 4b6308145fcd
comparison
equal deleted inserted replaced
13597:4d8927a4f1ef 13598:41e40b323dc3
907 return; 907 return;
908 } 908 }
909 909
910 xfer->watcher = gaim_input_add(xfer->fd, cond, transfer_cb, xfer); 910 xfer->watcher = gaim_input_add(xfer->fd, cond, transfer_cb, xfer);
911 911
912 xfer->start_time = time(NULL);
913
912 if (xfer->ops.start != NULL) 914 if (xfer->ops.start != NULL)
913 xfer->ops.start(xfer); 915 xfer->ops.start(xfer);
914 } 916 }
915 917
916 static void 918 static void
975 if (!gaim_xfer_is_completed(xfer)) { 977 if (!gaim_xfer_is_completed(xfer)) {
976 gaim_xfer_cancel_local(xfer); 978 gaim_xfer_cancel_local(xfer);
977 return; 979 return;
978 } 980 }
979 981
982 xfer->end_time = time(NULL);
980 if (xfer->ops.end != NULL) 983 if (xfer->ops.end != NULL)
981 xfer->ops.end(xfer); 984 xfer->ops.end(xfer);
982 985
983 if (xfer->watcher != 0) { 986 if (xfer->watcher != 0) {
984 gaim_input_remove(xfer->watcher); 987 gaim_input_remove(xfer->watcher);
1016 char *msg = NULL; 1019 char *msg = NULL;
1017 1020
1018 g_return_if_fail(xfer != NULL); 1021 g_return_if_fail(xfer != NULL);
1019 1022
1020 gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_LOCAL); 1023 gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_LOCAL);
1024 xfer->end_time = time(NULL);
1021 1025
1022 if (gaim_xfer_get_filename(xfer) != NULL) 1026 if (gaim_xfer_get_filename(xfer) != NULL)
1023 { 1027 {
1024 msg = g_strdup_printf(_("You canceled the transfer of %s"), 1028 msg = g_strdup_printf(_("You canceled the transfer of %s"),
1025 gaim_xfer_get_filename(xfer)); 1029 gaim_xfer_get_filename(xfer));
1075 1079
1076 g_return_if_fail(xfer != NULL); 1080 g_return_if_fail(xfer != NULL);
1077 1081
1078 gaim_request_close_with_handle(xfer); 1082 gaim_request_close_with_handle(xfer);
1079 gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_REMOTE); 1083 gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_REMOTE);
1084 xfer->end_time = time(NULL);
1080 1085
1081 account = gaim_xfer_get_account(xfer); 1086 account = gaim_xfer_get_account(xfer);
1082 buddy = gaim_find_buddy(account, xfer->who); 1087 buddy = gaim_find_buddy(account, xfer->who);
1083 1088
1084 if (gaim_xfer_get_filename(xfer) != NULL) 1089 if (gaim_xfer_get_filename(xfer) != NULL)