[Xfce4-commits] <squeeze:master> Squeeze compiles

Stephan Arts noreply at xfce.org
Sat Aug 20 14:56:03 CEST 2011


Updating branch refs/heads/master
         to d37bdd22e69608db7fd67571ad1b48012c27cc82 (commit)
       from a47e5a11992aba2b2666456c989c626e8c9e4133 (commit)

commit d37bdd22e69608db7fd67571ad1b48012c27cc82
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Aug 20 14:56:02 2011 +0200

    Squeeze compiles

 configure.in.in            |    1 +
 libsqueeze/Makefile.am     |   14 +-
 libsqueeze/archive.h       |    2 -
 libsqueeze/command-queue.c |    7 +-
 libsqueeze/internals.c     |    2 +-
 libsqueeze/libsqueeze.c    |    6 +-
 libsqueeze/libsqueeze.h    |    2 +
 po/squeeze.pot             |  346 --------------------------------------------
 src/Makefile.am            |   31 +++--
 src/application.c          |   39 +++---
 src/application.h          |    6 +-
 src/archive_store.c        |    9 +-
 src/button_drag_box.c      |    2 +-
 src/extract_dialog.c       |    4 +-
 src/main.c                 |   24 ++-
 src/main_window.c          |   22 ++-
 src/main_window.h          |    2 +-
 src/message_dialog.c       |    5 +-
 src/navigation_bar.c       |    3 +-
 src/new_dialog.c           |   23 +--
 src/new_dialog.h           |    2 +-
 src/notebook.c             |   12 +-
 src/path_bar.c             |    3 +-
 src/preferences_dialog.c   |    2 +-
 src/properties_dialog.c    |    2 +-
 src/throbber.c             |    6 +-
 src/tool_bar.c             |    4 +-
 src/widget_factory.c       |    2 +-
 28 files changed, 136 insertions(+), 447 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 343cf1d..fdaa366 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -50,6 +50,7 @@ AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""])
 
 dnl check for standard header files
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
 AC_PROG_INTLTOOL([0.31], [no-xml])
 
diff --git a/libsqueeze/Makefile.am b/libsqueeze/Makefile.am
index 419501a..6d4f3b1 100644
--- a/libsqueeze/Makefile.am
+++ b/libsqueeze/Makefile.am
@@ -1,6 +1,6 @@
-lib_LTLIBRARIES = libsqueeze-1.la
+lib_LTLIBRARIES = libsqueeze-2.la
 
-libsqueeze_1_la_SOURCES =  \
+libsqueeze_2_la_SOURCES =  \
 	archive.c archive.h \
 	archive-iter-pool.c archive-iter-pool.h \
 	archive-iter.c archive-iter.h \
@@ -24,16 +24,20 @@ libsqueeze_1_la_SOURCES =  \
 # remove-command.c remove-command.h
 # xfce-launch-command.c xfce-launch-command.h
 
-libsqueeze_1_la_CFLAGS = \
+libsqueeze_2_la_CFLAGS = \
 	-DDATADIR=\"$(datadir)\" \
 	$(GLIB_CFLAGS)  \
 	$(DBUS_CFLAGS)  \
 	$(GIO_CFLAGS)   \
     $(LIBXFCE4UTIL_CFLAGS)
 
-libsqueeze_1_la_LIBADD =
+libsqueeze_2_la_LIBADD = \
+	$(GLIB_LIBS)  \
+	$(DBUS_LIBS)  \
+	$(GIO_LIBS)   \
+    $(LIBXFCE4UTIL_LIBS)
 
-libsqueeze_1_la_LDFLAGS = \
+libsqueeze_2_la_LDFLAGS = \
   -version-info $(SQUEEZE_VERINFO)
 
 libsqueeze_includedir= \
diff --git a/libsqueeze/archive.h b/libsqueeze/archive.h
index bb61f58..b2ba3a5 100644
--- a/libsqueeze/archive.h
+++ b/libsqueeze/archive.h
@@ -93,8 +93,6 @@ struct _LSQArchiveClass
 
 GType		   lsq_archive_get_type(void);
 
-gchar		  *lsq_archive_get_path(const LSQArchive *archive);
-const gchar	*lsq_archive_get_filename(const LSQArchive *archive);
 const gchar	*lsq_archive_get_mimetype(const LSQArchive *archive);
 gboolean		lsq_archive_exists(const LSQArchive *archive);
 LSQSupportType  lsq_archive_get_support_mask(const LSQArchive *archive);
