[Xfce4-commits] r23380 - in xarchiver/branches/xarchiver-psybsd: . libxarchiver src

Stephan Arts stephan at xfce.org
Thu Oct 12 23:10:43 UTC 2006


Author: stephan
Date: 2006-10-12 23:10:42 +0000 (Thu, 12 Oct 2006)
New Revision: 23380

Modified:
   xarchiver/branches/xarchiver-psybsd/Makefile.am
   xarchiver/branches/xarchiver-psybsd/configure.in.in
   xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
   xarchiver/branches/xarchiver-psybsd/src/archive_store.c
Log:
removed libxamime (bad idea) and moved thunar-vfs dependant code to separate part of libxarchiver



Modified: xarchiver/branches/xarchiver-psybsd/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/Makefile.am	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/Makefile.am	2006-10-12 23:10:42 UTC (rev 23380)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = libxamime libxarchiver src tests po
+SUBDIRS = libxarchiver src tests po
 
 pixmapsdir       = $(datadir)/pixmaps
 pixmaps_DATA     = pixmaps/xarchiver.png \

Modified: xarchiver/branches/xarchiver-psybsd/configure.in.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-10-12 23:10:42 UTC (rev 23380)
@@ -68,7 +68,6 @@
 src/Makefile
 tests/Makefile
 libxarchiver/Makefile
-libxamime/Makefile
 ])
 
 echo "----------------------------------------"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am	2006-10-12 23:10:42 UTC (rev 23380)
@@ -3,6 +3,7 @@
 libxarchiver_a_SOURCES =            \
 	libxarchiver.c libxarchiver.h     \
 	internals.c internals.h \
+	mime.c mime.h \
 	slist.c slist.h \
 	archive.c archive.h \
 	archive-support.c archive-support.h \

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -22,14 +22,9 @@
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <glib-object.h>
-
-#ifdef HAVE_THUNAR_VFS
-#define EXO_API_SUBJECT_TO_CHANGE
-#include <thunar-vfs/thunar-vfs.h>
-#else
 #include <gettext.h>
-#endif
 
+#include "mime.h"
 #include "archive.h"
 #include "archive-support.h"
 #include "archive-support-gnu-tar.h"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -20,14 +20,9 @@
 #include <string.h>
 #include <glib.h>
 #include <glib-object.h>
-
-#ifdef HAVE_THUNAR_VFS
-#define EXO_API_SUBJECT_TO_CHANGE
-#include <thunar-vfs/thunar-vfs.h>
-#else
 #include <gettext.h>
-#endif
 
+#include "mime.h"
 #include "archive.h"
 #include "archive-support.h"
 #include "archive-support-zip.h"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -25,9 +25,7 @@
 #include <sys/wait.h>
 #include <sys/types.h>
 
-#ifdef HAVE_THUNAR_VFS
-#include <thunar-vfs/thunar-vfs.h>
-#endif /* HAVE_THUNAR_VFS */
+#include "mime.h"
 
 #include "archive.h"
 #include "archive-support.h"
