[gnome-games] Remove unused UriGameFactory.is_uri_valid()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] Remove unused UriGameFactory.is_uri_valid()
- Date: Fri, 5 May 2017 06:51:44 +0000 (UTC)
commit 1c9af1078721aae9f1a77ac9e64c721076b779e8
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Apr 13 13:27:09 2017 +0200
Remove unused UriGameFactory.is_uri_valid()
https://bugzilla.gnome.org/show_bug.cgi?id=781334
.../playstation/src/playstation-game-factory.vala | 6 ------
src/core/uri-game-factory.vala | 1 -
src/generic/generic-uri-game-factory.vala | 9 +--------
src/generic/generic-uri-game-source.vala | 3 +--
4 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/plugins/playstation/src/playstation-game-factory.vala
b/plugins/playstation/src/playstation-game-factory.vala
index 413aa83..32f7191 100644
--- a/plugins/playstation/src/playstation-game-factory.vala
+++ b/plugins/playstation/src/playstation-game-factory.vala
@@ -24,12 +24,6 @@ public class Games.PlayStationGameFactory : Object, UriGameFactory {
return { SEARCHED_MIME_TYPE };
}
- public bool is_uri_valid (string uri) {
- File file = File.new_for_uri(uri);
-
- return file.query_exists ();
- }
-
public void add_uri (string uri) {
string disc_id;
diff --git a/src/core/uri-game-factory.vala b/src/core/uri-game-factory.vala
index 0f25938..26e418e 100644
--- a/src/core/uri-game-factory.vala
+++ b/src/core/uri-game-factory.vala
@@ -1,6 +1,5 @@
public interface Games.UriGameFactory : Object {
public abstract string[] get_mime_types ();
- public abstract bool is_uri_valid (string uri);
public abstract void add_uri (string uri);
public abstract async void foreach_game (Games.GameCallback game_callback);
}
diff --git a/src/generic/generic-uri-game-factory.vala b/src/generic/generic-uri-game-factory.vala
index c75fc14..176a2ab 100644
--- a/src/generic/generic-uri-game-factory.vala
+++ b/src/generic/generic-uri-game-factory.vala
@@ -1,17 +1,14 @@
// This file is part of GNOME Games. License: GPL-3.0+.
public class Games.GenericUriGameFactory : Object, UriGameFactory {
- public delegate bool UriTest (string uri);
private const uint HANDLED_URIS_PER_CYCLE = 5;
private GameUriAdapter game_uri_adapter;
- private UriTest? uri_validity_test;
private string[] uris;
private string[] mime_types;
- public GenericUriGameFactory (GameUriAdapter game_uri_adapter, owned UriTest? uri_validity_test =
null) {
+ public GenericUriGameFactory (GameUriAdapter game_uri_adapter) {
this.game_uri_adapter = game_uri_adapter;
- this.uri_validity_test = (owned) uri_validity_test;
uris = {};
mime_types = {};
}
@@ -24,10 +21,6 @@ public class Games.GenericUriGameFactory : Object, UriGameFactory {
mime_types += mime_type;
}
- public bool is_uri_valid (string uri) {
- return uri_validity_test == null ? true : uri_validity_test (uri);
- }
-
public void add_uri (string uri) {
uris += uri;
}
diff --git a/src/generic/generic-uri-game-source.vala b/src/generic/generic-uri-game-source.vala
index 03306c2..e9fbc3c 100644
--- a/src/generic/generic-uri-game-source.vala
+++ b/src/generic/generic-uri-game-source.vala
@@ -65,8 +65,7 @@ public class Games.GenericUriGameSource : Object, GameSource {
}
private async void add_uri_to_factory (UriGameFactory factory, string uri) {
- if (factory.is_uri_valid (uri))
- factory.add_uri (uri);
+ factory.add_uri (uri);
Idle.add (add_uri_to_factory.callback);
yield;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]