libpurple/xfer.c

branch
soc.2013.gobjectification
changeset 35066
f997e5384f79
parent 35058
506740af931c
child 35080
58bddd91956c
child 36955
de491fc3f726
equal deleted inserted replaced
35065:2fe1b3f20c3c 35066:f997e5384f79
187 if (priv->status == status) 187 if (priv->status == status)
188 return; 188 return;
189 189
190 priv->status = status; 190 priv->status = status;
191 191
192 g_object_notify(G_OBJECT(xfer), "status");
193
192 if(priv->type == PURPLE_XFER_TYPE_SEND) { 194 if(priv->type == PURPLE_XFER_TYPE_SEND) {
193 switch(status) { 195 switch(status) {
194 case PURPLE_XFER_STATUS_ACCEPTED: 196 case PURPLE_XFER_STATUS_ACCEPTED:
195 purple_signal_emit(purple_xfers_get_handle(), "file-send-accept", xfer); 197 purple_signal_emit(purple_xfers_get_handle(), "file-send-accept", xfer);
196 break; 198 break;
604 account = purple_xfer_get_account(xfer); 606 account = purple_xfer_get_account(xfer);
605 607
606 purple_debug_misc("xfer", "request accepted for %p\n", xfer); 608 purple_debug_misc("xfer", "request accepted for %p\n", xfer);
607 609
608 if (!filename && type == PURPLE_XFER_TYPE_RECEIVE) { 610 if (!filename && type == PURPLE_XFER_TYPE_RECEIVE) {
609 priv->status = PURPLE_XFER_STATUS_ACCEPTED; 611 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_ACCEPTED);
610 priv->ops.init(xfer); 612 priv->ops.init(xfer);
611 return; 613 return;
612 } 614 }
613 615
614 buddy = purple_blist_find_buddy(account, priv->who); 616 buddy = purple_blist_find_buddy(account, priv->who);
660 purple_xfer_conversation_write(xfer, msg, FALSE); 662 purple_xfer_conversation_write(xfer, msg, FALSE);
661 g_free(msg); 663 g_free(msg);
662 } 664 }
663 else { 665 else {
664 /* Receiving a file */ 666 /* Receiving a file */
665 priv->status = PURPLE_XFER_STATUS_ACCEPTED; 667 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_ACCEPTED);
666 purple_xfer_set_local_filename(xfer, filename); 668 purple_xfer_set_local_filename(xfer, filename);
667 669
668 msg = g_strdup_printf(_("Starting transfer of %s from %s"), 670 msg = g_strdup_printf(_("Starting transfer of %s from %s"),
669 priv->filename, buddy ? purple_buddy_get_alias(buddy) : priv->who); 671 priv->filename, buddy ? purple_buddy_get_alias(buddy) : priv->who);
670 purple_xfer_conversation_write(xfer, msg, FALSE); 672 purple_xfer_conversation_write(xfer, msg, FALSE);
1044 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); 1046 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer);
1045 1047
1046 g_return_if_fail(priv != NULL); 1048 g_return_if_fail(priv != NULL);
1047 1049
1048 priv->bytes_sent = bytes_sent; 1050 priv->bytes_sent = bytes_sent;
1049 priv->bytes_remaining = purple_xfer_get_size(xfer) - bytes_sent; 1051
1052 if (purple_xfer_get_size(xfer) > 0)
1053 priv->bytes_remaining = purple_xfer_get_size(xfer) - bytes_sent;
1050 1054
1051 g_object_notify(G_OBJECT(xfer), "bytes-sent"); 1055 g_object_notify(G_OBJECT(xfer), "bytes-sent");
1052 } 1056 }
1053 1057
1054 PurpleXferUiOps * 1058 PurpleXferUiOps *
1362 /* this is so the prpl can keep the connection open 1366 /* this is so the prpl can keep the connection open
1363 if it needs to for some odd reason. */ 1367 if it needs to for some odd reason. */
1364 if (s == 0) { 1368 if (s == 0) {
1365 if (priv->watcher) { 1369 if (priv->watcher) {
1366 purple_input_remove(priv->watcher); 1370 purple_input_remove(priv->watcher);
1367 priv->watcher = 0; 1371 purple_xfer_set_watcher(xfer, 0);
1368 } 1372 }
1369 return; 1373 return;
1370 } 1374 }
1371 1375
1372 if (priv->buffer) { 1376 if (priv->buffer) {
1387 * us... It will call purple_xfer_ui_ready when ready, which 1391 * us... It will call purple_xfer_ui_ready when ready, which
1388 * sets back up this watcher. 1392 * sets back up this watcher.
1389 */ 1393 */
1390 if (priv->watcher != 0) { 1394 if (priv->watcher != 0) {
1391 purple_input_remove(priv->watcher); 1395 purple_input_remove(priv->watcher);
1392 priv->watcher = 0; 1396 purple_xfer_set_watcher(xfer, 0);
1393 } 1397 }
1394 1398
1395 /* Need to indicate the prpl is still ready... */ 1399 /* Need to indicate the prpl is still ready... */
1396 priv->ready |= PURPLE_XFER_READY_PRPL; 1400 priv->ready |= PURPLE_XFER_READY_PRPL;
1397 1401
1439 g_byte_array_remove_range(priv->buffer, 0, r); 1443 g_byte_array_remove_range(priv->buffer, 0, r);
1440 } 1444 }
1441 } 1445 }
1442 1446
1443 if (r > 0) { 1447 if (r > 0) {
1444 if (purple_xfer_get_size(xfer) > 0) 1448 purple_xfer_set_bytes_sent(xfer, priv->bytes_sent + r);
1445 priv->bytes_remaining -= r;
1446
1447 priv->bytes_sent += r;
1448 1449
1449 if (priv->ops.ack != NULL) 1450 if (priv->ops.ack != NULL)
1450 priv->ops.ack(xfer, buffer, r); 1451 priv->ops.ack(xfer, buffer, r);
1451 1452
1452 g_free(buffer); 1453 g_free(buffer);
1470 /* The UI is moderating its side manually */ 1471 /* The UI is moderating its side manually */
1471 if (0 == (priv->ready & PURPLE_XFER_READY_UI)) { 1472 if (0 == (priv->ready & PURPLE_XFER_READY_UI)) {
1472 priv->ready |= PURPLE_XFER_READY_PRPL; 1473 priv->ready |= PURPLE_XFER_READY_PRPL;
1473 1474
1474 purple_input_remove(priv->watcher); 1475 purple_input_remove(priv->watcher);
1475 priv->watcher = 0; 1476 purple_xfer_set_watcher(xfer, 0);
1476 1477
1477 purple_debug_misc("xfer", "prpl is ready on ft %p, waiting for UI\n", xfer); 1478 purple_debug_misc("xfer", "prpl is ready on ft %p, waiting for UI\n", xfer);
1478 return; 1479 return;
1479 } 1480 }
1480 1481
1508 1509
1509 fseek(priv->dest_fp, priv->bytes_sent, SEEK_SET); 1510 fseek(priv->dest_fp, priv->bytes_sent, SEEK_SET);
1510 } 1511 }
1511 1512
1512 if (priv->fd != -1) 1513 if (priv->fd != -1)
1513 priv->watcher = purple_input_add(priv->fd, cond, transfer_cb, xfer); 1514 purple_xfer_set_watcher(xfer,
1515 purple_input_add(priv->fd, cond, transfer_cb, xfer));
1514 1516
1515 priv->start_time = time(NULL); 1517 priv->start_time = time(NULL);
1518
1519 g_object_notify(G_OBJECT(xfer), "start-time");
1516 1520
1517 if (priv->ops.start != NULL) 1521 if (priv->ops.start != NULL)
1518 priv->ops.start(xfer); 1522 priv->ops.start(xfer);
1519 } 1523 }
1520 1524
1521 static void 1525 static void
1522 connect_cb(gpointer data, gint source, const gchar *error_message) 1526 connect_cb(gpointer data, gint source, const gchar *error_message)
1523 { 1527 {
1524 PurpleXfer *xfer = (PurpleXfer *)data; 1528 PurpleXfer *xfer = PURPLE_XFER(data);
1525 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer);
1526 1529
1527 if (source < 0) { 1530 if (source < 0) {
1528 purple_xfer_cancel_local(xfer); 1531 purple_xfer_cancel_local(xfer);
1529 return; 1532 return;
1530 } 1533 }
1531 1534
1532 priv->fd = source; 1535 purple_xfer_set_fd(xfer, source);
1533
1534 begin_transfer(xfer, PURPLE_INPUT_READ); 1536 begin_transfer(xfer, PURPLE_INPUT_READ);
1535 } 1537 }
1536 1538
1537 void 1539 void
1538 purple_xfer_ui_ready(PurpleXfer *xfer) 1540 purple_xfer_ui_ready(PurpleXfer *xfer)
1557 cond = PURPLE_INPUT_WRITE; 1559 cond = PURPLE_INPUT_WRITE;
1558 else /* if (type == PURPLE_XFER_TYPE_RECEIVE) */ 1560 else /* if (type == PURPLE_XFER_TYPE_RECEIVE) */
1559 cond = PURPLE_INPUT_READ; 1561 cond = PURPLE_INPUT_READ;
1560 1562
1561 if (priv->watcher == 0 && priv->fd != -1) 1563 if (priv->watcher == 0 && priv->fd != -1)
1562 priv->watcher = purple_input_add(priv->fd, cond, transfer_cb, xfer); 1564 purple_xfer_set_watcher(xfer,
1565 purple_input_add(priv->fd, cond, transfer_cb, xfer));
1563 1566
1564 priv->ready = PURPLE_XFER_READY_NONE; 1567 priv->ready = PURPLE_XFER_READY_NONE;
1565 1568
1566 do_transfer(xfer); 1569 do_transfer(xfer);
1567 } 1570 }
1592 purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, guint16 port) 1595 purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, guint16 port)
1593 { 1596 {
1594 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); 1597 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer);
1595 PurpleInputCondition cond; 1598 PurpleInputCondition cond;
1596 PurpleXferType type; 1599 PurpleXferType type;
1600 GObject *obj;
1597 1601
1598 g_return_if_fail(priv != NULL); 1602 g_return_if_fail(priv != NULL);
1599 g_return_if_fail(purple_xfer_get_xfer_type(xfer) != PURPLE_XFER_TYPE_UNKNOWN); 1603 g_return_if_fail(purple_xfer_get_xfer_type(xfer) != PURPLE_XFER_TYPE_UNKNOWN);
1600 1604
1601 type = purple_xfer_get_xfer_type(xfer); 1605 type = purple_xfer_get_xfer_type(xfer);
1607 1611
1608 if (ip != NULL) { 1612 if (ip != NULL) {
1609 priv->remote_ip = g_strdup(ip); 1613 priv->remote_ip = g_strdup(ip);
1610 priv->remote_port = port; 1614 priv->remote_port = port;
1611 1615
1616 obj = G_OBJECT(xfer);
1617 g_object_freeze_notify(obj);
1618 g_object_notify(obj, "remote-ip");
1619 g_object_notify(obj, "remote-port");
1620 g_object_thaw_notify(obj);
1621
1612 /* Establish a file descriptor. */ 1622 /* Establish a file descriptor. */
1613 purple_proxy_connect(NULL, priv->account, priv->remote_ip, 1623 purple_proxy_connect(NULL, priv->account, priv->remote_ip,
1614 priv->remote_port, connect_cb, xfer); 1624 priv->remote_port, connect_cb, xfer);
1615 1625
1616 return; 1626 return;
1617 } 1627 }
1618 else { 1628 else {
1619 priv->fd = fd; 1629 purple_xfer_set_fd(xfer, fd);
1620 } 1630 }
1621 } 1631 }
1622 else { 1632 else {
1623 cond = PURPLE_INPUT_WRITE; 1633 cond = PURPLE_INPUT_WRITE;
1624 1634
1625 priv->fd = fd; 1635 purple_xfer_set_fd(xfer, fd);
1626 } 1636 }
1627 1637
1628 begin_transfer(xfer, cond); 1638 begin_transfer(xfer, cond);
1629 } 1639 }
1630 1640
1640 purple_xfer_cancel_local(xfer); 1650 purple_xfer_cancel_local(xfer);
1641 return; 1651 return;
1642 } 1652 }
1643 1653
1644 priv->end_time = time(NULL); 1654 priv->end_time = time(NULL);
1655
1656 g_object_notify(G_OBJECT(xfer), "end-time");
1657
1645 if (priv->ops.end != NULL) 1658 if (priv->ops.end != NULL)
1646 priv->ops.end(xfer); 1659 priv->ops.end(xfer);
1647 1660
1648 if (priv->watcher != 0) { 1661 if (priv->watcher != 0) {
1649 purple_input_remove(priv->watcher); 1662 purple_input_remove(priv->watcher);
1650 priv->watcher = 0; 1663 purple_xfer_set_watcher(xfer, 0);
1651 } 1664 }
1652 1665
1653 if (priv->fd != -1) 1666 if (priv->fd != -1)
1654 close(priv->fd); 1667 close(priv->fd);
1655 1668
1698 purple_request_close_with_handle(xfer); 1711 purple_request_close_with_handle(xfer);
1699 1712
1700 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL); 1713 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
1701 priv->end_time = time(NULL); 1714 priv->end_time = time(NULL);
1702 1715
1716 g_object_notify(G_OBJECT(xfer), "end-time");
1717
1703 if (purple_xfer_get_filename(xfer) != NULL) 1718 if (purple_xfer_get_filename(xfer) != NULL)
1704 { 1719 {
1705 msg = g_strdup_printf(_("You cancelled the transfer of %s"), 1720 msg = g_strdup_printf(_("You cancelled the transfer of %s"),
1706 purple_xfer_get_filename(xfer)); 1721 purple_xfer_get_filename(xfer));
1707 } 1722 }
1723 priv->ops.cancel_recv(xfer); 1738 priv->ops.cancel_recv(xfer);
1724 } 1739 }
1725 1740
1726 if (priv->watcher != 0) { 1741 if (priv->watcher != 0) {
1727 purple_input_remove(priv->watcher); 1742 purple_input_remove(priv->watcher);
1728 priv->watcher = 0; 1743 purple_xfer_set_watcher(xfer, 0);
1729 } 1744 }
1730 1745
1731 if (priv->fd != -1) 1746 if (priv->fd != -1)
1732 close(priv->fd); 1747 close(priv->fd);
1733 1748
1759 1774
1760 purple_request_close_with_handle(xfer); 1775 purple_request_close_with_handle(xfer);
1761 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE); 1776 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE);
1762 priv->end_time = time(NULL); 1777 priv->end_time = time(NULL);
1763 1778
1779 g_object_notify(G_OBJECT(xfer), "end-time");
1780
1764 account = purple_xfer_get_account(xfer); 1781 account = purple_xfer_get_account(xfer);
1765 buddy = purple_blist_find_buddy(account, priv->who); 1782 buddy = purple_blist_find_buddy(account, priv->who);
1766 1783
1767 if (purple_xfer_get_filename(xfer) != NULL) 1784 if (purple_xfer_get_filename(xfer) != NULL)
1768 { 1785 {
1789 priv->ops.cancel_recv(xfer); 1806 priv->ops.cancel_recv(xfer);
1790 } 1807 }
1791 1808
1792 if (priv->watcher != 0) { 1809 if (priv->watcher != 0) {
1793 purple_input_remove(priv->watcher); 1810 purple_input_remove(priv->watcher);
1794 priv->watcher = 0; 1811 purple_xfer_set_watcher(xfer, 0);
1795 } 1812 }
1796 1813
1797 if (priv->fd != -1) 1814 if (priv->fd != -1)
1798 close(priv->fd); 1815 close(priv->fd);
1799 1816
2077 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); 2094 PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer);
2078 2095
2079 PURPLE_DBUS_REGISTER_POINTER(xfer, PurpleXfer); 2096 PURPLE_DBUS_REGISTER_POINTER(xfer, PurpleXfer);
2080 2097
2081 priv->ui_ops = purple_xfers_get_ui_ops(); 2098 priv->ui_ops = purple_xfers_get_ui_ops();
2082 priv->message = NULL;
2083 priv->current_buffer_size = FT_INITIAL_BUFFER_SIZE; 2099 priv->current_buffer_size = FT_INITIAL_BUFFER_SIZE;
2084 priv->fd = -1; 2100 priv->fd = -1;
2085 priv->ready = PURPLE_XFER_READY_NONE; 2101 priv->ready = PURPLE_XFER_READY_NONE;
2086 } 2102 }
2087 2103
2164 2180
2165 g_object_class_install_property(obj_class, PROP_TYPE, 2181 g_object_class_install_property(obj_class, PROP_TYPE,
2166 g_param_spec_enum("type", "Transfer type", 2182 g_param_spec_enum("type", "Transfer type",
2167 "The type of file transfer.", PURPLE_TYPE_XFER_TYPE, 2183 "The type of file transfer.", PURPLE_TYPE_XFER_TYPE,
2168 PURPLE_XFER_TYPE_UNKNOWN, 2184 PURPLE_XFER_TYPE_UNKNOWN,
2169 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY) 2185 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
2186 G_PARAM_STATIC_STRINGS)
2170 ); 2187 );
2171 2188
2172 g_object_class_install_property(obj_class, PROP_ACCOUNT, 2189 g_object_class_install_property(obj_class, PROP_ACCOUNT,
2173 g_param_spec_object("account", "Account", 2190 g_param_spec_object("account", "Account",
2174 "The account sending or receiving the file.", 2191 "The account sending or receiving the file.",
2175 PURPLE_TYPE_ACCOUNT, 2192 PURPLE_TYPE_ACCOUNT,
2176 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY) 2193 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
2194 G_PARAM_STATIC_STRINGS)
2177 ); 2195 );
2178 2196
2179 g_object_class_install_property(obj_class, PROP_REMOTE_USER, 2197 g_object_class_install_property(obj_class, PROP_REMOTE_USER,
2180 g_param_spec_string("remote-user", "Remote user", 2198 g_param_spec_string("remote-user", "Remote user",
2181 "The name of the remote user.", NULL, 2199 "The name of the remote user.", NULL,
2182 G_PARAM_READWRITE | G_PARAM_CONSTRUCT) 2200 G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)
2183 ); 2201 );
2184 2202
2185 g_object_class_install_property(obj_class, PROP_MESSAGE, 2203 g_object_class_install_property(obj_class, PROP_MESSAGE,
2186 g_param_spec_string("message", "Message", 2204 g_param_spec_string("message", "Message",
2187 "The message for the file transfer.", NULL, 2205 "The message for the file transfer.", NULL,
2188 G_PARAM_READWRITE) 2206 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2189 ); 2207 );
2190 2208
2191 g_object_class_install_property(obj_class, PROP_FILENAME, 2209 g_object_class_install_property(obj_class, PROP_FILENAME,
2192 g_param_spec_string("filename", "Filename", 2210 g_param_spec_string("filename", "Filename",
2193 "The filename for the file transfer.", NULL, 2211 "The filename for the file transfer.", NULL,
2194 G_PARAM_READWRITE) 2212 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2195 ); 2213 );
2196 2214
2197 g_object_class_install_property(obj_class, PROP_LOCAL_FILENAME, 2215 g_object_class_install_property(obj_class, PROP_LOCAL_FILENAME,
2198 g_param_spec_string("local-filename", "Local filename", 2216 g_param_spec_string("local-filename", "Local filename",
2199 "The local filename for the file transfer.", NULL, 2217 "The local filename for the file transfer.", NULL,
2200 G_PARAM_READWRITE) 2218 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2201 ); 2219 );
2202 2220
2203 g_object_class_install_property(obj_class, PROP_FILE_SIZE, 2221 g_object_class_install_property(obj_class, PROP_FILE_SIZE,
2204 g_param_spec_int64("file-size", "File size", 2222 g_param_spec_int64("file-size", "File size",
2205 "Size of the file in a file transfer.", 2223 "Size of the file in a file transfer.",
2206 G_MININT64, G_MAXINT64, 0, 2224 G_MININT64, G_MAXINT64, 0,
2207 G_PARAM_READWRITE) 2225 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2208 ); 2226 );
2209 2227
2210 g_object_class_install_property(obj_class, PROP_REMOTE_IP, 2228 g_object_class_install_property(obj_class, PROP_REMOTE_IP,
2211 g_param_spec_string("remote-ip", "Remote IP", 2229 g_param_spec_string("remote-ip", "Remote IP",
2212 "The remote IP address in the file transfer.", NULL, 2230 "The remote IP address in the file transfer.", NULL,
2213 G_PARAM_READABLE) 2231 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
2214 ); 2232 );
2215 2233
2216 g_object_class_install_property(obj_class, PROP_LOCAL_PORT, 2234 g_object_class_install_property(obj_class, PROP_LOCAL_PORT,
2217 g_param_spec_int("local-port", "Local port", 2235 g_param_spec_int("local-port", "Local port",
2218 "The local port number in the file transfer.", 2236 "The local port number in the file transfer.",
2219 G_MININT, G_MAXINT, 0, 2237 G_MININT, G_MAXINT, 0,
2220 G_PARAM_READWRITE) 2238 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2221 ); 2239 );
2222 2240
2223 g_object_class_install_property(obj_class, PROP_REMOTE_PORT, 2241 g_object_class_install_property(obj_class, PROP_REMOTE_PORT,
2224 g_param_spec_int("remote-port", "Remote port", 2242 g_param_spec_int("remote-port", "Remote port",
2225 "The remote port number in the file transfer.", 2243 "The remote port number in the file transfer.",
2226 G_MININT, G_MAXINT, 0, 2244 G_MININT, G_MAXINT, 0,
2227 G_PARAM_READABLE) 2245 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
2228 ); 2246 );
2229 2247
2230 g_object_class_install_property(obj_class, PROP_FD, 2248 g_object_class_install_property(obj_class, PROP_FD,
2231 g_param_spec_int("fd", "Socket FD", 2249 g_param_spec_int("fd", "Socket FD",
2232 "The socket file descriptor.", 2250 "The socket file descriptor.",
2233 G_MININT, G_MAXINT, 0, 2251 G_MININT, G_MAXINT, 0,
2234 G_PARAM_READWRITE) 2252 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2235 ); 2253 );
2236 2254
2237 g_object_class_install_property(obj_class, PROP_WATCHER, 2255 g_object_class_install_property(obj_class, PROP_WATCHER,
2238 g_param_spec_int("watcher", "Watcher", 2256 g_param_spec_int("watcher", "Watcher",
2239 "The watcher for the file transfer.", 2257 "The watcher for the file transfer.",
2240 G_MININT, G_MAXINT, 0, 2258 G_MININT, G_MAXINT, 0,
2241 G_PARAM_READWRITE) 2259 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2242 ); 2260 );
2243 2261
2244 g_object_class_install_property(obj_class, PROP_BYTES_SENT, 2262 g_object_class_install_property(obj_class, PROP_BYTES_SENT,
2245 g_param_spec_int64("bytes-sent", "Bytes sent", 2263 g_param_spec_int64("bytes-sent", "Bytes sent",
2246 "The number of bytes sent (or received) so far.", 2264 "The number of bytes sent (or received) so far.",
2247 G_MININT64, G_MAXINT64, 0, 2265 G_MININT64, G_MAXINT64, 0,
2248 G_PARAM_READWRITE) 2266 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2249 ); 2267 );
2250 2268
2251 g_object_class_install_property(obj_class, PROP_START_TIME, 2269 g_object_class_install_property(obj_class, PROP_START_TIME,
2252 #if SIZEOF_TIME_T == 4 2270 #if SIZEOF_TIME_T == 4
2253 g_param_spec_int 2271 g_param_spec_int
2263 #elif SIZEOF_TIME_T == 8 2281 #elif SIZEOF_TIME_T == 8
2264 G_MININT64, G_MAXINT64, 0, 2282 G_MININT64, G_MAXINT64, 0,
2265 #else 2283 #else
2266 #error Unknown size of time_t 2284 #error Unknown size of time_t
2267 #endif 2285 #endif
2268 G_PARAM_READABLE) 2286 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
2269 ); 2287 );
2270 2288
2271 g_object_class_install_property(obj_class, PROP_END_TIME, 2289 g_object_class_install_property(obj_class, PROP_END_TIME,
2272 #if SIZEOF_TIME_T == 4 2290 #if SIZEOF_TIME_T == 4
2273 g_param_spec_int 2291 g_param_spec_int
2283 #elif SIZEOF_TIME_T == 8 2301 #elif SIZEOF_TIME_T == 8
2284 G_MININT64, G_MAXINT64, 0, 2302 G_MININT64, G_MAXINT64, 0,
2285 #else 2303 #else
2286 #error Unknown size of time_t 2304 #error Unknown size of time_t
2287 #endif 2305 #endif
2288 G_PARAM_READABLE) 2306 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
2289 ); 2307 );
2290 2308
2291 g_object_class_install_property(obj_class, PROP_STATUS, 2309 g_object_class_install_property(obj_class, PROP_STATUS,
2292 g_param_spec_enum("status", "Status", 2310 g_param_spec_enum("status", "Status",
2293 "The current status for the file transfer.", 2311 "The current status for the file transfer.",
2294 PURPLE_TYPE_XFER_STATUS, PURPLE_XFER_STATUS_UNKNOWN, 2312 PURPLE_TYPE_XFER_STATUS, PURPLE_XFER_STATUS_UNKNOWN,
2295 G_PARAM_READWRITE) 2313 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
2296 ); 2314 );
2297 2315
2298 g_type_class_add_private(klass, sizeof(PurpleXferPrivate)); 2316 g_type_class_add_private(klass, sizeof(PurpleXferPrivate));
2299 } 2317 }
2300 2318

mercurial