@@ -137,12 +135,7 @@
 lxa_archive_new(gchar *path, gchar *mime)
 {
 	LXAArchive *archive;
-#ifdef HAVE_THUNAR_VFS
-	ThunarVfsMimeInfo *mime_info;
-#else
 
-#endif /* HAVE_THUNAR_VFS */
-
 	archive = g_object_new(lxa_archive_get_type(), NULL);
 
 	if(path)
@@ -150,16 +143,10 @@
 	else
 		archive->path = NULL;
 
-#ifdef HAVE_THUNAR_VFS
 	if(!mime)
-		mime_info = thunar_vfs_mime_database_get_info_for_file(lxa_mime_database, archive->path, g_path_get_basename(archive->path));
+		archive->mime = lxa_mime_get_mime_type_for_file(archive->path);
 	else
-		mime_info = thunar_vfs_mime_info_new(mime, -1);
-
-	archive->mime = g_strdup(thunar_vfs_mime_info_get_name(mime_info));
-#else
-
-#endif /* HAVE_THUNAR_VFS */
+		archive->mime = g_strdup(mime);
 	
 	g_debug("Mime-type: %s", archive->mime);
 	

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -17,16 +17,8 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
  */
 
-#define EXO_API_SUBJECT_TO_CHANGE
-
 #include <glib.h>
 #include <glib-object.h>
-#ifdef HAVE_THUNAR_VFS
-#include <thunar-vfs/thunar-vfs.h>
-#else
-#include <libxamime/xa_mime.h>
-#include <gettext.h>
-#endif /* HAVE_THUNAR_VFS */
 
 #include "archive.h"
 #include "archive-support.h"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h	2006-10-12 23:10:42 UTC (rev 23380)
@@ -16,9 +16,6 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_THUNAR_VFS
-ThunarVfsMimeDatabase  *lxa_mime_database;
-#endif /* HAVE_THUNAR_VFS */
 
 const gchar            *lxa_tmp_dir;
 GSList                 *lxa_archive_support_list;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -21,16 +21,9 @@
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <glib-object.h>
-
-#ifdef HAVE_THUNAR_VFS
-#define EXO_API_SUBJECT_TO_CHANGE
-#include <thunar-vfs/thunar-vfs.h>
-#else
 #include <gettext.h>
-#include <libxamime/xa_mime.h>
-typedef struct _GtkIconTheme GtkIconTheme;
-#endif
 
+#include "mime.h"
 
 #include "libxarchiver.h"
 #include "libxarchiver/archive-support-zip.h"
@@ -44,11 +37,9 @@
 lxa_init()
 {
 	lxa_tmp_dir = g_get_tmp_dir();
-#ifdef HAVE_THUNAR_VFS
-	thunar_vfs_init();
-	lxa_mime_database = thunar_vfs_mime_database_get_default();
-#endif /* HAVE_THUNAR_VFS */
 
+	lxa_mime_init();
+
 	lxa_register_support(lxa_archive_support_zip_new());
 	lxa_register_support(lxa_archive_support_gnu_tar_new());
 	/* TODO: Implement right commands in unrar
@@ -61,9 +52,8 @@
 lxa_destroy()
 {
 	g_slist_foreach(lxa_archive_support_list, (GFunc)g_object_unref, NULL);
-#ifdef HAVE_THUNAR_VFS
-	g_object_unref(lxa_mime_database);
-#endif /* HAVE_THUNAR_VFS */
+
+	lxa_mime_destroy();
 }
 
 /*
@@ -116,17 +106,3 @@
 	g_object_unref(archive);
 }
 
-void
-lxa_convert_mime_to_icon_name(GtkIconTheme *icon_theme, GValue *value)
-{
-	const gchar *mime_type = g_value_get_string(value);
-#ifdef HAVE_THUNAR_VFS
-	ThunarVfsMimeInfo *mime_info = thunar_vfs_mime_database_get_info(lxa_mime_database, mime_type);
-	const gchar *icon_name = thunar_vfs_mime_info_lookup_icon_name(mime_info, icon_theme);
-	if(gtk_icon_theme_has_icon(icon_theme, icon_name))
-		g_value_set_string(value, icon_name);
-	else
-#endif
-		g_value_set_string(value, NULL);
-	/* g_free((gchar *)mime_type); */
-}

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-12 22:04:49 UTC (rev 23379)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-12 23:10:42 UTC (rev 23380)
@@ -21,13 +21,8 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <libxarchiver/libxarchiver.h>
-
-#ifdef HAVE_THUNAR_VFS
-#define EXO_API_SUBJECT_TO_CHANGE
-#include <thunar-vfs/thunar-vfs.h>
-#else
+#include <libxarchiver/mime.h>
 #include <gettext.h>
-#endif
 
 #include "archive_store.h"
 
@@ -436,7 +431,7 @@
 				if(store->icon_theme)
 				{
 					g_value_set_string(value, entry->mime_type);
-					lxa_convert_mime_to_icon_name(store->icon_theme, value);
+					lxa_mime_convert_to_icon_name(store->icon_theme, value);
 				}
 			}
 		}



More information about the Xfce4-commits mailing list