Commit c5445ef5 authored by Jens Georg's avatar Jens Georg

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
parents 8e5aeed7 36fc7c85
......@@ -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)
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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);
}
}
......
......@@ -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);
}
......
......@@ -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) {
......
......@@ -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);
}
}
......@@ -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;
}
......
......@@ -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 = {};
......
......@@ -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);
}
}
......
......@@ -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;
}
......
......@@ -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);
}
}
......@@ -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);
}
}
......
......@@ -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,
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment