--- a/ChangeLog.API Sat Dec 21 20:14:34 2019 -0500
+++ b/ChangeLog.API Sat Dec 21 20:44:34 2019 -0500
@@ -473,6 +473,7 @@
* purple_util_get_image_checksum. Use
g_compute_checksum_for_data(G_CHECKSUM_SHA1, ...), instead.
+ * purple_xfer_update_progress * PurpleCertificateVerificationStatus.PURPLE_CERTIFICATE_INVALID
* PurpleConnectionUiOps.report_disconnect_reason
* PurplePluginProtocolInfo.add_buddy_with_invite
@@ -483,6 +484,8 @@
* PurpleXferUiOps.ui_read. Use PurpleXfer::read-local instead.
* PurpleXferUiOps.ui_write. Use PurpleXfer::write-local instead.
+ * PurpleXferUiOps.update_progress. Use notify::progress on + #PurpleXfer objects instead. * struct _PurpleAttentionType
--- a/finch/gntxfer.c Sat Dec 21 20:14:34 2019 -0500
+++ b/finch/gntxfer.c Sat Dec 21 20:44:34 2019 -0500
@@ -488,6 +488,15 @@
+finch_xfer_progress_notify(PurpleXfer *xfer, G_GNUC_UNUSED GParamSpec *pspec, + G_GNUC_UNUSED gpointer data) + finch_xfer_dialog_update_xfer(xfer); finch_xfer_add_xfer(PurpleXfer *xfer)
@@ -495,13 +504,9 @@
finch_xfer_dialog_add_xfer(xfer);
gnt_tree_set_selected(GNT_TREE(xfer_dialog->tree), xfer);
-finch_xfer_update_progress(PurpleXfer *xfer, double percent)
- finch_xfer_dialog_update_xfer(xfer);
+ g_signal_connect(xfer, "notify::progress", + G_CALLBACK(finch_xfer_progress_notify), NULL); @@ -523,7 +528,6 @@
- finch_xfer_update_progress,
finch_xfer_cancel_remote,
--- a/libpurple/protocols/jabber/oob.c Sat Dec 21 20:14:34 2019 -0500
+++ b/libpurple/protocols/jabber/oob.c Sat Dec 21 20:44:34 2019 -0500
@@ -87,7 +87,6 @@
total = soup_message_headers_get_content_length(msg->response_headers);
purple_xfer_set_size(xfer, total);
- purple_xfer_update_progress(xfer);
--- a/libpurple/protocols/sametime/sametime.c Sat Dec 21 20:14:34 2019 -0500
+++ b/libpurple/protocols/sametime/sametime.c Sat Dec 21 20:44:34 2019 -0500
@@ -2174,8 +2174,6 @@
filesize = purple_xfer_get_size(xfer);
- purple_xfer_update_progress(xfer);
/* test that we can actually send the file */
fp = g_fopen(filename, "rb");
@@ -2277,7 +2275,6 @@
/* calculate progress and display it */
purple_xfer_set_bytes_sent(xfer, purple_xfer_get_bytes_sent(xfer) + o.len);
- purple_xfer_update_progress(xfer);
mwFileTransfer_send(ft, &o);
@@ -2371,7 +2368,6 @@
/* update the progress */
purple_xfer_set_bytes_sent(xfer, purple_xfer_get_bytes_sent(xfer) + data->len);
- purple_xfer_update_progress(xfer);
/* let the other side know we got it, and to send some more */
--- a/libpurple/protocols/silc/ft.c Sat Dec 21 20:14:34 2019 -0500
+++ b/libpurple/protocols/silc/ft.c Sat Dec 21 20:44:34 2019 -0500
@@ -89,7 +89,6 @@
"during file transfer"), _("Remote disconnected"),
purple_request_cpar_from_connection(gc));
purple_xfer_set_status(xfer->xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE);
- purple_xfer_update_progress(xfer->xfer);
silc_client_file_close(client, conn, session_id);
@@ -131,7 +130,6 @@
purple_request_cpar_from_connection(gc));
purple_xfer_set_status(xfer->xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE);
- purple_xfer_update_progress(xfer->xfer);
silc_client_file_close(client, conn, session_id);
@@ -142,7 +140,6 @@
if (offset && filesize) {
purple_xfer_set_bytes_sent(xfer->xfer, offset);
- purple_xfer_update_progress(xfer->xfer);
if (status == SILC_CLIENT_FILE_MONITOR_SEND ||
status == SILC_CLIENT_FILE_MONITOR_RECEIVE) {
--- a/libpurple/xfer.c Sat Dec 21 20:14:34 2019 -0500
+++ b/libpurple/xfer.c Sat Dec 21 20:44:34 2019 -0500
@@ -115,6 +115,7 @@
@@ -913,7 +914,6 @@
purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed)
PurpleXferPrivate *priv = NULL;
- PurpleXferUiOps *ui_ops;
g_return_if_fail(PURPLE_IS_XFER(xfer));
@@ -954,10 +954,7 @@
- ui_ops = purple_xfer_get_ui_ops(xfer);
- if (ui_ops != NULL && ui_ops->update_progress != NULL)
- ui_ops->update_progress(xfer, purple_xfer_get_progress(xfer));
+ g_object_notify_by_pspec(G_OBJECT(xfer), properties[PROP_PROGRESS]); @@ -1033,6 +1030,7 @@
g_object_notify_by_pspec(G_OBJECT(xfer), properties[PROP_FILE_SIZE]);
+ g_object_notify_by_pspec(G_OBJECT(xfer), properties[PROP_PROGRESS]); @@ -1059,6 +1057,7 @@
priv->bytes_sent = bytes_sent;
g_object_notify_by_pspec(G_OBJECT(xfer), properties[PROP_BYTES_SENT]);
+ g_object_notify_by_pspec(G_OBJECT(xfer), properties[PROP_PROGRESS]); @@ -1300,12 +1299,9 @@
do_transfer(PurpleXfer *xfer)
PurpleXferPrivate *priv = purple_xfer_get_instance_private(xfer);
- PurpleXferUiOps *ui_ops;
- ui_ops = purple_xfer_get_ui_ops(xfer);
if (priv->type == PURPLE_XFER_TYPE_RECEIVE) {
r = purple_xfer_read(xfer, &buffer);
@@ -1423,10 +1419,6 @@
klass->ack(xfer, buffer, r);
- if (ui_ops != NULL && ui_ops->update_progress != NULL)
- ui_ops->update_progress(xfer,
- purple_xfer_get_progress(xfer));
@@ -1882,19 +1874,6 @@
-purple_xfer_update_progress(PurpleXfer *xfer)
- PurpleXferUiOps *ui_ops;
- g_return_if_fail(PURPLE_IS_XFER(xfer));
- ui_ops = purple_xfer_get_ui_ops(xfer);
- if (ui_ops != NULL && ui_ops->update_progress != NULL) {
- ui_ops->update_progress(xfer, purple_xfer_get_progress(xfer));
purple_xfer_get_thumbnail(PurpleXfer *xfer, gsize *len)
@@ -2102,6 +2081,9 @@
g_value_set_enum(value, purple_xfer_get_status(xfer));
+ g_value_set_double(value, purple_xfer_get_progress(xfer)); g_value_set_pointer(value, purple_xfer_get_ui_data(xfer));
@@ -2279,6 +2261,11 @@
PURPLE_TYPE_XFER_STATUS, PURPLE_XFER_STATUS_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ properties[PROP_PROGRESS] = g_param_spec_double( + "progress", "Progress", + "The current progress of the file transfer.", -1.0, 1.0, -1.0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); properties[PROP_UI_DATA] = g_param_spec_pointer("ui-data", "UI Data",
"The UI specific data for this xfer",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
--- a/libpurple/xfer.h Sat Dec 21 20:14:34 2019 -0500
+++ b/libpurple/xfer.h Sat Dec 21 20:44:34 2019 -0500
@@ -101,8 +101,6 @@
* @new_xfer: UI op that's called after a new transfer is created.
* @destroy: UI op that's called when a transfer is being destroyed.
* @add_xfer: UI op that's called when a transfer should be added to the UI.
- * @update_progress: UI op that's called when a transfer's progress has been
* @cancel_local: UI op that's called when a transfer has been cancelled on the
* @cancel_remote: UI op that's called when a transfer has been cancelled on
@@ -119,7 +117,6 @@
void (*new_xfer)(PurpleXfer *xfer);
void (*destroy)(PurpleXfer *xfer);
void (*add_xfer)(PurpleXfer *xfer);
- void (*update_progress)(PurpleXfer *xfer, double percent);
void (*cancel_local)(PurpleXfer *xfer);
void (*cancel_remote)(PurpleXfer *xfer);
void (*add_thumbnail)(PurpleXfer *xfer, const gchar *formats);
@@ -683,14 +680,6 @@
void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg);
- * purple_xfer_update_progress:
- * @xfer: The file transfer.
- * Updates file transfer progress.
-void purple_xfer_update_progress(PurpleXfer *xfer);
* purple_xfer_conversation_write:
* @xfer: The file transfer to which this message relates.
* @message: The message to display.
--- a/pidgin/gtkxfer.c Sat Dec 21 20:14:34 2019 -0500
+++ b/pidgin/gtkxfer.c Sat Dec 21 20:44:34 2019 -0500
@@ -924,18 +924,22 @@
+pidgin_xfer_progress_notify(PurpleXfer *xfer, G_GNUC_UNUSED GParamSpec *pspec, + G_GNUC_UNUSED gpointer data) + pidgin_xfer_dialog_update_xfer(xfer_dialog, xfer); pidgin_xfer_add_xfer(PurpleXfer *xfer)
xfer_dialog = pidgin_xfer_dialog_new();
pidgin_xfer_dialog_add_xfer(xfer_dialog, xfer);
-pidgin_xfer_update_progress(PurpleXfer *xfer, double percent)
- pidgin_xfer_dialog_update_xfer(xfer_dialog, xfer);
+ g_signal_connect(xfer, "notify::progress", + G_CALLBACK(pidgin_xfer_progress_notify), NULL); @@ -1018,7 +1022,6 @@
- pidgin_xfer_update_progress,
pidgin_xfer_cancel_local,
pidgin_xfer_cancel_remote,
pidgin_xfer_add_thumbnail