[Xfce4-commits] r23479 - in xarchiver/branches/xarchiver-psybsd: libxarchiver po src

Stephan Arts stephan at xfce.org
Fri Oct 20 07:39:11 UTC 2006


Author: stephan
Date: 2006-10-20 07:39:10 +0000 (Fri, 20 Oct 2006)
New Revision: 23479

Modified:
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/slist.c
   xarchiver/branches/xarchiver-psybsd/po/nl.po
   xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot
   xarchiver/branches/xarchiver-psybsd/src/main.c
   xarchiver/branches/xarchiver-psybsd/src/main_window.c
Log:
Used ThunarVFS a little better (saved 15MB of memory).



Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -227,7 +227,7 @@
 		return -1;
 	}
 
-	if(!lxa_archive_support_mime_supported(archive->support, archive->mime))
+	if(!lxa_archive_support_mime_supported(archive->support, lxa_mime_info_get_name(archive->mime)))
 	{
 		return 1;
 	}
@@ -287,7 +287,7 @@
 		return -1;
 	}
 
-	if(!lxa_archive_support_mime_supported(archive->support, archive->mime))
+	if(!lxa_archive_support_mime_supported(archive->support, lxa_mime_info_get_name(archive->mime)))
 	{
 		return 1;
 	}
@@ -358,7 +358,7 @@
 		return -1;
 	}
 
-	if(!lxa_archive_support_mime_supported(archive->support, archive->mime))
+	if(!lxa_archive_support_mime_supported(archive->support, lxa_mime_info_get_name(archive->mime)))
 	{
 		return 1;
 	}
@@ -406,7 +406,7 @@
 		return -1;
 	}
 
-	if(!lxa_archive_support_mime_supported(archive->support, archive->mime))
+	if(!lxa_archive_support_mime_supported(archive->support, lxa_mime_info_get_name(archive->mime)))
 	{
 		return 1;
 	}

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -21,6 +21,7 @@
 #include <glib/gstdio.h>
 #include <glib-object.h>
 
+#include "mime.h"
 #include "archive.h"
 #include "archive-support.h"
 
@@ -136,7 +137,7 @@
  *
  */
 LXAArchiveSupport *
-lxa_get_support_for_mime(gchar *mime)
+lxa_get_support_for_mime(const gchar *mime)
 {
 	return lxa_get_support_for_mime_from_slist(lxa_archive_support_list, mime);
 }
@@ -145,7 +146,7 @@
  *
  */
 LXAArchiveSupport *
