[gthumb] removed unused functions



commit d55c45712287158ece6dd0914a45790849696c98
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Jan 5 19:13:00 2011 +0100

    removed unused functions

 gthumb/glib-utils.c |  139 ---------------------------------------------------
 gthumb/glib-utils.h |    2 -
 2 files changed, 0 insertions(+), 141 deletions(-)
---
diff --git a/gthumb/glib-utils.c b/gthumb/glib-utils.c
index 7fec8b1..295bb12 100644
--- a/gthumb/glib-utils.c
+++ b/gthumb/glib-utils.c
@@ -1332,145 +1332,6 @@ get_home_uri (void)
 }
 
 
-const char *
-get_desktop_uri (void)
-{
-	static char *desktop_uri = NULL;
-
-	if (desktop_uri == NULL) {
-		char *path;
-		char *uri;
-
-		path = xdg_user_dir_lookup ("DESKTOP");
-		uri = g_uri_escape_string (path, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE);
-
-		desktop_uri = g_strconcat ("file://", uri, NULL);
-
-		g_free (uri);
-		g_free (path);
-	}
-
-	return desktop_uri;
-}
-
-
-char *
-xdg_user_dir_lookup (const char *type)
-{
-	/* This function is used by gthumb to determine the default "PICTURES"
-	   directory for imports. The actually directory name is localized.
-	   Bug 425365. */
-
-	FILE *file;
-	char *home_dir, *config_home, *config_file;
-	char buffer[512];
-	char *user_dir;
-	char *p, *d;
-	int len;
-	int relative;
-
-	home_dir = getenv ("HOME");
-	if (home_dir == NULL)
-		return strdup ("/tmp");
-
-	config_home = getenv ("XDG_CONFIG_HOME");
-	if (config_home == NULL || config_home[0] == 0) {
-		config_file = malloc (strlen (home_dir) + strlen ("/.config/user-dirs.dirs") + 1);
-		strcpy (config_file, home_dir);
-		strcat (config_file, "/.config/user-dirs.dirs");
-	}
-	else {
-		config_file = malloc (strlen (config_home) + strlen ("/user-dirs.dirs") + 1);
-		strcpy (config_file, config_home);
-		strcat (config_file, "/user-dirs.dirs");
-	}
-
-	file = fopen (config_file, "r");
-	free (config_file);
-	if (file == NULL)
-		goto error;
-
-	user_dir = NULL;
-
-	while (fgets (buffer, sizeof (buffer), file)) {
-		/* Remove newline at end */
-		len = strlen (buffer);
-		if (len > 0 && buffer[len-1] == '\n')
-		buffer[len-1] = 0;
-
-		p = buffer;
-		while (*p == ' ' || *p == '\t')
-			p++;
-
-		if (strncmp (p, "XDG_", 4) != 0)
-			continue;
-		p += 4;
-
-		if (strncmp (p, type, strlen (type)) != 0)
-			continue;
-		p += strlen (type);
-
-		if (strncmp (p, "_DIR", 4) != 0)
-		continue;
-		p += 4;
-
-		while (*p == ' ' || *p == '\t')
-			p++;
-
-		if (*p != '=')
-			continue;
-		p++;
-
-		while (*p == ' ' || *p == '\t')
-			p++;
-
-		if (*p != '"')
-			continue;
-		p++;
-
-		relative = 0;
-		if (strncmp (p, "$HOME/", 6) == 0) {
-			p += 6;
-			relative = 1;
-		} else if (*p != '/')
-			continue;
-
-		if (relative) {
-			user_dir = malloc (strlen (home_dir) + 1 + strlen (p) + 1);
-			strcpy (user_dir, home_dir);
-			strcat (user_dir, "/");
-		} else {
-			user_dir = malloc (strlen (p) + 1);
-			*user_dir = 0;
-		}
-
-		d = user_dir + strlen (user_dir);
-		while (*p && *p != '"')	{
-			if ((*p == '\\') && (*(p+1) != 0))
-				p++;
-			*d++ = *p++;
-		}
-		*d = 0;
-	}
-
-	fclose (file);
-
-	if (user_dir)
-		return user_dir;
-
-error:
-	 /* Special case desktop for historical compatibility */
-	if (strcmp (type, "DESKTOP") == 0) {
-		user_dir = malloc (strlen (home_dir) + strlen ("/Desktop") + 1);
-		strcpy (user_dir, home_dir);
-		strcat (user_dir, "/Desktop");
-		return user_dir;
-	}
-	else
-		return strdup (home_dir);
-}
-
-
 int
 uricmp (const char *uri1,
 	const char *uri2)
diff --git a/gthumb/glib-utils.h b/gthumb/glib-utils.h
index 692ee45..258fe47 100644
--- a/gthumb/glib-utils.h
+++ b/gthumb/glib-utils.h
@@ -204,8 +204,6 @@ void            free_regexps                     (GRegex     **regexps);
 /* URI utils */
 
 const char *    get_home_uri                     (void);
-const char *    get_desktop_uri                  (void);
-char *          xdg_user_dir_lookup              (const char *type);
 int             uricmp                           (const char *uri1,
 						  const char *uri2);
 gboolean        same_uri                         (const char *uri1,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]