diff --git a/libsqueeze/command-queue.c b/libsqueeze/command-queue.c
index 4772101..0133762 100644
--- a/libsqueeze/command-queue.c
+++ b/libsqueeze/command-queue.c
@@ -111,12 +111,13 @@ static const gchar *lsq_execute_context_get_temp_file(LSQExecuteContext *ctx)
 
 static gchar *format_get_filename(const gchar *format, LSQExecuteContext *ctx)
 {
+  GFile *file = lsq_archive_get_file (ctx->archive);
   if((format[0] == '%') && (format[2] == '\0'))
   {
     switch(format[1])
     {
       case 'a':
-        return lsq_archive_get_path(ctx->archive);
+        return g_file_get_basename (file);
       case 't':
         return g_strdup(lsq_execute_context_get_temp_file(ctx));
     }
@@ -130,6 +131,7 @@ static gchar **lsq_command_entry_to_argv(LSQCommandEntry *entry, LSQExecuteConte
   guint size;
   GSList *iter;
   gchar **filei;
+  GFile *file;
   
   size = 2;
 
@@ -152,6 +154,7 @@ static gchar **lsq_command_entry_to_argv(LSQCommandEntry *entry, LSQExecuteConte
 
   for(iter = entry->args; iter; iter = iter->next)
   {
+    file = lsq_archive_get_file(ctx->archive);
     const gchar *arg = (const gchar*)iter->data;
     if((arg[0] == '%') && (arg[2] == '\0'))
     {
@@ -167,7 +170,7 @@ static gchar **lsq_command_entry_to_argv(LSQCommandEntry *entry, LSQExecuteConte
           }
           break;
         case 'a':
-          *argi++ = lsq_archive_get_path(ctx->archive);
+          *argi++ = g_file_get_path(file);
           break;
         case 't':
           *argi++ = g_strdup(lsq_execute_context_get_temp_file(ctx));
diff --git a/libsqueeze/internals.c b/libsqueeze/internals.c
index 7aede37..6619298 100644
--- a/libsqueeze/internals.c
+++ b/libsqueeze/internals.c
@@ -78,7 +78,7 @@ lsq_opened_archives_lookup_archive(gconstpointer open_archive, gconstpointer uri
 #endif
     GFile *file = g_file_new_for_path (uri);
     
-	if(g_file_is_equal (lsq_archive_get_file(LSQ_ARCHIVE(open_archive)), file))
+	if(g_file_equal (lsq_archive_get_file(LSQ_ARCHIVE(open_archive)), file))
 	{
         g_object_unref (file);
 		return 0;
diff --git a/libsqueeze/libsqueeze.c b/libsqueeze/libsqueeze.c
index ce11392..0a1c447 100644
--- a/libsqueeze/libsqueeze.c
+++ b/libsqueeze/libsqueeze.c
@@ -82,10 +82,10 @@ lsq_new_archive(GFile *file, gboolean overwrite, LSQArchive **lp_archive)
 {
 	if(overwrite)
     {
-        g_file_unlink (file);
+        g_file_trash (file, NULL, NULL);
     }
 
-	if(g_file_exists(file, NULL))
+	if(g_file_query_exists(file, NULL))
 	{
 		(*lp_archive) = NULL;
 		return 1;
@@ -106,7 +106,7 @@ lsq_new_archive(GFile *file, gboolean overwrite, LSQArchive **lp_archive)
 gint
 lsq_open_archive(GFile *file, LSQArchive **lp_archive)
 {
-	if(!g_file_exists (file, NULL))
+	if(!g_file_query_exists (file, NULL))
 	{
 		(*lp_archive) = NULL;
 		return 1;
diff --git a/libsqueeze/libsqueeze.h b/libsqueeze/libsqueeze.h
index 3b71bb5..0aa5b1f 100644
--- a/libsqueeze/libsqueeze.h
+++ b/libsqueeze/libsqueeze.h
@@ -17,6 +17,8 @@
 #ifndef __LIBSQUEEZE_H__
 #define __LIBSQUEEZE_H__
 
+#include <libxfce4util/libxfce4util.h>
+
 #include <libsqueeze/command-option.h>
 #include <libsqueeze/support-template.h>
 #include <libsqueeze/archive-iter-pool.h>
diff --git a/po/squeeze.pot b/po/squeeze.pot
deleted file mode 100644
index e3bc882..0000000
--- a/po/squeeze.pot
+++ /dev/null
@@ -1,346 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: stephan at xfce.org\n"
-"POT-Creation-Date: 2007-08-21 00:30+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"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: ../libsqueeze/archive.c:236
-msgid "Name"
-msgstr ""
-
-#: ../libsqueeze/archive.c:238
-msgid "Mime type"
-msgstr ""
-
-#: ../squeeze.desktop.in.h:1
-msgid "Archive Manager"
-msgstr ""
-
-#: ../squeeze.desktop.in.h:2
-msgid "Create and manage archives with the archive manager"
-msgstr ""
-
-#: ../squeeze.desktop.in.h:3
-msgid "Squeeze Archive Manager"
-msgstr ""
-
-#.
-#. * Could not open archive (mime type not supported or file did not exist)
-#. * Should be a more specific error message.
-#.
-#: ../src/application.c:160 ../src/application.c:250
-msgid "Could not open archive, MIME-type unsupported or file did not exist"
-msgstr ""
-
-#: ../src/application.c:191 ../src/main_window.c:826 ../src/main_window.c:1260
-msgid ""
-"Squeeze cannot extract this archive type,\n"
-"the application to support this is missing."
-msgstr ""
-
-#.
-#. * Could not create archive (mime type unsupported)
-#.
-#: ../src/application.c:233
-msgid "Could not create archive, MIME-type unsupported"
-msgstr ""
-
-#: ../src/application.c:268 ../src/main_window.c:874
-msgid ""
-"Squeeze cannot add files to this archive type,\n"
-"the application to support this is missing."
-msgstr ""
-
-#: ../src/archive_store.c:249 ../src/notebook.c:179
-msgid "Show full path"
-msgstr ""
-
-#: ../src/archive_store.c:250 ../src/notebook.c:180
-msgid "Show the full path strings for each entry"
-msgstr ""
-
-#: ../src/archive_store.c:256 ../src/notebook.c:186
-msgid "Show mime icons"
-msgstr ""
-
-#: ../src/archive_store.c:257 ../src/notebook.c:187
-msgid "Show the mime type icons for each entry"
-msgstr ""
-
-#: ../src/archive_store.c:263
-msgid "Show up dir entry"
-msgstr ""
-
-#: ../src/archive_store.c:264
-msgid "Show '..' to go to the parent directory"
-msgstr ""
-
-#: ../src/archive_store.c:270 ../src/notebook.c:193
-msgid "Sort folders before files"
-msgstr ""
-
-#: ../src/archive_store.c:271 ../src/notebook.c:194
-msgid "The folders will be put at the top of the list"
-msgstr ""
-
-#: ../src/archive_store.c:277 ../src/archive_store.c:278 ../src/notebook.c:200
-#: ../src/notebook.c:201
-msgid "Sort text case sensitive"
-msgstr ""
-
-#: ../src/extract_dialog.c:76
-msgid "<b>Extract files:</b>"
-msgstr ""
-
-#: ../src/extract_dialog.c:77
-msgid "<b>Options:</b>"
-msgstr ""
-
-#: ../src/extract_dialog.c:87
-msgid "All files"
-msgstr ""
-
-#: ../src/extract_dialog.c:88
-msgid "Selected files"
-msgstr ""
-
-#: ../src/extract_dialog.c:100 ../src/main_window.c:451
-#: ../src/main_window.c:1219
-msgid "Extract"
-msgstr ""
-
-#: ../src/extract_dialog.c:110
-msgid "Extract archive"
-msgstr ""
-
-#: ../src/main.c:51
-msgid "[destination path]"
-msgstr ""
-
-#: ../src/main.c:59
-msgid "[archive path] [file1] [file2] ... [fileN]"
-msgstr ""
-
-#: ../src/main.c:63
-msgid "[file1] [file2] ... [fileN]"
-msgstr ""
-
-#: ../src/main.c:66
-msgid "Version information"
-msgstr ""
-
-#: ../src/main.c:92
-msgid "[archive name]"
-msgstr ""
-
-#: ../src/main.c:96
-#, c-format
-msgid ""
-"%s: %s\n"
-"Try %s --help to see a full list of available command line options.\n"
-msgstr ""
-
-#: ../src/main_window.c:133
-msgid "Internal Style"
-msgstr ""
-
-#: ../src/main_window.c:134
-msgid "Tool Bar Style"
-msgstr ""
-
-#: ../src/main_window.c:135
-msgid "Path Bar Style"
-msgstr ""
-
-#: ../src/main_window.c:182
-msgid "Navigation Style"
-msgstr ""
-
-#: ../src/main_window.c:183
-msgid ""
-"Style of navigation\n"
-"The style to navigate trough the archive"
-msgstr ""
-
-#. File menu
-#: ../src/main_window.c:295
-msgid "_File"
-msgstr ""
-
-#. Action menu: ref all the childs
-#: ../src/main_window.c:323
-msgid "_Action"
-msgstr ""
-
-#: ../src/main_window.c:328
-msgid "_Add files"
-msgstr ""
-
-#: ../src/main_window.c:334
-msgid "_Add _folders"
-msgstr ""
-
-#: ../src/main_window.c:340
-msgid "_Extract"
-msgstr ""
-
-#. View menu
-#: ../src/main_window.c:373
-msgid "_View"
-msgstr ""
-
-#. Help menu
-#: ../src/main_window.c:397
-msgid "_Help"
-msgstr ""
-
-#: ../src/main_window.c:443 ../src/main_window.c:852
-msgid "Add files"
-msgstr ""
-
-#: ../src/main_window.c:447 ../src/main_window.c:894
-msgid "Add folders"
-msgstr ""
-
-#: ../src/main_window.c:724
-msgid "Open archive in new window"
-msgstr ""
-
-#: ../src/main_window.c:730
-msgid "Open archive"
-msgstr ""
-
-#: ../src/main_window.c:916
-msgid ""
-"Squeeze cannot add folders to this archive type,\n"
-"the application to support this is missing."
-msgstr ""
-
-#: ../src/main_window.c:937
-msgid "Are you sure you want to remove the selected files?"
-msgstr ""
-
-#: ../src/main_window.c:950
-msgid ""
-"Squeeze cannot remove files from this archive type,\n"
-"the application to support this is missing."
-msgstr ""
-
-#: ../src/main_window.c:999
-msgid ""
-"Are you sure you want to cancel this operation?\n"
-"This could damage the archive."
-msgstr ""
-
-#: ../src/main_window.c:1081
-msgid "Lead developer:"
-msgstr ""
-
-#: ../src/main_window.c:1084
-msgid "Contributors:"
-msgstr ""
-
-#: ../src/main_window.c:1087
-msgid "Inspired by Xarchiver, written by Giuseppe Torelli"
-msgstr ""
-
-#: ../src/main_window.c:1089
-msgid "Application Icon:"
-msgstr ""
-
-#: ../src/main_window.c:1092
-msgid "Add / Extract icons:"
-msgstr ""
-
-#: ../src/main_window.c:1093
-msgid "Based on the original extract icon created by Andreas Nilsson"
-msgstr ""
-
-#: ../src/main_window.c:1100
-msgid ""
-"Squeeze is a lightweight and flexible archive manager for the Xfce Desktop "
-"Environment"
-msgstr ""
-
-#. Translator credits as shown in the about dialog: NAME <E-MAIL> YEAR
-#: ../src/main_window.c:1108
-msgid "translator-credits"
-msgstr ""
-
-#: ../src/main_window.c:1137 ../src/main_window.c:1208
-#: ../src/main_window.c:1376
-msgid "Done"
-msgstr ""
-
-#: ../src/main_window.c:1218
-msgid "Which action do you want to perform on the selected file(s)?"
-msgstr ""
-
-#: ../src/main_window.c:1219
-msgid "Open"
-msgstr ""
-
-#: ../src/main_window.c:1233
-msgid ""
-"Squeeze cannot view this file.\n"
-"the application to support this is missing."
-msgstr ""
-
-#: ../src/main_window.c:1301
-msgid "Failed to open file"
-msgstr ""
-
-#: ../src/main_window.c:1302
-#, c-format
-msgid ""
-"'%s'\n"
-"Could not be opened"
-msgstr ""
-
-#: ../src/new_dialog.c:69
-msgid "Archive type:"
-msgstr ""
-
-#: ../src/new_dialog.c:80
-msgid "Archives"
-msgstr ""
-
-#: ../src/new_dialog.c:108
-msgid "Create new archive"
-msgstr ""
-
-#: ../src/notebook.c:207
-msgid "Rules hint"
-msgstr ""
-
-#: ../src/notebook.c:208
-msgid "Make the row background colors alternate"
-msgstr ""
-
-#: ../src/path_bar.c:141
-msgid "Spacing"
-msgstr ""
-
-#: ../src/path_bar.c:142
-msgid "The amount of space between the path buttons"
-msgstr ""
-
-#: ../src/tool_bar.c:167
-msgid "Location:"
-msgstr ""
-
-#: ../src/message_dialog.c:158
-msgid "Archive manager"
-msgstr ""
diff --git a/src/Makefile.am b/src/Makefile.am
index 4dbbb4c..45633ed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,6 @@ else
 TOOLBAR_FILES =
 endif
 
-
 squeeze_SOURCES = \
 	main.c main.h \
 	application.c application.h \
@@ -32,23 +31,31 @@ squeeze_SOURCES = \
 #	location_entry.c location_entry.h
 
 squeeze_CFLAGS = \
-	@GTK_CFLAGS@ \
-	@GLIB_CFLAGS@ \
-	@DBUS_CFLAGS@ \
-	$(THUNAR_VFS_CFLAGS) \
-	$(XFCE4UTIL_CFLAGS) \
+	$(GTK_CFLAGS) \
+	$(GLIB_CFLAGS) \
+	$(DBUS_CFLAGS) \
+    $(GIO_CFLAGS) \
+	$(LIBXFCE4UTIL_CFLAGS) \
 	-DDATADIR=\"$(datadir)\" \
 	-DSRCDIR=\"$(top_srcdir)\" \
 	-DLOCALEDIR=\"$(localedir)\"
  
 squeeze_LDADD = \
-	$(top_builddir)/libsqueeze/libsqueeze-1.la \
-	@GTK_LIBS@ \
-	@GLIB_LIBS@ \
-	@DBUS_LIBS@ \
-	@THUNAR_VFS_LIBS@ 
+	$(top_builddir)/libsqueeze/libsqueeze-2.la \
+    $(GTK_LIBS) \
+    $(GLIB_LIBS) \
+    $(GTHREAD_LIBS) \
+    $(GIO_LIBS) \
+    $(LIBEXIF_LIBS) \
+    $(CAIRO_LIBS) \
+    $(XFCONF_LIBS) \
+    $(LIBXFCE4UTIL_LIBS) \
+    -lX11
 
-# squeeze_LDFLAGS = -static
+squeeze_LDFLAGS = \
+    -no-undefined                           \
+    $(LIBSM_LDFLAGS)                        \
+    $(PLATFORM_LDFLAGS)
 
 
 INCLUDES = \
diff --git a/src/application.c b/src/application.c
index 21f5b63..0513edd 100644
--- a/src/application.c
+++ b/src/application.c
@@ -18,7 +18,9 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 
 #include "new_dialog.h"
@@ -144,11 +146,11 @@ sq_application_new_window(SQApplication *app)
 }
 
 gint
-sq_application_extract_archive(SQApplication *app, gchar *archive_path, gchar *dest_path)
+sq_application_extract_archive(SQApplication *app, GFile *file, gchar *dest_path)
 {
 	GtkWidget *dialog = NULL;
 	LSQArchive *lp_archive = NULL;
-	if(lsq_open_archive(archive_path, &lp_archive))
+	if(lsq_open_archive(file, &lp_archive))
 	{
 		/*
 		 * Could not open archive (mime type not supported or file did not exist)
@@ -197,13 +199,13 @@ sq_application_extract_archive(SQApplication *app, gchar *archive_path, gchar *d
 }
 
 gint
-sq_application_new_archive(SQApplication *app, gchar *archive_path, GSList *files)
+sq_application_new_archive(SQApplication *app, GFile *file, GSList *files)
 {
 	GtkWidget *dialog = NULL;
 	gint result = 0;
 	LSQArchive *lp_archive = NULL;
 
-	if(!archive_path)
+	if(!file)
 	{
 		dialog = sq_new_archive_dialog_new();
 		/* FIXME, does not work correctly when there are more dots in a filename then the one identifying the extention */
@@ -218,10 +220,10 @@ sq_application_new_archive(SQApplication *app, gchar *archive_path, GSList *file
 		}
 		if(result == GTK_RESPONSE_OK)
 		{
-			archive_path = sq_new_archive_dialog_get_filename(SQ_NEW_ARCHIVE_DIALOG(dialog));
+			file = sq_new_archive_dialog_get_file(SQ_NEW_ARCHIVE_DIALOG(dialog));
 			gtk_widget_destroy (GTK_WIDGET (dialog) );
 		}
-		if(lsq_new_archive(archive_path, TRUE, NULL, &lp_archive))
+		if(lsq_new_archive(file, TRUE, &lp_archive))
 		{
 			/* 
 			 * Could not create archive (mime type unsupported) 
@@ -232,12 +234,12 @@ sq_application_new_archive(SQApplication *app, gchar *archive_path, GSList *file
 			gtk_widget_destroy (GTK_WIDGET (dialog) );
 			return 1;
 		}
-		g_free(archive_path);
-		archive_path = NULL;
+		g_object_unref(file);
+        file = NULL;
 	}
 	else
 	{
-		if(lsq_open_archive(archive_path, &lp_archive))
+		if(lsq_open_archive(file, &lp_archive))
 		{
 			/*
 			 * Could not open archive (mime type not supported or file did not exist)
@@ -256,11 +258,12 @@ sq_application_new_archive(SQApplication *app, gchar *archive_path, GSList *file
 	if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, NULL, NULL))
 	{
 		/* FIXME: show warning dialog */
-		GtkWidget *warning_dialog = gtk_message_dialog_new(NULL, 
-																											 GTK_DIALOG_DESTROY_WITH_PARENT, 
-																											 GTK_MESSAGE_WARNING,
-																											 GTK_BUTTONS_CLOSE,
-																											 _("Squeeze cannot add files to this archive type,\nthe application to support this is missing."));
+		GtkWidget *warning_dialog = gtk_message_dialog_new(
+                NULL, 
+                GTK_DIALOG_DESTROY_WITH_PARENT, 
+                GTK_MESSAGE_WARNING,
+                GTK_BUTTONS_CLOSE,
+                _("Squeeze cannot add files to this archive type,\nthe application to support this is missing."));
 		gtk_dialog_run (GTK_DIALOG (warning_dialog) );
 		gtk_widget_destroy(warning_dialog);
 	}
@@ -269,7 +272,7 @@ sq_application_new_archive(SQApplication *app, gchar *archive_path, GSList *file
 }
 
 gint
-sq_application_open_archive(SQApplication *app, GtkWidget *window, gchar *path)
+sq_application_open_archive(SQApplication *app, GtkWidget *window, GFile *file)
 {
 	gint retval = 0;
 
@@ -279,11 +282,11 @@ sq_application_open_archive(SQApplication *app, GtkWidget *window, gchar *path)
 	}
 	if(app->props._tabs)
 	{
-		retval = sq_main_window_open_archive(SQ_MAIN_WINDOW(window), path, -1);
+		retval = sq_main_window_open_archive(SQ_MAIN_WINDOW(window), file, -1);
 	}
 	else
 	{
-		retval = sq_main_window_open_archive(SQ_MAIN_WINDOW(window), path, 0);
+		retval = sq_main_window_open_archive(SQ_MAIN_WINDOW(window), file, 0);
 	}
 	gtk_widget_show(window);
 	return retval;
diff --git a/src/application.h b/src/application.h
index f723441..5b79074 100644
--- a/src/application.h
+++ b/src/application.h
@@ -62,10 +62,10 @@ SQApplication *sq_application_new(GtkIconTheme *icon_theme);
 
 GtkWidget *sq_application_new_window(SQApplication *);
 
-gint sq_application_extract_archive(SQApplication *, gchar *, gchar *);
-gint sq_application_new_archive(SQApplication *, gchar *, GSList *);
+gint sq_application_extract_archive(SQApplication *, GFile *, gchar *);
+gint sq_application_new_archive(SQApplication *, GFile *, GSList *);
 
-gint sq_application_open_archive(SQApplication *, GtkWidget *, gchar *);
+gint sq_application_open_archive(SQApplication *, GtkWidget *, GFile *);
 
 G_END_DECLS
 #endif /* __SQRCHIVER_APPLICATION_H__*/
diff --git a/src/archive_store.c b/src/archive_store.c
index c43d09a..25fc7f8 100644
--- a/src/archive_store.c
+++ b/src/archive_store.c
@@ -19,7 +19,9 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
+
 #include <libsqueeze/libsqueeze.h>
 
 #include "archive_store.h"
@@ -953,15 +955,16 @@ sq_archive_insertionsort(SQArchiveStore *store, gint left, gint right)
 static const gchar *
 sq_archive_store_get_icon_name_for_iter(SQArchiveStore *store, LSQArchiveIter *iter)
 {
-	ThunarVfsMimeDatabase *mimedb = thunar_vfs_mime_database_get_default();
+    /*
 	ThunarVfsMimeInfo *mime_info = thunar_vfs_mime_database_get_info(mimedb, lsq_archive_iter_get_mime(iter));
 	const gchar *icon_name = thunar_vfs_mime_info_lookup_icon_name(mime_info, store->icon_theme);
 	if(icon_name && !gtk_icon_theme_has_icon(store->icon_theme, icon_name))
 		icon_name = NULL;
-	/* may we do this? */
 	thunar_vfs_mime_info_unref(mime_info);
 	g_object_unref(mimedb);
 	return icon_name;
+    */
+    return NULL;
 }
 
 GtkTreeModel *
diff --git a/src/button_drag_box.c b/src/button_drag_box.c
index 87b6001..dadc08d 100644
--- a/src/button_drag_box.c
+++ b/src/button_drag_box.c
@@ -20,7 +20,7 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
 #include <libsqueeze/libsqueeze.h>
 #include "archive_store.h"
 #include "button_drag_box.h"
diff --git a/src/extract_dialog.c b/src/extract_dialog.c
index 8c943d3..2e3105c 100644
--- a/src/extract_dialog.c
+++ b/src/extract_dialog.c
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
 #include <libsqueeze/libsqueeze.h>
 
 #include "extract_dialog.h"
@@ -127,7 +127,7 @@ sq_extract_archive_dialog_new(LSQArchive *archive, gboolean sel_option)
   }
 
 	/* FIXME, does not work correctly when there are more dots in a filename then the one identifying the extention */
-	gchar **filename_components = g_strsplit(g_path_get_basename(lsq_archive_get_filename(archive)), ".", 2);
+	gchar **filename_components = g_strsplit(g_file_get_basename(lsq_archive_get_file(archive)), ".", 2);
 	gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename_components[0]);
 	g_strfreev(filename_components);
 
diff --git a/src/main.c b/src/main.c
index 1e01df2..d0192ec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,7 +19,9 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
+
 #include <libsqueeze/libsqueeze.h>
 
 #include "settings.h"
@@ -82,6 +84,7 @@ int main(int argc, char **argv)
 	SQApplication *sq_app = NULL;
 	GError *cli_error = NULL;
 	gint i = 0;
+    GFile *file = NULL;
 
 	#ifdef ENABLE_NLS
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -100,7 +103,6 @@ int main(int argc, char **argv)
 	}
 	gchar *current_dir = g_get_current_dir();
 
-	thunar_vfs_init();
 	lsq_init();
 
 	sq_icon_theme = gtk_icon_theme_get_default();
@@ -126,8 +128,13 @@ int main(int argc, char **argv)
 		}
 		for(i = 1; i < argc; i++)
 		{
-			if(sq_application_extract_archive(sq_app, argv[i], extract_archive_path))
-				err++;
+            file = g_file_new_for_path(argv[i]);
+            if (file)
+            {
+                if(sq_application_extract_archive(sq_app, file, extract_archive_path))
+                    err++;
+                g_object_unref(file);
+            }
 		}
 		if(err)
 			return 1;
@@ -166,7 +173,7 @@ int main(int argc, char **argv)
 			files = g_slist_prepend(files, filename);
 		}
 
-		if(sq_application_new_archive(sq_app, add_archive_path, files))
+		if(sq_application_new_archive(sq_app, file, files))
 			return 1;
 	}
 
@@ -178,7 +185,11 @@ int main(int argc, char **argv)
 				main_window = sq_application_new_window(sq_app);
 			for(i = 1; i < argc; i++)
 			{
-				sq_application_open_archive(sq_app, main_window, argv[i]);
+                file = g_file_new_for_path (argv[i]);
+                if (file)
+                {
+				    sq_application_open_archive(sq_app, main_window, file);
+                }
 			}
 		} else
 		{
@@ -191,7 +202,6 @@ int main(int argc, char **argv)
 	g_object_unref(sq_app);
 	gtk_main();
 	lsq_shutdown();
-	thunar_vfs_shutdown();
 
 	return 0;
 }
diff --git a/src/main_window.c b/src/main_window.c
index 99a2f25..d55040d 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -32,7 +32,8 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 
 #ifdef HAVE_LIBXFCE4UTIL
@@ -659,7 +660,7 @@ static void
 cb_sq_main_new_archive(GtkWidget *widget, gpointer userdata)
 {
 	GtkWidget *dialog = sq_new_archive_dialog_new();
-	gchar *archive_path = NULL;
+	GFile *file = NULL;
 	SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
 	LSQArchive *archive = NULL;
 	LSQSupportType support_mask = 0;
@@ -673,9 +674,9 @@ cb_sq_main_new_archive(GtkWidget *widget, gpointer userdata)
 	}
 	if(result == GTK_RESPONSE_OK)
 	{
-		archive_path = sq_new_archive_dialog_get_filename(SQ_NEW_ARCHIVE_DIALOG(dialog));
+		file = sq_new_archive_dialog_get_file(SQ_NEW_ARCHIVE_DIALOG(dialog));
 		
-		if(!lsq_new_archive(archive_path, TRUE, NULL, &archive))
+		if(!lsq_new_archive(file, TRUE, &archive))
 		{
 			support_mask = lsq_archive_get_support_mask(archive);
 			sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, TRUE);
@@ -705,7 +706,7 @@ cb_sq_main_new_archive(GtkWidget *widget, gpointer userdata)
 		{
 
 		}
-		g_free(archive_path);
+        g_object_unref (file);
 		gtk_widget_destroy (dialog );
 	}
 
@@ -1149,7 +1150,10 @@ cb_sq_main_window_notebook_page_switched(SQNotebook *notebook, GtkNotebookPage *
 	sq_notebook_page_get_archive(notebook, &lp_archive, page_nr);
 	SQMainWindow *window = SQ_MAIN_WINDOW(data);
 
-	gtk_window_set_title(GTK_WINDOW(window), g_strconcat(PACKAGE_NAME, " - ", lsq_archive_get_filename(lp_archive), NULL));
+    GFile *file = lsq_archive_get_file(lp_archive);
+    gchar *filename = g_file_get_basename (file);
+	gtk_window_set_title(GTK_WINDOW(window), g_strconcat(PACKAGE_NAME, " - ", filename , NULL));
+    g_free (filename);
 
 	sq_main_window_new_action_menu(window, lp_archive);
 
@@ -1302,11 +1306,11 @@ cb_sq_main_window_notebook_file_activated(SQNotebook *notebook, LSQArchiveIter *
 }
 
 gint
-sq_main_window_open_archive(SQMainWindow *window, gchar *path, gint replace)
+sq_main_window_open_archive(SQMainWindow *window, GFile *file, gint replace)
 {
 	LSQArchive *archive = NULL;
 
-	if(!lsq_open_archive(path, &archive))
+	if(!lsq_open_archive(file, &archive))
 	{
 		if(replace < 0)
 			sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, FALSE);
@@ -1324,7 +1328,7 @@ sq_main_window_open_archive(SQMainWindow *window, gchar *path, gint replace)
 				GTK_MESSAGE_ERROR, 
 				GTK_BUTTONS_OK,
 				_("Failed to open file"));
-		gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), _("'%s'\nCould not be opened"), path);
+		gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), _("'%s'\nCould not be opened"), g_file_get_path (file));
 		gtk_dialog_run(GTK_DIALOG(dialog));
 		gtk_widget_destroy(dialog);
 	}
diff --git a/src/main_window.h b/src/main_window.h
index d0f281c..eb86228 100644
--- a/src/main_window.h
+++ b/src/main_window.h
@@ -144,7 +144,7 @@ GtkWidget *sq_main_window_new(SQApplication *, GtkIconTheme *icon_theme);
 GtkWidget *sq_main_window_find_image(gchar *, GtkIconSize);
 GType	  sq_main_window_get_type ();
 
-gint sq_main_window_open_archive(SQMainWindow *window, gchar *path, gint replace);
+gint sq_main_window_open_archive(SQMainWindow *window, GFile *file, gint replace);
 
 
 G_END_DECLS
diff --git a/src/message_dialog.c b/src/message_dialog.c
index 159d962..b649b92 100644
--- a/src/message_dialog.c
+++ b/src/message_dialog.c
@@ -17,7 +17,8 @@
 #include <config.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 
 #include "message_dialog.h"
@@ -168,7 +169,7 @@ sq_message_dialog_new(GtkWindowType type, LSQArchive *archive)
 
 	g_timeout_add(200, (GSourceFunc)sq_message_dialog_progressbar_pulse, dialog);
 
-	gtk_label_set_text(GTK_LABEL(dialog->message_label), lsq_archive_get_path(archive));
+	gtk_label_set_text(GTK_LABEL(dialog->message_label), g_file_get_path(lsq_archive_get_file(archive)));
 
 	return (GtkWidget*)dialog;
 }
diff --git a/src/navigation_bar.c b/src/navigation_bar.c
index 8f1f81d..0e2604b 100644
--- a/src/navigation_bar.c
+++ b/src/navigation_bar.c
@@ -18,7 +18,8 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 #include "archive_store.h"
 #include "navigation_bar.h"
diff --git a/src/new_dialog.c b/src/new_dialog.c
index 05bb8a7..8ac17ce 100644
--- a/src/new_dialog.c
+++ b/src/new_dialog.c
@@ -20,7 +20,8 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 
 #include "new_dialog.h"
@@ -114,20 +115,13 @@ sq_new_archive_dialog_new()
 	return dialog;
 }
 
