nautilus r13636 - in trunk: . libnautilus-private
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r13636 - in trunk: . libnautilus-private
- Date: Tue, 22 Jan 2008 13:27:33 +0000 (GMT)
Author: alexl
Date: Tue Jan 22 13:27:33 2008
New Revision: 13636
URL: http://svn.gnome.org/viewvc/nautilus?rev=13636&view=rev
Log:
2008-01-22 Alexander Larsson <alexl redhat com>
* libnautilus-private/nautilus-file.c:
(get_description):
(update_description_for_link):
Fix leak of description
* libnautilus-private/nautilus-metafile.c:
(set_metafile_contents):
fix leak of xmlName.
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-file.c
trunk/libnautilus-private/nautilus-metafile.c
Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c (original)
+++ trunk/libnautilus-private/nautilus-file.c Tue Jan 22 13:27:33 2008
@@ -5263,12 +5263,11 @@
* Returns: Newly allocated string ready to display to the user.
*
**/
-
-static const char *
+static char *
get_description (NautilusFile *file)
{
- const char *mime_type, *description;
- static GHashTable *warned = NULL;
+ const char *mime_type;
+ char *description;
g_assert (NAUTILUS_IS_FILE (file));
@@ -5279,7 +5278,7 @@
if (g_content_type_is_unknown (mime_type) &&
nautilus_file_is_executable (file)) {
- return _("program");
+ return g_strdup (_("program"));
}
description = g_content_type_get_description (mime_type);
@@ -5287,33 +5286,15 @@
return description;
}
- if (warned == NULL) {
- warned = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- eel_debug_call_at_shutdown_with_data ((GFreeFunc)g_hash_table_destroy, warned);
- }
-
- /* We want to update gnome-vfs/data/mime/gnome-vfs.keys to include
- * English (& localizable) versions of every mime type anyone ever sees.
- */
- if (!g_hash_table_lookup (warned, mime_type)) {
- if (g_ascii_strcasecmp (mime_type, "x-directory/normal") == 0) {
- g_warning (_("Can't find description even for \"x-directory/normal\". This "
- "probably means that your gnome-vfs.keys file is in the wrong place "
- "or isn't being found for some other reason."));
- } else {
- g_warning (_("No description found for mime type \"%s\" (file is \"%s\"), "
- "please tell the gnome-vfs mailing list."),
- mime_type,
- eel_ref_str_peek (file->details->name));
- }
- g_hash_table_insert (warned, g_strdup (mime_type), GINT_TO_POINTER (1));
- }
- return mime_type;
+ return g_strdup (mime_type);
}
+/* Takes ownership of string */
static char *
-update_description_for_link (NautilusFile *file, const char *string)
+update_description_for_link (NautilusFile *file, char *string)
{
+ char *res;
+
if (nautilus_file_is_symbolic_link (file)) {
g_assert (!nautilus_file_is_broken_symbolic_link (file));
if (string == NULL) {
@@ -5323,10 +5304,12 @@
* (e.g. "folder", "plain text") to file type for symbolic link
* to that kind of file (e.g. "link to folder").
*/
- return g_strdup_printf (_("Link to %s"), string);
+ res = g_strdup_printf (_("Link to %s"), string);
+ g_free (string);
+ return res;
}
- return g_strdup (string);
+ return string;
}
static char *
Modified: trunk/libnautilus-private/nautilus-metafile.c
==============================================================================
--- trunk/libnautilus-private/nautilus-metafile.c (original)
+++ trunk/libnautilus-private/nautilus-metafile.c Tue Jan 22 13:27:33 2008
@@ -1698,10 +1698,11 @@
if (strcmp (node->name, "file") == 0) {
name = xmlGetProp (node, "name");
unescaped_name = g_uri_unescape_string (name, "/");
+ xmlFree (name);
if (unescaped_name == NULL ||
g_hash_table_lookup (hash, unescaped_name) != NULL) {
- xmlFree (name);
/* FIXME: Should we delete duplicate nodes as we discover them? */
+ g_free (unescaped_name);
} else {
g_hash_table_insert (hash, unescaped_name, node);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]