From 1ffbfd92bbb0a34d1f592173584d944c1ceec964 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 1 Nov 2013 11:17:33 +0000 Subject: [PATCH 4/5] Use telepathy-glib for FileTransfer.FileCollection --- extensions/Channel_Type_FileTransfer_Future.xml | 67 ---------------------- extensions/Makefile.am | 1 - extensions/all.xml | 1 - src/ft-channel.c | 15 +---- tests/twisted/constants.py | 2 +- .../twisted/file-transfer/file_transfer_helper.py | 2 - tests/twisted/jingle-share/file_transfer_helper.py | 2 - tests/twisted/jingle-share/test-multift.py | 1 - 8 files changed, 2 insertions(+), 89 deletions(-) delete mode 100644 extensions/Channel_Type_FileTransfer_Future.xml diff --git a/extensions/Channel_Type_FileTransfer_Future.xml b/extensions/Channel_Type_FileTransfer_Future.xml deleted file mode 100644 index b155136..0000000 --- a/extensions/Channel_Type_FileTransfer_Future.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - Copyright (C) 2010 Collabora Ltd. - -

This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version.

- -

This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details.

- -

You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

-
- - - -

This interface contains functionality which we intend to incorporate - into the File Transfer Channel interface in future. - It should be considered to be conceptually part of the core - File Transfer Channel interface, but without API or ABI guarantees.

- - -

If we add new functionality to the Channel interface, libraries - that use generated code (notably telepathy-glib) will have it as - part of their ABI forever, meaning we can't make incompatible - changes. By using this interface as a staging area for future - Channel functionality, we can try out new properties, signals - and methods as application-specific extensions, then merge them - into the core Channel interface when we have enough implementation - experience to declare them to be stable.

- -

The name is by analogy to Python's __future__ - pseudo-module.

-
-
- - - (in Channel.Type.FileTransfer.FUTURE - pseudo-interface) - -

The FileCollection to which this channel belongs.

- -

A channel's FileCollection property can never change.

- -

At least on GTalk and apparently also on iChat the user can - send a set of files to a contact and that contact can then - pick and choose which files to actually receive. - - The CM should emit all new FT channels belonging to one collection - at the same time, UIs supporting this feature can then - bundle all these channels together in some way and show a - nice UI. UIs not supporting it will treat them as seperate - transfers, which is not great but a reasonable fallback

-
-
- -
-
- diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 2e4ac36..6207d8c 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -2,7 +2,6 @@ tools_dir = $(top_srcdir)/tools EXTRA_DIST = \ all.xml \ - Channel_Type_FileTransfer_Future.xml \ Connection_Future.xml \ Connection_Interface_Gabble_Decloak.xml \ Gabble_Plugin_Console.xml \ diff --git a/extensions/all.xml b/extensions/all.xml index 8b2205f..5218855 100644 --- a/extensions/all.xml +++ b/extensions/all.xml @@ -36,7 +36,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