-gchar *
-sq_new_archive_dialog_get_filename(SQNewArchiveDialog *dialog)
+GFile *
+sq_new_archive_dialog_get_file(SQNewArchiveDialog *dialog)
 {
-	gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+	GFile *file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER(dialog));
 
-	gchar *base = g_path_get_basename(filename);
-	if(lsq_is_supported(base))
+    if (file)
 	{
-		g_free(base);
-		return filename;
-	}
-	else
-	{
-		g_free(base);
 		gint i;
 		GSList *_supported_mime_types = dialog->supported_mime_types;
 		for(i = 0; i < gtk_combo_box_get_active(GTK_COMBO_BOX(dialog->archive_types_combo)); i++)
@@ -151,9 +145,6 @@ sq_new_archive_dialog_get_filename(SQNewArchiveDialog *dialog)
 		if(!strcmp(mime_type, "application/x-bzip"))  suffix = ".bz2";
 		if(!strcmp(mime_type, "application/x-lzop"))  suffix = ".lzo";
 		if(!strcmp(mime_type, "application/x-compress"))  suffix = ".Z";
-		base = filename;
-		filename = g_strconcat(base, suffix, NULL);
-		g_free(base);
-		return filename;
 	}
+    return file;
 }
diff --git a/src/new_dialog.h b/src/new_dialog.h
index 2167d8a..21668d5 100644
--- a/src/new_dialog.h
+++ b/src/new_dialog.h
@@ -57,7 +57,7 @@ struct _SQNewArchiveDialogClass
 
 GType sq_new_archive_dialog_get_type();
 GtkWidget *sq_new_archive_dialog_new();
