summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiegfried-Angel Gevatter Pujals <siegfried@gevatter.com>2012-02-01 13:57:20 +0100
committerSiegfried-Angel Gevatter Pujals <siegfried@gevatter.com>2012-02-01 13:57:20 +0100
commitf6afe87982018bce88706cea8f4238107268d51d (patch)
treec7133d83ba9c7af41feca85033b2394b4ff5f7e7
parentb71f82db463cb2d303bb62bf3ee73dac78b1cd09 (diff)
Dear Vala, please get proper docs. kthxbye
-rw-r--r--src/utils.vala9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/utils.vala b/src/utils.vala
index 64e8779..abdd4ef 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -28,7 +28,6 @@ public class Utils : Object
{
private static HashTable<string, string> app_to_desktop_file = null;
private static string[] desktop_file_prefixes = null;
- private static GLib.Regex duplicate_path_separator_regex;
// FIXME: Do we want to make this async?
// FIXME: this can throw GLib.Error, but if we use try/catch or throws
@@ -57,8 +56,6 @@ public class Utils : Object
if (desktop_file_prefixes != null)
return;
- duplicate_path_separator_regex = new Regex ("//");
-
unowned string session_var;
session_var = Environment.get_variable ("XDG_CURRENT_DESKTOP");
@@ -105,17 +102,13 @@ public class Utils : Object
* Takes a path to a .desktop file and returns the Desktop ID for it.
* This isn't simply the basename, but may contain part of the path;
* eg. kde4-kate.desktop for /usr/share/applications/kde4/kate.desktop.
- *
- * Warning: init_desktop_id () must be called before this function can
- * be used.
* */
private static string extract_desktop_id (string path)
{
if (!path.has_prefix ("/"))
return path;
- string normalized_path = duplicate_path_separator_regex.replace (
- path, path.length, 0, "/");
+ string normalized_path = path.replace ("//", "/");
foreach (unowned string prefix in desktop_file_prefixes)
{