-lxa_get_support_for_mime_from_slist(GSList *list, gchar *mime)
+lxa_get_support_for_mime_from_slist(GSList *list, const gchar *mime)
 {
 	GSList *result = g_slist_find_custom(list, mime, lxa_archive_support_lookup_support);
 	if(result)

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h	2006-10-20 07:39:10 UTC (rev 23479)
@@ -78,8 +78,8 @@
 gboolean             lxa_archive_support_mime_supported(LXAArchiveSupport *,const gchar *mime);
 
 gboolean             lxa_register_support(LXAArchiveSupport *);
-LXAArchiveSupport *  lxa_get_support_for_mime(gchar *mime);
-LXAArchiveSupport *  lxa_get_support_for_mime_from_slist(GSList *list, gchar *mime);
+LXAArchiveSupport *  lxa_get_support_for_mime(const gchar *mime);
+LXAArchiveSupport *  lxa_get_support_for_mime_from_slist(GSList *list, const gchar *mime);
 
 gint                 lxa_archive_support_lookup_mime(gconstpointer support_mime, gconstpointer mime);
 gint                 lxa_archive_support_lookup_support(gconstpointer support, gconstpointer mime);

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -26,7 +26,6 @@
 
 #include "mime.h"
 
-//#include "entry.h"
 #include "archive.h"
 #include "archive-support.h"
 #include "slist.h"
@@ -44,7 +43,7 @@
 struct _LXAEntry
 {
 	gchar *filename;
-	gchar *mime_type;
+	const LXAMimeInfo *mime_info;
 	gpointer props;
 	LXAEntry **children;
 	LXASList *buffer;
@@ -67,7 +66,7 @@
 lxa_archive_get_property_names(LXAArchive *archive, guint size);
 
 static LXAEntry *
-lxa_entry_new(const gchar *);
+lxa_entry_new(LXAArchive *, const gchar *);
 
 static void
 lxa_archive_entry_free(LXAArchive *, LXAEntry *);
@@ -168,7 +167,7 @@
 }
 
 LXAArchive *
-lxa_archive_new(gchar *path, gchar *mime)
+lxa_archive_new(gchar *path, const gchar *mime)
 {
 	LXAArchive *archive;
 
@@ -180,13 +179,13 @@
 		archive->path = NULL;
 
 	if(!mime)
-		archive->mime = lxa_mime_get_mime_type_for_file(archive->path);
+		archive->mime = lxa_mime_get_mime_info_for_file(archive->path);
 	else
-		archive->mime = g_strdup(mime);
+		archive->mime = lxa_mime_get_mime_info(mime);
 #ifdef DEBUG	
-	g_debug("Mime-type: %s", archive->mime);
+	g_debug("Mime-type: %s", lxa_mime_info_get_name(archive->mime));
 #endif
-	if(!lxa_get_support_for_mime(archive->mime))
+	if(!lxa_get_support_for_mime(lxa_mime_info_get_name(archive->mime)))
 	{
 		g_object_unref(archive);
 		archive = NULL;
@@ -443,7 +442,7 @@
  ******************/
 
 static LXAEntry *
-lxa_entry_new(const gchar *filename)
+lxa_entry_new(LXAArchive *archive, const gchar *filename)
 {
 	LXAEntry *entry = g_new0(LXAEntry, 1);
 
@@ -452,12 +451,12 @@
 	if(pos)
 	{
 		entry->filename = g_strndup(filename, (gsize)(pos - filename));
-		entry->mime_type = g_strdup(LXA_MIME_DIRECTORY);
+		lxa_archive_iter_set_mime(archive, entry, lxa_mime_get_mime_info(LXA_MIME_DIRECTORY));
 	}
 	else
 	{
 		entry->filename = g_strdup(filename);
-		entry->mime_type = lxa_mime_get_mime_type_for_filename(entry->filename);
+		lxa_archive_iter_set_mime(archive, entry, lxa_mime_get_mime_info_for_filename(entry->filename));
 	}
 
 	return entry;
@@ -479,8 +478,7 @@
 
 	if(entry->children)
 	{
-		/* first elemant of the array (*entry->children) contains the size of the array */
-		/* WHY DOES i end up being 2 when *entry->children == 1 ?! */
+		/* first element of the array (*entry->children) contains the size of the array */
 		for(i = 1; i <= GPOINTER_TO_INT(*entry->children); ++i)
 			lxa_archive_entry_free(archive, entry->children[i]);
 
@@ -508,7 +506,6 @@
 		}
 		g_free(entry->props);
 	}
-	g_free(entry->mime_type);
 	g_free(entry->filename);
 	g_free(entry);
 }
@@ -694,7 +691,7 @@
 gboolean
 lxa_archive_iter_is_directory(const LXAArchive *archive, const LXAArchiveIter *iter)
 {
-	if(!strcmp(lxa_archive_iter_get_mime(archive, iter), LXA_MIME_DIRECTORY))
+	if(!strcmp(lxa_archive_iter_get_mimetype(archive, iter), LXA_MIME_DIRECTORY))
 		return TRUE;
 	return FALSE;
 }
@@ -744,7 +741,7 @@
 LXAArchiveIter *
 lxa_archive_iter_add_child(LXAArchive *archive, LXAArchiveIter *parent, const gchar *filename)
 {
-	LXAEntry *entry = lxa_entry_new(filename);
+	LXAEntry *entry = lxa_entry_new(archive, filename);
 
 	lxa_archive_entry_add_child(archive, (LXAEntry *)parent, entry);
 
@@ -794,10 +791,10 @@
  *
  * returns mime type
  */
-const gchar*
-lxa_archive_iter_get_mime(const LXAArchive *archive, const LXAArchiveIter *iter)
+const gchar *
+lxa_archive_iter_get_mimetype(const LXAArchive *archive, const LXAArchiveIter *iter)
 {
-	return ((LXAEntry *)iter)->mime_type;
+	return lxa_mime_info_get_name(((LXAEntry *)iter)->mime_info);
 }
 
 /**
@@ -807,10 +804,9 @@
  * set mime type to entry
  */
 void
-lxa_archive_iter_set_mime(LXAArchive *archive, LXAArchiveIter *iter, const gchar *mime)
+lxa_archive_iter_set_mime(LXAArchive *archive, LXAArchiveIter *iter, LXAMimeInfo *mime)
 {
-	g_free(((LXAEntry *)iter)->mime_type);
-	((LXAEntry *)iter)->mime_type = g_strdup(mime);
+	((LXAEntry *)iter)->mime_info = mime;
 }
 
 /**
@@ -837,7 +833,9 @@
 #endif
 			break;
 		case LXA_ARCHIVE_PROP_MIME_TYPE:
-			lxa_archive_iter_set_mime(archive, iter, str_val);
+#ifdef DEBUG
+			g_critical("DON'T set mimetype");
+#endif
 			break;
 		default:
 			props_iter = lxa_archive_entry_get_props(archive, (LXAEntry *)iter);
@@ -1012,7 +1010,7 @@
 				props_iter += sizeof(guint);
 				break;
 			case G_TYPE_UINT64:
-				(*((guint64 *)props_iter)) = *((const guint*)props[i]);
+				(*((guint64 *)props_iter)) = *((const guint64*)props[i]);
 				props_iter += sizeof(guint64);
 				break;
 		}
@@ -1070,7 +1068,7 @@
 			retval = lxa_archive_iter_get_filename(archive, iter);
 			break;
 		case LXA_ARCHIVE_PROP_MIME_TYPE:
-			retval = lxa_archive_iter_get_mime(archive, iter);
+			retval = lxa_archive_iter_get_mimetype(archive, iter);
 			break;
 		default:
 			props_iter = ((LXAEntry *)iter)->props;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h	2006-10-20 07:39:10 UTC (rev 23479)
@@ -68,7 +68,7 @@
 {
 	GObject parent;
 	gchar              *path;
-	gchar              *mime;
+	LXAMimeInfo        *mime;
 	guint               n_property;
 	GType              *property_types;
 	gchar             **property_names;
@@ -93,42 +93,42 @@
 	GObjectClass parent;
 }; 
 
-GType           lxa_archive_get_type(void);
-LXAArchive     *lxa_archive_new(gchar *, gchar *);
+GType               lxa_archive_get_type(void);
+LXAArchive         *lxa_archive_new(gchar *, const gchar *);
 
-void            lxa_archive_set_status(LXAArchive *archive, LXAArchiveStatus status);
+void                lxa_archive_set_status(LXAArchive *archive, LXAArchiveStatus status);
 
 /* new */
-gboolean        lxa_archive_iter_is_directory(const LXAArchive *, const LXAArchiveIter *);
-guint           lxa_archive_iter_n_children(const LXAArchive *, const LXAArchiveIter *);
-LXAArchiveIter *lxa_archive_iter_nth_child(LXAArchive *, LXAArchiveIter *, guint);
-LXAArchiveIter *lxa_archive_iter_add_child(LXAArchive *, LXAArchiveIter *, const gchar *);
-LXAArchiveIter *lxa_archive_iter_get_child(const LXAArchive *, const LXAArchiveIter *, const gchar *);
-gboolean        lxa_archive_iter_del_child(LXAArchive *, LXAArchiveIter *, LXAArchiveIter *);
+gboolean            lxa_archive_iter_is_directory(const LXAArchive *, const LXAArchiveIter *);
+guint               lxa_archive_iter_n_children(const LXAArchive *, const LXAArchiveIter *);
+LXAArchiveIter     *lxa_archive_iter_nth_child(LXAArchive *, LXAArchiveIter *, guint);
+LXAArchiveIter     *lxa_archive_iter_add_child(LXAArchive *, LXAArchiveIter *, const gchar *);
+LXAArchiveIter     *lxa_archive_iter_get_child(const LXAArchive *, const LXAArchiveIter *, const gchar *);
+gboolean            lxa_archive_iter_del_child(LXAArchive *, LXAArchiveIter *, LXAArchiveIter *);
 
 /* void            lxa_archive_iter_set_filename(LXAArchive *, LXAArchiveIter *, const gchar *); */
-void            lxa_archive_iter_set_mime(LXAArchive *, LXAArchiveIter *, const gchar *);
-void            lxa_archive_iter_set_prop_str(LXAArchive *, LXAArchiveIter *, guint, const gchar *);
-void            lxa_archive_iter_set_prop_uint(LXAArchive *, LXAArchiveIter *, guint, guint);
-void            lxa_archive_iter_set_prop_uint64(LXAArchive *, LXAArchiveIter *, guint, guint64);
-void            lxa_archive_iter_set_prop_value(LXAArchive *, LXAArchiveIter *, guint, const GValue *);
-void            lxa_archive_iter_set_props(LXAArchive *, LXAArchiveIter *, ...);
-void            lxa_archive_iter_set_propsv(LXAArchive *, LXAArchiveIter *, gconstpointer *);
+void                lxa_archive_iter_set_mime(LXAArchive *, LXAArchiveIter *, LXAMimeInfo *);
+void                lxa_archive_iter_set_prop_str(LXAArchive *, LXAArchiveIter *, guint, const gchar *);
+void                lxa_archive_iter_set_prop_uint(LXAArchive *, LXAArchiveIter *, guint, guint);
+void                lxa_archive_iter_set_prop_uint64(LXAArchive *, LXAArchiveIter *, guint, guint64);
+void                lxa_archive_iter_set_prop_value(LXAArchive *, LXAArchiveIter *, guint, const GValue *);
+void                lxa_archive_iter_set_props(LXAArchive *, LXAArchiveIter *, ...);
+void                lxa_archive_iter_set_propsv(LXAArchive *, LXAArchiveIter *, gconstpointer *);
 
-const gchar    *lxa_archive_iter_get_filename(const LXAArchive *, const LXAArchiveIter *);
-const gchar    *lxa_archive_iter_get_mime(const LXAArchive *, const LXAArchiveIter *);
-const gchar    *lxa_archive_iter_get_prop_str(const LXAArchive *, const LXAArchiveIter *, guint);
-guint           lxa_archive_iter_get_prop_uint(const LXAArchive *, const LXAArchiveIter *, guint);
-guint64         lxa_archive_iter_get_prop_uint64(const LXAArchive *, const LXAArchiveIter *, guint);
-gboolean        lxa_archive_iter_get_prop_value(const LXAArchive *, const LXAArchiveIter *, guint, GValue *);
+const gchar        *lxa_archive_iter_get_filename(const LXAArchive *, const LXAArchiveIter *);
+const gchar        *lxa_archive_iter_get_mimetype(const LXAArchive *, const LXAArchiveIter *);
+const gchar        *lxa_archive_iter_get_prop_str(const LXAArchive *, const LXAArchiveIter *, guint);
+guint               lxa_archive_iter_get_prop_uint(const LXAArchive *, const LXAArchiveIter *, guint);
+guint64             lxa_archive_iter_get_prop_uint64(const LXAArchive *, const LXAArchiveIter *, guint);
+gboolean            lxa_archive_iter_get_prop_value(const LXAArchive *, const LXAArchiveIter *, guint, GValue *);
 
-LXAArchiveIter *lxa_archive_add_file(LXAArchive *, const gchar *);
-LXAArchiveIter *lxa_archive_get_iter(LXAArchive *, const gchar *);
-GType           lxa_archive_get_property_type(LXAArchive *, guint);
-const gchar    *lxa_archive_get_property_name(LXAArchive *, guint);
-void            lxa_archive_set_property_type(LXAArchive *, guint, GType, const gchar *);
-void            lxa_archive_set_property_typesv(LXAArchive *, GType *, const gchar **);
-guint           lxa_archive_n_property(LXAArchive *);
+LXAArchiveIter     *lxa_archive_add_file(LXAArchive *, const gchar *);
+LXAArchiveIter     *lxa_archive_get_iter(LXAArchive *, const gchar *);
+GType               lxa_archive_get_property_type(LXAArchive *, guint);
+const gchar        *lxa_archive_get_property_name(LXAArchive *, guint);
+void                lxa_archive_set_property_type(LXAArchive *, guint, GType, const gchar *);
+void                lxa_archive_set_property_typesv(LXAArchive *, GType *, const gchar **);
+guint               lxa_archive_n_property(LXAArchive *);
 
 G_END_DECLS
 

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -20,6 +20,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "mime.h"
 #include "archive.h"
 #include "archive-support.h"
 

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -23,8 +23,6 @@
 #include <glib-object.h>
 #include <gettext.h>
 
-#include "mime.h"
-
 #include "libxarchiver.h"
 #include "libxarchiver/archive-support-zip.h"
 #include "libxarchiver/archive-support-rar.h"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h	2006-10-20 07:39:10 UTC (rev 23479)
@@ -20,6 +20,7 @@
 
 #define EXO_API_SUBJECT_TO_CHANGE
 
+#include <libxarchiver/mime.h>
 #include <libxarchiver/archive.h>
 #include <libxarchiver/archive-support.h>
 

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -30,8 +30,14 @@
 
 #ifdef HAVE_THUNAR_VFS
 ThunarVfsMimeDatabase  *lxa_mime_database;
+#else
+struct _LXAMimeInfo
+{
+
+};
 #endif /* HAVE_THUNAR_VFS */
 
+
 void
 lxa_mime_init()
 {
@@ -49,44 +55,57 @@
 #endif /* HAVE_THUNAR_VFS */
 }
 
-gchar *
-lxa_mime_get_mime_type_for_file(gchar *path)
+LXAMimeInfo *
+lxa_mime_get_mime_info_for_file(const gchar *path)
 {
-	gchar *result = NULL;
+	LXAMimeInfo *result = NULL;
 	gchar *base = g_path_get_basename(path);
 
 #ifdef HAVE_THUNAR_VFS
-	ThunarVfsMimeInfo *mime_info;
+	result = (LXAMimeInfo *)thunar_vfs_mime_database_get_info_for_file(lxa_mime_database, path, base);
+#else
 
-	mime_info = thunar_vfs_mime_database_get_info_for_file(lxa_mime_database, path, base);
-	
-	result = g_strdup(thunar_vfs_mime_info_get_name(mime_info));
-
-	thunar_vfs_mime_info_unref(mime_info);
-
 #endif /* HAVE_THUNAR_VFS */
 	g_free(base);
 	return result;
 }
 
-gchar *
-lxa_mime_get_mime_type_for_filename(gchar *filename)
+LXAMimeInfo *
+lxa_mime_get_mime_info_for_filename(const gchar *filename)
 {
-	gchar *result = NULL;
+	LXAMimeInfo *result = NULL;
 
 #ifdef HAVE_THUNAR_VFS
-	ThunarVfsMimeInfo *mime_info;
+	result = (LXAMimeInfo *)thunar_vfs_mime_database_get_info_for_name(lxa_mime_database, filename);
+#else
+#endif /* HAVE_THUNAR_VFS */
+	return result;
+}
 
-	mime_info = thunar_vfs_mime_database_get_info_for_name(lxa_mime_database, filename);
-	
-	result = g_strdup(thunar_vfs_mime_info_get_name(mime_info));
+LXAMimeInfo *
+lxa_mime_get_mime_info(const gchar *mime_type)
+{
+	LXAMimeInfo *result = NULL;
 
-	thunar_vfs_mime_info_unref(mime_info);
-
+#ifdef HAVE_THUNAR_VFS
+	result = (LXAMimeInfo *)thunar_vfs_mime_database_get_info(lxa_mime_database, mime_type);
+#else
 #endif /* HAVE_THUNAR_VFS */
 	return result;
+
 }
+const gchar *
+lxa_mime_info_get_name(const LXAMimeInfo *mime_info)
+{
+	const gchar *result = NULL;
+#ifdef HAVE_THUNAR_VFS
+	result = thunar_vfs_mime_info_get_name((ThunarVfsMimeInfo *)mime_info);
+#else
 
+#endif
+	return result;
+}
+
 void
 lxa_mime_convert_to_icon_name(GtkIconTheme *icon_theme, GValue *value)
 {
@@ -101,3 +120,4 @@
 #endif
 	/* g_free((gchar *)mime_type); */
 }
+

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h	2006-10-20 07:39:10 UTC (rev 23479)
@@ -1,5 +1,4 @@
-/*
- *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+/* *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,6 +20,12 @@
 
 #include <gtk/gtkicontheme.h>
 
+#ifdef HAVE_THUNAR_VFS
+typedef struct _ThunarVfsMimeInfo LXAMimeInfo;
+#else
+typedef struct _LXAMimeInfo LXAMimeInfo;
+#endif
+
 void
 lxa_mime_init();
 
@@ -30,9 +35,14 @@
 void
 lxa_mime_convert_to_icon_name(GtkIconTheme *icon_theme, GValue *value);
 
-gchar *
-lxa_mime_get_mime_type_for_file(gchar *path);
-gchar *
-lxa_mime_get_mime_type_for_filename(gchar *filename);
+LXAMimeInfo *
+lxa_mime_get_mime_info_for_file(const gchar *path);
+LXAMimeInfo *
+lxa_mime_get_mime_info_for_filename(const gchar *filename);
+LXAMimeInfo *
+lxa_mime_get_mime_info(const gchar *mime_type);
 
+const gchar *
+lxa_mime_info_get_name(const LXAMimeInfo *mime_info);
+
 #endif /* __LXA_MIME_H__ */

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/slist.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/slist.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/slist.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -3,6 +3,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "mime.h"
 #include "archive.h"
 #include "slist.h"
 

Modified: xarchiver/branches/xarchiver-psybsd/po/nl.po
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/nl.po	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/po/nl.po	2006-10-20 07:39:10 UTC (rev 23479)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: xarchiver 0.3.9psybsd\n"
 "Report-Msgid-Bugs-To: psybsd at gmail.com\n"
-"POT-Creation-Date: 2006-10-02 09:14+0200\n"
+"POT-Creation-Date: 2006-10-20 07:52+0200\n"
 "PO-Revision-Date: 2006-07-20 16:36+0200\n"
 "Last-Translator: Stephan Arts <psybsd at gmail.com>\n"
 "Language-Team: Dutch <vertaling at vrijschrift.org>\n"
@@ -16,42 +16,81 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: ../libxarchiver/archive-support-gnu-tar.c:134
-#: ../libxarchiver/archive-support-zip.c:104
+#: ../libxarchiver/archive.c:339
+msgid "Filename"
+msgstr "Bestandsnaam"
+
+#: ../libxarchiver/archive.c:341
+msgid "Mime type"
+msgstr "Mime type"
+
+#: ../libxarchiver/archive-support-gnu-tar.c:136
+#: ../libxarchiver/archive-support-zip.c:118
 msgid "Overwrite existing files"
 msgstr "Bestaande bestanden overschrijven"
 
-#: ../libxarchiver/archive-support-gnu-tar.c:135
-#: ../libxarchiver/archive-support-zip.c:105
+#: ../libxarchiver/archive-support-gnu-tar.c:137
+#: ../libxarchiver/archive-support-zip.c:119
 msgid "Overwrite existing files on extraction"
 msgstr "Bestaande bestanden overschrijven tijdens uitpakken"
 
-#: ../libxarchiver/archive-support-zip.c:97
-#: ../libxarchiver/archive-support-zip.c:98
+#: ../libxarchiver/archive-support-gnu-tar.c:417
+msgid "Permissions"
+msgstr "Rechten"
+
+#: ../libxarchiver/archive-support-gnu-tar.c:421
+msgid "Owner/Group"
+msgstr "Eigenaar/Groep"
+
+#: ../libxarchiver/archive-support-gnu-tar.c:425
+#: ../libxarchiver/archive-support-zip.c:327
+msgid "Size"
+msgstr "Grootte"
+
+#: ../libxarchiver/archive-support-gnu-tar.c:429
+#: ../libxarchiver/archive-support-zip.c:339
+msgid "Date"
+msgstr "Datum"
+
+#: ../libxarchiver/archive-support-gnu-tar.c:433
+#: ../libxarchiver/archive-support-zip.c:345
+msgid "Time"
+msgstr "Tijd"
+
+#: ../libxarchiver/archive-support-zip.c:111
+#: ../libxarchiver/archive-support-zip.c:112
 msgid "Password"
 msgstr "Wachtwoord"
 
-#: ../src/main.c:47
+#: ../libxarchiver/archive-support-zip.c:315
+msgid "Length"
+msgstr ""
+
+#: ../libxarchiver/archive-support-zip.c:321
+msgid "Compression method"
+msgstr "Compressie methode"
+
+#: ../src/main.c:51
 msgid "[destination path]"
 msgstr "[bestemmings map]"
 
-#: ../src/main.c:55
+#: ../src/main.c:59
 msgid "[archive path] [file1] [file2] ... [fileN]"
 msgstr "[archief map] [bestand1] [bestand2] ... [bestandN]"
 
-#: ../src/main.c:59
+#: ../src/main.c:63
 msgid "[file1] [file2] ... [fileN]"
 msgstr "[bestand1] [bestand2] ... [bestandN]"
 
-#: ../src/main.c:62
+#: ../src/main.c:66
 msgid "Version information"
 msgstr "Versie informatie"
 
-#: ../src/main.c:120
+#: ../src/main.c:124
 msgid "[archive name]"
 msgstr "[archief naam]"
 
-#: ../src/main.c:124
+#: ../src/main.c:128
 #, c-format
 msgid ""
 "%s: %s\n"
@@ -64,7 +103,7 @@
 #.
 #. * Could not create archive (mime type unsupported)
 #.
-#: ../src/main.c:197
+#: ../src/main.c:199
 msgid "Could not create archive, MIME-type unsupported"
 msgstr "Kan archief niet maken, MIME-type wordt niet ondersteund"
 
@@ -72,101 +111,108 @@
 #. * Could not open archive (mime type not supported or file did not exist)
 #. * Should be a more specific error message.
 #.
-#: ../src/main.c:214
+#: ../src/main.c:216
 msgid "Could not open archive, MIME-type unsupported or file did not exist"
 msgstr ""
 "Kan archief niet openen, MIME-type wordt niet ondersteund of bestand bestaat "
 "niet"
 
-#: ../src/main_window.c:107 ../src/main_window.c:108
+#: ../src/main.c:256
+#, c-format
+msgid ""
+"Xarchiver\n"
+"ERROR: Could not open file \"%s\""
+msgstr ""
+
+#: ../src/main_window.c:121 ../src/main_window.c:122
 msgid "Show icons"
 msgstr ""
 
-#: ../src/main_window.c:134
+#: ../src/main_window.c:179
 msgid "_Archive"
 msgstr "_Archief"
 
-#: ../src/main_window.c:135
+#: ../src/main_window.c:180
 msgid "A_ction"
 msgstr "A_ctie"
 
-#: ../src/main_window.c:136
+#: ../src/main_window.c:181
 msgid "_Help"
 msgstr "_Help"
 
-#: ../src/main_window.c:180 ../src/main_window.c:225
+#: ../src/main_window.c:225 ../src/main_window.c:270
 msgid "Add"
 msgstr "Toevoegen"
 
-#: ../src/main_window.c:185 ../src/main_window.c:229
-#: ../src/extract_dialog.c:99
+#: ../src/main_window.c:230 ../src/main_window.c:274
+#: ../src/extract_dialog.c:101
 msgid "Extract"
 msgstr "Uitpakken"
 
-#: ../src/main_window.c:455
+#: ../src/main_window.c:523
 msgid "Open archive"
 msgstr "Archief openen"
 
-#: ../src/main_window.c:632
+#: ../src/main_window.c:680
 msgid "Initializing archive..."
 msgstr "Bezig met initialiseren van archief..."
 
-#: ../src/main_window.c:635
+#: ../src/main_window.c:683
 msgid "Reading archive contents..."
 msgstr "Bezig met lezen van archief..."
 
-#: ../src/main_window.c:638
+#: ../src/main_window.c:686
 msgid "Extracting archive..."
 msgstr "Archief uitpakken..."
 
-#: ../src/main_window.c:641
+#: ../src/main_window.c:689
 msgid "Adding file(s) to archive..."
 msgstr "Bestand(en) toevoegen aan archief..."
 
-#: ../src/main_window.c:644
+#: ../src/main_window.c:692
 msgid "Removing file(s) from archive..."
 msgstr "Bestand(en) toevoegen aan archief..."
 
-#: ../src/main_window.c:647
+#: ../src/main_window.c:695
 msgid "Error"
 msgstr "Fout"
 
-#: ../src/main_window.c:650
+#: ../src/main_window.c:698
 msgid "Cancelled"
 msgstr "Geannuleerd"
 
-#: ../src/main_window.c:653
+#: ../src/main_window.c:701
 msgid "Done"
 msgstr "Klaar"
 
-#: ../src/new_dialog.c:85
+#: ../src/new_dialog.c:87
 msgid "Create new archive"
 msgstr "Maak nieuw archief"
 
-#: ../src/add_dialog.c:64
+#: ../src/add_dialog.c:66
 msgid "Drag Files and folders to bottom list"
 msgstr ""
 
-#: ../src/add_dialog.c:91
+#: ../src/add_dialog.c:93
 msgid "Add file(s) to archive"
 msgstr "Bestand(en) toevoegen aan archief"
 
-#: ../src/extract_dialog.c:75
+#: ../src/extract_dialog.c:77
 msgid "<b>Extract files:</b>"
 msgstr "<b> Bestanden uitpakken:</b>"
 
-#: ../src/extract_dialog.c:76
+#: ../src/extract_dialog.c:78
 msgid "<b>Options:</b>"
 msgstr "<b>Opties:</b>"
 
-#: ../src/extract_dialog.c:86
+#: ../src/extract_dialog.c:88
 msgid "All files"
 msgstr "Alle bestanden"
 
-#: ../src/extract_dialog.c:87
+#: ../src/extract_dialog.c:89
 msgid "Selected files"
 msgstr "Geselecteerde bestanden"
 
-#: ../src/extract_dialog.c:111
+#: ../src/extract_dialog.c:113
 msgid "Extract archive"
 msgstr "Archief uitpakken"

Modified: xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot	2006-10-20 07:39:10 UTC (rev 23479)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: psybsd at gmail.com\n"
-"POT-Creation-Date: 2006-09-25 00:02+0200\n"
+"POT-Creation-Date: 2006-10-20 07:52+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -16,42 +16,81 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../libxarchiver/archive-support-gnu-tar.c:133
-#: ../libxarchiver/archive-support-zip.c:104
+#: ../libxarchiver/archive.c:339
+msgid "Filename"
+msgstr ""
+
+#: ../libxarchiver/archive.c:341
+msgid "Mime type"
+msgstr ""
+
+#: ../libxarchiver/archive-support-gnu-tar.c:136
+#: ../libxarchiver/archive-support-zip.c:118
 msgid "Overwrite existing files"
 msgstr ""
 
-#: ../libxarchiver/archive-support-gnu-tar.c:134
-#: ../libxarchiver/archive-support-zip.c:105
+#: ../libxarchiver/archive-support-gnu-tar.c:137
+#: ../libxarchiver/archive-support-zip.c:119
 msgid "Overwrite existing files on extraction"
 msgstr ""
 
-#: ../libxarchiver/archive-support-zip.c:97
-#: ../libxarchiver/archive-support-zip.c:98
+#: ../libxarchiver/archive-support-gnu-tar.c:417
+msgid "Permissions"
+msgstr ""
+
+#: ../libxarchiver/archive-support-gnu-tar.c:421
+msgid "Owner/Group"
+msgstr ""
+
+#: ../libxarchiver/archive-support-gnu-tar.c:425
+#: ../libxarchiver/archive-support-zip.c:327
+msgid "Size"
+msgstr ""
+
+#: ../libxarchiver/archive-support-gnu-tar.c:429
+#: ../libxarchiver/archive-support-zip.c:339
+msgid "Date"
+msgstr ""
+
+#: ../libxarchiver/archive-support-gnu-tar.c:433
+#: ../libxarchiver/archive-support-zip.c:345
+msgid "Time"
+msgstr ""
+
+#: ../libxarchiver/archive-support-zip.c:111
+#: ../libxarchiver/archive-support-zip.c:112
 msgid "Password"
 msgstr ""
 
-#: ../src/main.c:47
+#: ../libxarchiver/archive-support-zip.c:315
+msgid "Length"
+msgstr ""
+
+#: ../libxarchiver/archive-support-zip.c:321
+msgid "Compression method"
+msgstr ""
+
+#: ../src/main.c:51
 msgid "[destination path]"
 msgstr ""
 
-#: ../src/main.c:55
+#: ../src/main.c:59
 msgid "[archive path] [file1] [file2] ... [fileN]"
 msgstr ""
 
-#: ../src/main.c:59
+#: ../src/main.c:63
 msgid "[file1] [file2] ... [fileN]"
 msgstr ""
 
-#: ../src/main.c:62
+#: ../src/main.c:66
 msgid "Version information"
 msgstr ""
 
-#: ../src/main.c:119
+#: ../src/main.c:124
 msgid "[archive name]"
 msgstr ""
 
-#: ../src/main.c:123
+#: ../src/main.c:128
 #, c-format
 msgid ""
 "%s: %s\n"
@@ -61,7 +100,7 @@
 #.
 #. * Could not create archive (mime type unsupported)
 #.
-#: ../src/main.c:196
+#: ../src/main.c:199
 msgid "Could not create archive, MIME-type unsupported"
 msgstr ""
 
@@ -69,98 +108,106 @@
 #. * Could not open archive (mime type not supported or file did not exist)
 #. * Should be a more specific error message.
 #.
-#: ../src/main.c:213
+#: ../src/main.c:216
 msgid "Could not open archive, MIME-type unsupported or file did not exist"
 msgstr ""
 
-#: ../src/main_window.c:101
+#: ../src/main.c:256
+#, c-format
+msgid ""
+"Xarchiver\n"
+"ERROR: Could not open file \"%s\""
+msgstr ""
+
+#: ../src/main_window.c:121 ../src/main_window.c:122
+msgid "Show icons"
+msgstr ""
+
+#: ../src/main_window.c:179
 msgid "_Archive"
 msgstr ""
 
-#: ../src/main_window.c:102
+#: ../src/main_window.c:180
 msgid "A_ction"
 msgstr ""
 
-#: ../src/main_window.c:103
+#: ../src/main_window.c:181
 msgid "_Help"
 msgstr ""
 
-#: ../src/main_window.c:147 ../src/main_window.c:191
+#: ../src/main_window.c:225 ../src/main_window.c:270
 msgid "Add"
 msgstr ""
 
-#: ../src/main_window.c:152 ../src/main_window.c:195
-#: ../src/extract_dialog.c:99
+#: ../src/main_window.c:230 ../src/main_window.c:274
+#: ../src/extract_dialog.c:101
 msgid "Extract"
 msgstr ""
 
-#: ../src/main_window.c:357
+#: ../src/main_window.c:523
 msgid "Open archive"
 msgstr ""
 
-#: ../src/main_window.c:507
+#: ../src/main_window.c:680
 msgid "Initializing archive..."
 msgstr ""
 
-#: ../src/main_window.c:510
+#: ../src/main_window.c:683
 msgid "Reading archive contents..."
 msgstr ""
 
-#: ../src/main_window.c:513
+#: ../src/main_window.c:686
 msgid "Extracting archive..."
 msgstr ""
 
-#: ../src/main_window.c:516
+#: ../src/main_window.c:689
 msgid "Adding file(s) to archive..."
 msgstr ""
 
-#: ../src/main_window.c:519
+#: ../src/main_window.c:692
 msgid "Removing file(s) from archive..."
 msgstr ""
 
-#: ../src/main_window.c:522
+#: ../src/main_window.c:695
 msgid "Error"
 msgstr ""
 
-#: ../src/main_window.c:525
+#: ../src/main_window.c:698
 msgid "Cancelled"
 msgstr ""
 
-#: ../src/main_window.c:528
+#: ../src/main_window.c:701
 msgid "Done"
 msgstr ""
 
-#: ../src/new_dialog.c:85
+#: ../src/new_dialog.c:87
 msgid "Create new archive"
 msgstr ""
 
-#. * XA_ADD_DIALOG
-#. *  Frame title
-#.
-#: ../src/add_dialog.c:68
-msgid "Files and folders to add"
+#: ../src/add_dialog.c:66
+msgid "Drag Files and folders to bottom list"
 msgstr ""
 
-#: ../src/add_dialog.c:82
+#: ../src/add_dialog.c:93
 msgid "Add file(s) to archive"
 msgstr ""
 
-#: ../src/extract_dialog.c:75
+#: ../src/extract_dialog.c:77
 msgid "<b>Extract files:</b>"
 msgstr ""
 
-#: ../src/extract_dialog.c:76
+#: ../src/extract_dialog.c:78
 msgid "<b>Options:</b>"
 msgstr ""
 
-#: ../src/extract_dialog.c:86
+#: ../src/extract_dialog.c:88
 msgid "All files"
 msgstr ""
 
-#: ../src/extract_dialog.c:87
+#: ../src/extract_dialog.c:89
 msgid "Selected files"
 msgstr ""
 
-#: ../src/extract_dialog.c:111
+#: ../src/extract_dialog.c:113
 msgid "Extract archive"
 msgstr ""

Modified: xarchiver/branches/xarchiver-psybsd/src/main.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/src/main.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -151,7 +151,7 @@
 			{
 				g_signal_connect(G_OBJECT(lp_archive), "lxa_status_changed", G_CALLBACK(xa_archive_status_changed), NULL);
 				opened_archives++;
-				lpSupport = lxa_get_support_for_mime(lp_archive->mime);
+				lpSupport = lxa_get_support_for_mime(lxa_mime_info_get_name(lp_archive->mime));
 				if(!extract_archive_path)
   			{
 					dialog = xa_extract_archive_dialog_new(lpSupport, lp_archive, FALSE);
@@ -228,7 +228,7 @@
 		{
 			files = g_slist_prepend(files, argv[i]);
 		}
-		lpSupport = lxa_get_support_for_mime(lp_archive->mime);
+		lpSupport = lxa_get_support_for_mime(lxa_mime_info_get_name(lp_archive->mime));
 		lxa_archive_support_add(lpSupport, lp_archive, files);
 	}
 

Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-20 06:06:14 UTC (rev 23478)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-20 07:39:10 UTC (rev 23479)
@@ -473,7 +473,7 @@
 		{
 			g_debug("Archive opened");
 			g_signal_connect(G_OBJECT(window->lp_xa_archive), "lxa_status_changed", G_CALLBACK(xa_main_window_archive_status_changed), window);
-			lp_support = lxa_get_support_for_mime(window->lp_xa_archive->mime);
+			lp_support = lxa_get_support_for_mime(lxa_mime_info_get_name(window->lp_xa_archive->mime));
 
 			gtk_widget_set_sensitive(GTK_WIDGET(window->menubar.menu_item_close), TRUE);
 			gtk_widget_set_sensitive(GTK_WIDGET(window->menubar.menu_item_new), TRUE);
@@ -572,7 +572,7 @@
 	GtkTreeIter iter;
 	GtkTreeSelection *selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (window->treeview) );
 
-	lp_support = lxa_get_support_for_mime(window->lp_xa_archive->mime);
+	lp_support = lxa_get_support_for_mime(lxa_mime_info_get_name(window->lp_xa_archive->mime));
 
 
 	dialog = xa_extract_archive_dialog_new(lp_support, window->lp_xa_archive, gtk_tree_selection_count_selected_rows (selection));
@@ -656,7 +656,7 @@
 	if(!lxa_open_archive(archive_path, &window->lp_xa_archive))
 	{
 		g_signal_connect(G_OBJECT(window->lp_xa_archive), "lxa_status_changed", G_CALLBACK(xa_main_window_archive_status_changed), window);
-		lp_support = lxa_get_support_for_mime(window->lp_xa_archive->mime);
+		lp_support = lxa_get_support_for_mime(lxa_mime_info_get_name(window->lp_xa_archive->mime));
 
 		lxa_archive_support_refresh(lp_support, window->lp_xa_archive);
 		return 0;



More information about the Xfce4-commits mailing list