[Xfce4-commits] r23425 - xarchiver/branches/xarchiver-psybsd/libxarchiver

Stephan Arts stephan at xfce.org
Sun Oct 15 22:03:24 UTC 2006


Author: stephan
Date: 2006-10-15 22:03:24 +0000 (Sun, 15 Oct 2006)
New Revision: 23425

Modified:
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
Log:
Fixed hack introduced by last commit



Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-15 21:49:10 UTC (rev 23424)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-15 22:03:24 UTC (rev 23425)
@@ -205,15 +205,18 @@
 			tmp_entry = g_new0(LXAEntry, 1);
 			tmp_entry->filename = g_strdup(path_items[i]);
 			lxa_archive_entry_add_child(archive, parent, tmp_entry);
-			if(path[strlen(path)-1] == '/')
-				tmp_entry->mime_type = g_strdup("inode/directory");
-			else
-				tmp_entry->mime_type = lxa_mime_get_mime_type_for_filename(tmp_entry->filename);
-			g_free(parent->mime_type);
-			parent->mime_type = g_strdup("inode/directory");
+			if(!parent->mime_type)
+				parent->mime_type = g_strdup("inode/directory");
 		}
 		parent = tmp_entry;
 	}
+	if(!tmp_entry->mime_type)
+	{
+		if(path[strlen(path)-1] == '/')
+			tmp_entry->mime_type = g_strdup("inode/directory");
+		else
+			tmp_entry->mime_type = lxa_mime_get_mime_type_for_filename(tmp_entry->filename);
+	}
 	g_strfreev(path_items);
 	return tmp_entry;
 }



More information about the Xfce4-commits mailing list