diff options
author | Michal Hruby <michal.mhr@gmail.com> | 2011-02-09 10:11:20 +0100 |
---|---|---|
committer | Michal Hruby <michal.mhr@gmail.com> | 2011-02-09 10:11:20 +0100 |
commit | b55fbf6977960a4ae72008300ecd0b6f9679f6fe (patch) | |
tree | 1f73aded1032e7455fe31a84dddc2943ea4fae3b | |
parent | 49c106e4a1b3ce7acf3b49a16baa07c2912038da (diff) |
Remove unused code
-rw-r--r-- | src/desktop-launch-listener.vala | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/src/desktop-launch-listener.vala b/src/desktop-launch-listener.vala index 30a1efa..3a68c73 100644 --- a/src/desktop-launch-listener.vala +++ b/src/desktop-launch-listener.vala @@ -181,91 +181,5 @@ public class DesktopLaunchListener : DataProvider launched_signal_id = 0; } } -/* - private string? get_ooo_desktop_file_for_mimetype (string mimetype) - { - return find_desktop_file_for_app ("libreoffice", mimetype) ?? - find_desktop_file_for_app ("ooffice", mimetype); - } - - private string? find_desktop_file_for_app (string app_name, - string? mimetype = null) - { - string hash_name = mimetype != null ? - "%s::%s".printf (app_name, mimetype) : app_name; - unowned string? in_cache = app_to_desktop_file.lookup (hash_name); - if (in_cache != null) - { - return in_cache; - } - - string[] data_dirs = Environment.get_system_data_dirs (); - data_dirs += Environment.get_user_data_dir (); - - foreach (unowned string dir in data_dirs) - { - var p = Path.build_filename (dir, "applications", - "%s.desktop".printf (app_name), - null); - var f = File.new_for_path (p); - if (f.query_exists (null)) - { - app_to_desktop_file.insert (hash_name, p); - // FIXME: we're not checking mimetype here! - return p; - } - } - - foreach (unowned string dir in data_dirs) - { - var p = Path.build_filename (dir, "applications", null); - var app_dir = File.new_for_path (p); - if (!app_dir.query_exists (null)) continue; - - try - { - var enumerator = - app_dir.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null); - FileInfo fi = enumerator.next_file (null); - while (fi != null) - { - if (fi.get_name ().has_suffix (".desktop")) - { - string contents; - var desktop_file = Path.build_filename (p, fi.get_name (), null); - var f = File.new_for_path (desktop_file); - try - { - if (f.load_contents (null, out contents, null, null)) - { - if ("Exec=%s".printf (app_name) in contents) - { - if (mimetype == null || mimetype in contents) - { - app_to_desktop_file.insert (hash_name, desktop_file); - return desktop_file; - } - } - } - } - catch (GLib.Error err) - { - warning ("%s", err.message); - } - } - fi = enumerator.next_file (null); - } - - enumerator.close (null); - } - catch (GLib.Error err) - { - warning ("%s", err.message); - } - } - - return null; - } -*/ } |