-gchar *sq_new_archive_dialog_get_filename(SQNewArchiveDialog *dialog);
+GFile *sq_new_archive_dialog_get_file(SQNewArchiveDialog *dialog);
 
 G_END_DECLS
 #endif /* __SQRCHIVER_NEW_ARCHIVE_DIALOG_H__ */
diff --git a/src/notebook.c b/src/notebook.c
index eaba8b0..25487bd 100644
--- a/src/notebook.c
+++ b/src/notebook.c
@@ -18,7 +18,9 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
+
 #include <libsqueeze/libsqueeze.h>
 #include "settings.h"
 #include "archive_store.h"
@@ -496,7 +498,9 @@ void
 sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_archive)
 {
 	GtkWidget *lbl_hbox = gtk_hbox_new(FALSE, 0);
-	GtkWidget *label = gtk_label_new(lsq_archive_get_filename(archive));
+    GFile *file = lsq_archive_get_file(archive);
+    gchar *filename = g_file_get_basename(file);
+	GtkWidget *label = gtk_label_new(filename);
 	GtkWidget *archive_image = gtk_image_new_from_icon_name("unknown", GTK_ICON_SIZE_MENU);
 	GtkWidget *throbber = sq_throbber_new();
 	GtkWidget *alignment = gtk_alignment_new(0.5,0.5,1,1);
@@ -519,7 +523,8 @@ sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_
 
 	gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE);
 	gtk_label_set_max_width_chars(GTK_LABEL(label), 20);
