[gnome-games/wip/aplazas/run-uri: 15/21] tracker: Add TrackerGameSource.game_for_uri()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/run-uri: 15/21] tracker: Add TrackerGameSource.game_for_uri()
- Date: Thu, 13 Apr 2017 14:22:51 +0000 (UTC)
commit 5898d4f4009ed352fe55e3c28caee10af5a1b713
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Apr 13 15:44:52 2017 +0200
tracker: Add TrackerGameSource.game_for_uri()
This will be used in a subsequent commit to make a game from an URI.
src/tracker/tracker-game-source.vala | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker/tracker-game-source.vala b/src/tracker/tracker-game-source.vala
index 92a77fd..8089ecd 100644
--- a/src/tracker/tracker-game-source.vala
+++ b/src/tracker/tracker-game-source.vala
@@ -18,6 +18,17 @@ public class Games.TrackerGameSource : Object, GameSource {
queries += query;
}
+ public async Game game_for_uri (string uri) throws Error {
+ foreach (var query in queries)
+ try {
+ return yield query.game_for_uri (uri);
+ }
+ catch (Error e) {
+ }
+
+ throw new TrackerError.INVALID_URI ("Invalid URI: %s.", uri);
+ }
+
public async void each_game (GameCallback game_callback) {
for (size_t i = 0 ; i < queries.length ; i++)
yield each_game_for_query (game_callback, queries[i]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]