[gnome-games] core: Add Uid
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] core: Add Uid
- Date: Fri, 25 Mar 2016 06:44:07 +0000 (UTC)
commit 9fea9baf747f2cc14add12ef2b8ddf2c0e9c7742
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Mar 22 18:45:00 2016 +0100
core: Add Uid
Add the Uid interface to be represent all the current *Uid classes.
This will be used in a subsequent commit to make RetroRunner take a Uid
parameter rather than a UID string, allowing to evaluate the UIDs
lazily and hence helping to construct a RetroRunner earlier with no
performance impact.
This is needed to create a generic game type.
plugins/dreamcast/src/dreamcast-uid.vala | 2 +-
plugins/game-cube/src/game-cube-uid.vala | 2 +-
plugins/sega-saturn/src/sega-saturn-uid.vala | 2 +-
plugins/wii/src/wii-uid.vala | 2 +-
src/Makefile.am | 1 +
src/core/uid.vala | 5 +++++
src/utils/fingerprint.vala | 2 +-
7 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/plugins/dreamcast/src/dreamcast-uid.vala b/plugins/dreamcast/src/dreamcast-uid.vala
index a4f1a2c..26a4bec 100644
--- a/plugins/dreamcast/src/dreamcast-uid.vala
+++ b/plugins/dreamcast/src/dreamcast-uid.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Games. License: GPLv3
-private class Games.DreamcastUid: Object {
+private class Games.DreamcastUid: Object, Uid {
private DreamcastHeader header;
private string uid;
diff --git a/plugins/game-cube/src/game-cube-uid.vala b/plugins/game-cube/src/game-cube-uid.vala
index 66c0965..c0b20bc 100644
--- a/plugins/game-cube/src/game-cube-uid.vala
+++ b/plugins/game-cube/src/game-cube-uid.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Games. License: GPLv3
-private class Games.GameCubeUid: Object {
+private class Games.GameCubeUid: Object, Uid {
private GameCubeHeader header;
private string uid;
diff --git a/plugins/sega-saturn/src/sega-saturn-uid.vala b/plugins/sega-saturn/src/sega-saturn-uid.vala
index 1d92247..268afd9 100644
--- a/plugins/sega-saturn/src/sega-saturn-uid.vala
+++ b/plugins/sega-saturn/src/sega-saturn-uid.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Games. License: GPLv3
-private class Games.SegaSaturnUid: Object {
+private class Games.SegaSaturnUid: Object, Uid {
private SegaSaturnHeader header;
private string uid;
diff --git a/plugins/wii/src/wii-uid.vala b/plugins/wii/src/wii-uid.vala
index 7c46f00..a3bdbcf 100644
--- a/plugins/wii/src/wii-uid.vala
+++ b/plugins/wii/src/wii-uid.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Games. License: GPLv3
-private class Games.WiiUid: Object {
+private class Games.WiiUid: Object, Uid {
private WiiHeader header;
private string uid;
diff --git a/src/Makefile.am b/src/Makefile.am
index 15d9bce..86b9f2c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,7 @@ gnome_games_SOURCES = \
core/plugin-register.vala \
core/plugin-registrar.vala \
core/runner.vala \
+ core/uid.vala \
\
dummy/dummy-game.vala \
dummy/dummy-game-source.vala \
diff --git a/src/core/uid.vala b/src/core/uid.vala
new file mode 100644
index 0000000..52400e2
--- /dev/null
+++ b/src/core/uid.vala
@@ -0,0 +1,5 @@
+// This file is part of GNOME Games. License: GPLv3
+
+public interface Games.Uid : Object {
+ public abstract string get_uid () throws Error;
+}
diff --git a/src/utils/fingerprint.vala b/src/utils/fingerprint.vala
index edd32c6..0c28482 100644
--- a/src/utils/fingerprint.vala
+++ b/src/utils/fingerprint.vala
@@ -19,7 +19,7 @@ namespace Games.Fingerprint {
}
}
-public class Games.FingerprintUid: Object {
+public class Games.FingerprintUid: Object, Uid {
private string uri;
private string prefix;
private string uid;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]