-	gtk_tooltips_set_tip(notebook->tool_tips, label, lsq_archive_get_filename(archive), NULL);
+    
+	gtk_tooltips_set_tip(notebook->tool_tips, label, g_file_get_basename(lsq_archive_get_file(archive)), NULL);
 
 	GtkWidget *tree_view = gtk_tree_view_new();
 	g_signal_connect(G_OBJECT(tree_view), "notify", G_CALLBACK(cb_sq_notebook_notify_proxy), notebook);
@@ -576,6 +581,7 @@ sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, gboolean new_
 	{
 		lsq_archive_operate(archive, LSQ_COMMAND_TYPE_REFRESH, NULL, NULL);
 	}
+    g_free(filename);
 
 }
 
diff --git a/src/path_bar.c b/src/path_bar.c
index cf718a5..ec6d7d3 100644
--- a/src/path_bar.c
+++ b/src/path_bar.c
@@ -21,7 +21,8 @@
 #include <string.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 #include "archive_store.h"
 #include "navigation_bar.h"
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 4339a09..0550af6 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -17,7 +17,7 @@
 #include <config.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
 #include <libsqueeze/libsqueeze.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
diff --git a/src/properties_dialog.c b/src/properties_dialog.c
index b5fb885..5bc8050 100644
--- a/src/properties_dialog.c
+++ b/src/properties_dialog.c
@@ -17,7 +17,7 @@
 #include <config.h>
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
 #include <libsqueeze/libsqueeze.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
