[gnome-games/wip/aplazas/781334-refactor-game-sources] Rename GenericUriGameSource to GameCollection
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781334-refactor-game-sources] Rename GenericUriGameSource to GameCollection
- Date: Sun, 7 May 2017 11:34:50 +0000 (UTC)
commit f9e0637861f03b536ef6a58553702980b07fa8e3
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun May 7 12:45:52 2017 +0200
Rename GenericUriGameSource to GameCollection
Also don't make it implement GameSource.
This makes this class' curent role in the application more clear.
src/Makefile.am | 2 +-
.../game-collection.vala} | 2 +-
src/ui/application.vala | 20 ++++++++++----------
3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 543e1fb..07ced3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -43,6 +43,7 @@ gnome_games_SOURCES = \
\
core/cover.vala \
core/game.vala \
+ core/game-collection.vala \
core/game-source.vala \
core/game-uri-adapter.vala \
core/icon.vala \
@@ -91,7 +92,6 @@ gnome_games_SOURCES = \
generic/generic-title.vala \
generic/generic-uid.vala \
generic/generic-uri-game-factory.vala \
- generic/generic-uri-game-source.vala \
\
grilo/grilo-cover.vala \
grilo/grilo-media.vala \
diff --git a/src/generic/generic-uri-game-source.vala b/src/core/game-collection.vala
similarity index 97%
rename from src/generic/generic-uri-game-source.vala
rename to src/core/game-collection.vala
index b9d1d19..deddd3f 100644
--- a/src/generic/generic-uri-game-source.vala
+++ b/src/core/game-collection.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-public class Games.GenericUriGameSource : Object, GameSource {
+public class Games.GameCollection : Object {
public signal void game_added (Game game);
private UriSource[] sources;
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 796993c..fa3ec55 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -8,7 +8,7 @@ public class Games.Application : Gtk.Application {
private ApplicationWindow window;
private bool game_list_loaded;
- private GenericUriGameSource uri_game_source;
+ private GameCollection game_collection;
internal Application () {
Object (application_id: "org.gnome.Games",
@@ -161,7 +161,7 @@ public class Games.Application : Gtk.Application {
}
private void init_game_sources () {
- if (uri_game_source != null)
+ if (game_collection != null)
return;
TrackerUriSource tracker_uri_source = null;
@@ -173,10 +173,10 @@ public class Games.Application : Gtk.Application {
debug (e.message);
}
- uri_game_source = new GenericUriGameSource ();
- uri_game_source.game_added.connect ((game) => add_game (game));
+ game_collection = new GameCollection ();
+ game_collection.game_added.connect ((game) => add_game (game));
if (tracker_uri_source != null)
- uri_game_source.add_source (tracker_uri_source);
+ game_collection.add_source (tracker_uri_source);
var mime_types = new GenericSet<string> (str_hash, str_equal);
@@ -196,10 +196,10 @@ public class Games.Application : Gtk.Application {
}
foreach (var uri_source in plugin.get_uri_sources ())
- uri_game_source.add_source (uri_source);
+ game_collection.add_source (uri_source);
foreach (var factory in plugin.get_uri_game_factories ())
- uri_game_source.add_factory (factory);
+ game_collection.add_factory (factory);
}
catch (Error e) {
debug ("Error: %s", e.message);
@@ -211,15 +211,15 @@ public class Games.Application : Gtk.Application {
init_game_sources ();
foreach (var uri in uris)
- yield uri_game_source.add_uri (uri);
+ yield game_collection.add_uri (uri);
- return yield uri_game_source.query_game_for_uri (uris[0]);
+ return yield game_collection.query_game_for_uri (uris[0]);
}
internal async void load_game_list () {
init_game_sources ();
- yield uri_game_source.each_game (add_game);
+ yield game_collection.each_game (add_game);
game_list_loaded = true;
if (window != null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]