[retro-gtk] retro-gobject: Remove unused elements from ModuleQuery
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] retro-gobject: Remove unused elements from ModuleQuery
- Date: Fri, 10 Feb 2017 12:01:39 +0000 (UTC)
commit 34eb1246bdfe9eaeead45cd7607b68964bc5894d
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Feb 10 12:47:13 2017 +0100
retro-gobject: Remove unused elements from ModuleQuery
https://bugzilla.gnome.org/show_bug.cgi?id=778446
retro-gobject/retro-module-query.vala | 71 ---------------------------------
1 files changed, 0 insertions(+), 71 deletions(-)
---
diff --git a/retro-gobject/retro-module-query.vala b/retro-gobject/retro-module-query.vala
index 82004e1..1ea07fe 100644
--- a/retro-gobject/retro-module-query.vala
+++ b/retro-gobject/retro-module-query.vala
@@ -2,23 +2,9 @@
namespace Retro.ModuleQuery {
public delegate bool CoreDescriptorQueryCallback (CoreDescriptor core_descriptor);
- public delegate bool ModuleInfoQueryCallback (HashTable<string, string> module_info);
private const string ENV_PLUGIN_PATH = "RETRO_PLUGIN_PATH_1_0";
- public string? lookup_module_for_basename (string basename) throws Error {
- foreach (var path in get_plugin_lookup_paths ()) {
- var directory = File.new_for_path (path);
- var file = directory.get_child (basename);
- if (!file.query_exists ())
- continue;
-
- return file.get_path ();
- }
-
- return null;
- }
-
public void foreach_core_descriptor (CoreDescriptorQueryCallback callback) {
foreach (var path in get_plugin_lookup_paths ()) {
var directory = File.new_for_path (path);
@@ -58,42 +44,6 @@ namespace Retro.ModuleQuery {
}
}
- public string? lookup_module_for_info (ModuleInfoQueryCallback callback) throws Error {
- foreach (var path in get_plugin_lookup_paths ()) {
- var directory = File.new_for_path (path);
- if (!directory.query_exists ())
- continue;
-
- if (directory.query_file_type (FileQueryInfoFlags.NOFOLLOW_SYMLINKS) !=
FileType.DIRECTORY)
- continue;
-
- var enumerator = directory.enumerate_children ("",
FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
- for (var info = enumerator.next_file () ; info != null ; info = enumerator.next_file
()) {
- var module_info_basename = info.get_name ();
- if (!module_info_basename.has_suffix ("_libretro.info"))
- continue;
-
- // Replace the "info" extension by "so".
- var module_basename = module_info_basename[0:module_info_basename.length - 4]
+ "so";
- var module_file = directory.get_child (module_basename);
- if (!module_file.query_exists ())
- continue;
-
- if (info.get_file_type () == FileType.DIRECTORY)
- continue;
-
- var module_info_file = directory.get_child (module_info_basename);
- var module_info = get_module_info (module_info_file);
- if (!callback (module_info))
- continue;
-
- return module_file.get_path ();
- }
- }
-
- return null;
- }
-
private string[] get_plugin_lookup_paths () {
var envp = Environ.@get ();
var env_plugin_path = Environ.get_variable (envp, ENV_PLUGIN_PATH);
@@ -103,27 +53,6 @@ namespace Retro.ModuleQuery {
return @"$env_plugin_path:$(Config.RETRO_PLUGIN_PATH)".split (":");
}
- private HashTable<string, string> get_module_info (File module_info_file) {
- var module_info = new HashTable<string, string> (str_hash, str_equal);
-
- var dis = new DataInputStream (module_info_file.read ());
- for (var line = dis.read_line (null) ; line != null ; line = dis.read_line (null)) {
- var splitted_line = line.split ("=", 2);
- if (splitted_line.length != 2)
- continue;
-
- var key = splitted_line[0].strip ();
- var value = splitted_line[1].strip ();
- if (value.has_prefix ("\"") && value.has_suffix ("\"") && value.length >= 2)
- // Remove the quotes.
- module_info[key] = value[1:value.length - 1];
- else
- module_info[key] = value;
- }
-
- return module_info;
- }
-
private delegate bool ForeachChildFunc (FileInfo child_info);
private void foreach_child (File file, ForeachChildFunc child_info_callback) {
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]