diff --git a/src/throbber.c b/src/throbber.c
index a2a7e57..c7fb347 100644
--- a/src/throbber.c
+++ b/src/throbber.c
@@ -22,8 +22,6 @@
 #include <config.h>
 #endif
 
-#include <exo/exo.h>
-
 #include "throbber.h"
 #include "throbber-fallback.h"
 
@@ -103,7 +101,7 @@ sq_throbber_get_type (void)
 			NULL,
 		};
 
-		type = g_type_register_static (GTK_TYPE_WIDGET, I_("SQThrobber"), &info, 0);
+		type = g_type_register_static (GTK_TYPE_WIDGET, "SQThrobber", &info, 0);
 	}
 
 	return type;
@@ -141,7 +139,7 @@ sq_throbber_class_init (SQThrobberClass *klass)
 									 PROP_ANIMATED,
 									 g_param_spec_boolean ("animated",
 									 "animated", "animated", \
-									 FALSE, EXO_PARAM_READWRITE));
+									 FALSE, G_PARAM_READWRITE));
 
 	/* register the "process-working" fallback icon */
 	icon = gdk_pixbuf_new_from_inline (-1, sq_throbber_fallback, FALSE, NULL);
diff --git a/src/tool_bar.c b/src/tool_bar.c
index a216929..a4eb185 100644
--- a/src/tool_bar.c
+++ b/src/tool_bar.c
@@ -19,7 +19,9 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
+
+#include <libxfce4util/libxfce4util.h>
 #include <libsqueeze/libsqueeze.h>
 #include "archive_store.h"
 #include "navigation_bar.h"
diff --git a/src/widget_factory.c b/src/widget_factory.c
index 0c83405..b6dc80d 100644
--- a/src/widget_factory.c
+++ b/src/widget_factory.c
@@ -22,7 +22,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/types.h>
-#include <thunar-vfs/thunar-vfs.h>
+#include <gio/gio.h>
 #include <libsqueeze/libsqueeze.h>
 
 #include "widget_factory.h"


More information about the Xfce4-commits mailing list