diff options
author | Jens Georg <mail@jensge.org> | 2018-06-05 20:52:57 +0000 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2018-06-05 20:52:57 +0000 |
commit | c5445ef5e111b05a87c9784cf5760ffda48ca168 (patch) | |
tree | b4e9d2996f37ff2dd4515a82bafe78fb48f0dc93 | |
parent | 8e5aeed7ef10c52f91cec412c8f9f7a7321174cd (diff) | |
parent | 36fc7c8549cc8968352d05c92987a9e60e50070c (diff) | |
download | rygel-c5445ef5e111b05a87c9784cf5760ffda48ca168.tar.gz |
Merge branch 'wip/ricotz/async-out' into 'master'
Asynchronous out-parameters are only allowed at the end of argument lists
See merge request GNOME/rygel!2
15 files changed, 65 insertions, 65 deletions
diff --git a/src/librygel-server/rygel-client-hacks.vala b/src/librygel-server/rygel-client-hacks.vala index 4bd54205..6891ebf3 100644 --- a/src/librygel-server/rygel-client-hacks.vala +++ b/src/librygel-server/rygel-client-hacks.vala @@ -115,16 +115,16 @@ internal abstract class Rygel.ClientHacks : GLib.Object { SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { return yield container.search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } private void check_headers (Message message) diff --git a/src/librygel-server/rygel-content-directory.vala b/src/librygel-server/rygel-content-directory.vala index 812d2741..0b432cd9 100644 --- a/src/librygel-server/rygel-content-directory.vala +++ b/src/librygel-server/rygel-content-directory.vala @@ -728,9 +728,9 @@ public class Rygel.ContentDirectory: Service { var objects = yield root.search (expression, 0, 0, - out matches, "", - null); + null, + out matches); if (objects.size > 0) { uint32 count = 1; foreach (var object in objects) { diff --git a/src/librygel-server/rygel-object-creator.vala b/src/librygel-server/rygel-object-creator.vala index 950c9533..7c5ca864 100644 --- a/src/librygel-server/rygel-object-creator.vala +++ b/src/librygel-server/rygel-object-creator.vala @@ -366,9 +366,9 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine { var result = yield root_container.search (search_expression, 0, 1, - out total_matches, root_container.sort_criteria, - this.cancellable); + this.cancellable, + out total_matches); if (result.size > 0) { this.didl_object.upnp_class = upnp_class; diff --git a/src/librygel-server/rygel-search.vala b/src/librygel-server/rygel-search.vala index d391444d..cb5609d9 100644 --- a/src/librygel-server/rygel-search.vala +++ b/src/librygel-server/rygel-search.vala @@ -77,16 +77,16 @@ internal class Rygel.Search: Rygel.MediaQueryAction { parser.expression, this.index, this.requested_count, - out this.total_matches, sort_criteria, - this.cancellable); + this.cancellable, + out this.total_matches); } else { return yield container.search (parser.expression, this.index, this.requested_count, - out this.total_matches, sort_criteria, - this.cancellable); + this.cancellable, + out this.total_matches); } } diff --git a/src/librygel-server/rygel-searchable-container.vala b/src/librygel-server/rygel-searchable-container.vala index bda97b72..83076c1e 100644 --- a/src/librygel-server/rygel-searchable-container.vala +++ b/src/librygel-server/rygel-searchable-container.vala @@ -47,18 +47,18 @@ public interface Rygel.SearchableContainer : MediaContainer { * * @param expression the search expression or null for wildcard * @param offset zero-based index of the first object to return - * @param max_count maximum number of objects to return * @param total_matches sets it to the actual number of objects that satisfy * @param cancellable optional cancellable for this operation. + * @param max_count maximum number of objects to return * * @return A list of matching media objects or null if no object matched. */ public abstract async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error; /** @@ -80,9 +80,9 @@ public interface Rygel.SearchableContainer : MediaContainer { public async MediaObjects? simple_search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { var result = new MediaObjects (); @@ -179,9 +179,9 @@ public interface Rygel.SearchableContainer : MediaContainer { var results = yield this.search (expression, 0, 1, - out total_matches, "", - cancellable); + cancellable, + out total_matches); if (results.size > 0) { return results[0]; } else { @@ -206,9 +206,9 @@ public interface Rygel.SearchableContainer : MediaContainer { var child_result = yield container.search (expression, 0, limit, - out tmp, sort_criteria, - cancellable); + cancellable, + out tmp); result.add_all (child_result); } diff --git a/src/librygel-server/rygel-simple-container.vala b/src/librygel-server/rygel-simple-container.vala index 5cc477a9..db24c8fa 100644 --- a/src/librygel-server/rygel-simple-container.vala +++ b/src/librygel-server/rygel-simple-container.vala @@ -269,16 +269,16 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer, public async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { return yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } private void add_child (MediaObject child) { diff --git a/src/librygel-server/rygel-wmp-hacks.vala b/src/librygel-server/rygel-wmp-hacks.vala index 1c7693ce..663afbec 100644 --- a/src/librygel-server/rygel-wmp-hacks.vala +++ b/src/librygel-server/rygel-wmp-hacks.vala @@ -34,9 +34,9 @@ internal class Rygel.WMPHacks : ClientHacks { SearchExpression? expression, uint offset, uint requested, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { // Drop the limit. WMP has a problem if we don't know the number of // total matches; instead of continuing to request items it stoppes @@ -46,8 +46,8 @@ internal class Rygel.WMPHacks : ClientHacks { return yield container.search (expression, offset, 0, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } } diff --git a/src/librygel-server/rygel-xbox-hacks.vala b/src/librygel-server/rygel-xbox-hacks.vala index b4960033..26aae8b2 100644 --- a/src/librygel-server/rygel-xbox-hacks.vala +++ b/src/librygel-server/rygel-xbox-hacks.vala @@ -144,9 +144,9 @@ internal class Rygel.XBoxHacks : ClientHacks { SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { var set_total_matches = false; var modified_expression = expression; @@ -174,9 +174,9 @@ internal class Rygel.XBoxHacks : ClientHacks { var results = yield container.search (modified_expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); if (total_matches == 0 && set_total_matches) { total_matches = results.size; } diff --git a/src/plugins/external/rygel-external-container.vala b/src/plugins/external/rygel-external-container.vala index 3c3c6a1f..fe61229f 100644 --- a/src/plugins/external/rygel-external-container.vala +++ b/src/plugins/external/rygel-external-container.vala @@ -114,18 +114,18 @@ public class Rygel.External.Container : Rygel.MediaContainer, public async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws GLib.Error { if (expression == null || !this.searchable) { // Either its wildcard or backend doesn't implement search :( return yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } string[] filter = {}; diff --git a/src/plugins/lms/rygel-lms-category-container.vala b/src/plugins/lms/rygel-lms-category-container.vala index 9ada3533..331772cc 100644 --- a/src/plugins/lms/rygel-lms-category-container.vala +++ b/src/plugins/lms/rygel-lms-category-container.vala @@ -237,9 +237,9 @@ public abstract class Rygel.LMS.CategoryContainer : Rygel.MediaContainer, public async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { debug ("search()"); try { @@ -269,9 +269,9 @@ public abstract class Rygel.LMS.CategoryContainer : Rygel.MediaContainer, return yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } } diff --git a/src/plugins/media-export/rygel-media-export-db-container.vala b/src/plugins/media-export/rygel-media-export-db-container.vala index 8ea1077a..511874eb 100644 --- a/src/plugins/media-export/rygel-media-export-db-container.vala +++ b/src/plugins/media-export/rygel-media-export-db-container.vala @@ -81,9 +81,9 @@ public class Rygel.MediaExport.DBContainer : MediaContainer, public virtual async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws GLib.Error { MediaObjects children = null; @@ -100,9 +100,9 @@ public class Rygel.MediaExport.DBContainer : MediaContainer, children = yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } else { throw error; } diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala index 8381d1c7..53071b65 100644 --- a/src/plugins/media-export/rygel-media-export-query-container.vala +++ b/src/plugins/media-export/rygel-media-export-query-container.vala @@ -44,9 +44,9 @@ internal abstract class Rygel.MediaExport.QueryContainer : DBContainer { public async override MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws GLib.Error { debug ("Running search %s on query container %s", expression == null ? "null" : expression.to_string (), @@ -55,9 +55,9 @@ internal abstract class Rygel.MediaExport.QueryContainer : DBContainer { return yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } } diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala index c3af7543..6c80981b 100644 --- a/src/plugins/media-export/rygel-media-export-root-container.vala +++ b/src/plugins/media-export/rygel-media-export-root-container.vala @@ -144,17 +144,17 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer { public override async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws GLib.Error { if (expression == null) { return yield base.search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } MediaObjects list; @@ -193,9 +193,9 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer { return yield base.search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } } diff --git a/src/plugins/tracker/rygel-tracker-category-all-container.vala b/src/plugins/tracker/rygel-tracker-category-all-container.vala index a045f7a8..460c1d17 100644 --- a/src/plugins/tracker/rygel-tracker-category-all-container.vala +++ b/src/plugins/tracker/rygel-tracker-category-all-container.vala @@ -114,16 +114,16 @@ public class Rygel.Tracker.CategoryAllContainer : SearchContainer, public async MediaObjects? search (SearchExpression? expression, uint offset, uint max_count, - out uint total_matches, string sort_criteria, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws Error { return yield this.simple_search (expression, offset, max_count, - out total_matches, sort_criteria, - cancellable); + cancellable, + out total_matches); } private void on_graph_updated (DBusConnection connection, diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala index a7ac794d..38ebc4a6 100644 --- a/src/plugins/tracker/rygel-tracker-search-container.vala +++ b/src/plugins/tracker/rygel-tracker-search-container.vala @@ -121,16 +121,16 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer { sort_criteria, offset, max_count, - out total_matches, - cancellable); + cancellable, + out total_matches); } public async MediaObjects? execute_query (SearchExpression? expression, string sort_criteria, uint offset, uint max_count, - out uint total_matches, - Cancellable? cancellable) + Cancellable? cancellable, + out uint total_matches) throws GLib.Error { var results = new MediaObjects (); @@ -178,8 +178,8 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer { "", 0, 1, - out total_matches, - cancellable); + cancellable, + out total_matches); if (results.size > 0) { return results[0]; } else { |