- diff --git a/src/ft-channel.c b/src/ft-channel.c index 91af493..cf7359b 100644 --- a/src/ft-channel.c +++ b/src/ft-channel.c @@ -65,8 +65,6 @@ G_DEFINE_TYPE_WITH_CODE (GabbleFileTransferChannel, gabble_file_transfer_channel TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_FILE_TRANSFER, file_transfer_iface_init); - G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_FILETRANSFER_FUTURE, - NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, NULL); ); @@ -96,7 +94,6 @@ enum PROP_BYTESTREAM, #ifdef ENABLE_JINGLE_FILE_TRANSFER - /* Chan.Type.FileTransfer.FUTURE */ PROP_GTALK_FILE_COLLECTION, #endif @@ -521,7 +518,7 @@ gabble_file_transfer_channel_fill_immutable_properties (TpBaseChannel *chan, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "TransferredBytes", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "InitialOffset", - GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE, "FileCollection", + TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "FileCollection", TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName", TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata", NULL); @@ -548,7 +545,6 @@ gabble_file_transfer_channel_get_interfaces (TpBaseChannel *base) interfaces = TP_BASE_CHANNEL_CLASS ( gabble_file_transfer_channel_parent_class)->get_interfaces (base); - g_ptr_array_add (interfaces, GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA); return interfaces; @@ -577,10 +573,6 @@ gabble_file_transfer_channel_class_init ( { "InitialOffset", "initial-offset", NULL }, { "Date", "date", NULL }, { "URI", "uri", NULL }, - { NULL } - }; - - static TpDBusPropertiesMixinPropImpl file_future_props[] = { { "FileCollection", "file-collection", NULL }, { NULL } }; @@ -597,11 +589,6 @@ gabble_file_transfer_channel_class_init ( file_transfer_channel_properties_setter, file_props }, - { GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE, - tp_dbus_properties_mixin_getter_gobject_properties, - NULL, - file_future_props - }, { TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, tp_dbus_properties_mixin_getter_gobject_properties, NULL, diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index 8e0e5a5..52f8ba3 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -366,7 +366,7 @@ FT_DATE = CHANNEL_TYPE_FILE_TRANSFER + '.Date' FT_AVAILABLE_SOCKET_TYPES = CHANNEL_TYPE_FILE_TRANSFER + '.AvailableSocketTypes' FT_TRANSFERRED_BYTES = CHANNEL_TYPE_FILE_TRANSFER + '.TransferredBytes' FT_INITIAL_OFFSET = CHANNEL_TYPE_FILE_TRANSFER + '.InitialOffset' -FT_FILE_COLLECTION = CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE.FileCollection' +FT_FILE_COLLECTION = CHANNEL_TYPE_FILE_TRANSFER + '.FileCollection' FT_URI = CHANNEL_TYPE_FILE_TRANSFER + '.URI' FT_SERVICE_NAME = CHANNEL_IFACE_FILE_TRANSFER_METADATA + '.ServiceName' FT_METADATA = CHANNEL_IFACE_FILE_TRANSFER_METADATA + '.Metadata' diff --git a/tests/twisted/file-transfer/file_transfer_helper.py b/tests/twisted/file-transfer/file_transfer_helper.py index 2ae607f..4fa915b 100644 --- a/tests/twisted/file-transfer/file_transfer_helper.py +++ b/tests/twisted/file-transfer/file_transfer_helper.py @@ -220,7 +220,6 @@ class ReceiveFileTest(FileTransferTest): assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER assertSameSets( [ cs.CHANNEL_IFACE_FILE_TRANSFER_METADATA, - cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE', ], props[cs.INTERFACES]) assert props[cs.TARGET_HANDLE] == self.handle assert props[cs.TARGET_ID] == self.contact_name @@ -412,7 +411,6 @@ class SendFileTest(FileTransferTest): assertEquals(cs.CHANNEL_TYPE_FILE_TRANSFER, props[cs.CHANNEL_TYPE]) assertSameSets( [ cs.CHANNEL_IFACE_FILE_TRANSFER_METADATA, - cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE', ], props[cs.INTERFACES]) assertEquals(self.handle, props[cs.TARGET_HANDLE]) assertEquals(self.contact_name, props[cs.TARGET_ID]) diff --git a/tests/twisted/jingle-share/file_transfer_helper.py b/tests/twisted/jingle-share/file_transfer_helper.py index f917df2..07119d4 100644 --- a/tests/twisted/jingle-share/file_transfer_helper.py +++ b/tests/twisted/jingle-share/file_transfer_helper.py @@ -270,7 +270,6 @@ class ReceiveFileTest(FileTransferTest): assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER, props assertSameSets( [ cs.CHANNEL_IFACE_FILE_TRANSFER_METADATA, - cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE', ], props[cs.INTERFACES]) assert props[cs.TARGET_HANDLE] == self.handle, props assert props[cs.TARGET_ID] == self.target, props @@ -425,7 +424,6 @@ class SendFileTest(FileTransferTest): assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER assertSameSets( [ cs.CHANNEL_IFACE_FILE_TRANSFER_METADATA, - cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE', ], props[cs.INTERFACES]) assert props[cs.TARGET_HANDLE] == self.handle assert props[cs.TARGET_ID] == self.target diff --git a/tests/twisted/jingle-share/test-multift.py b/tests/twisted/jingle-share/test-multift.py index e842767..889e6ae 100644 --- a/tests/twisted/jingle-share/test-multift.py +++ b/tests/twisted/jingle-share/test-multift.py @@ -118,7 +118,6 @@ def test(q, bus, conn, stream): assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER, props assertSameSets( [ cs.CHANNEL_IFACE_FILE_TRANSFER_METADATA, - cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE', ], props[cs.INTERFACES]) assert props[cs.TARGET_HANDLE] == 2L, props assert props[cs.TARGET_ID] == contact.replace("/Resource", ""), props -- 1.8.4.2