[Xfce4-commits] r22733 - in xarchiver/branches/xarchiver-psybsd: . libxarchiver src
Stephan Arts
stephan at xfce.org
Sat Aug 12 22:53:27 UTC 2006
Author: stephan
Date: 2006-08-12 22:53:25 +0000 (Sat, 12 Aug 2006)
New Revision: 22733
Removed:
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-bzip2.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-bzip2.h
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-gzip.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-gzip.h
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support.h
Modified:
xarchiver/branches/xarchiver-psybsd/AUTHORS
xarchiver/branches/xarchiver-psybsd/TODO
xarchiver/branches/xarchiver-psybsd/configure.ac
xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h
xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h
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/internals.h
xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
xarchiver/branches/xarchiver-psybsd/src/Makefile.am
xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c
xarchiver/branches/xarchiver-psybsd/src/extract_dialog.h
xarchiver/branches/xarchiver-psybsd/src/main.c
xarchiver/branches/xarchiver-psybsd/src/new_dialog.c
xarchiver/branches/xarchiver-psybsd/src/new_dialog.h
xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
Log:
Add MIME database support (through thunar-vfs (tmp-solution))
Add support for Gnu-Tar [.tar(.gz/.bz2/.Z)] (using both tar and gtar binaries, for support on *BSD)
Add support for Zip [.zip]
Update TODO
Update AUTHORS
Modified: xarchiver/branches/xarchiver-psybsd/AUTHORS
===================================================================
--- xarchiver/branches/xarchiver-psybsd/AUTHORS 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/AUTHORS 2006-08-12 22:53:25 UTC (rev 22733)
@@ -1,2 +1,2 @@
-Stephan Arts - psyBSD - psybsd at gmail.com
+Stephan Arts - psyBSD - <psybsd at gmail.com>
Giuseppe Torelli - Colossus - <colossus73 at gmail.com>
Modified: xarchiver/branches/xarchiver-psybsd/TODO
===================================================================
--- xarchiver/branches/xarchiver-psybsd/TODO 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/TODO 2006-08-12 22:53:25 UTC (rev 22733)
@@ -4,53 +4,15 @@
Long Version:
- Make ArchiveSupport functions ArchiveSupport aware.
-
- Implement archive-type verification and 'open' support for existing archives
- - .rar
- - .arj
- - .iso
- - .7zip
-
- Implement 'ExtractArchiveDialog'
-
- Implement transaction-options for archive-support objects
- - implement option listing
- - implement set_property code
-
- Implement transaction-options for compression-support objects
- - implement option listing
- - implement set_property code
-
- Let support objects check if the program in question exists upon object creation.
-
- add configure-options to enable / disable support-objects.
-
- add support for libarchive
-
- See if we can avoid using /tmp when possible.
- Write view support for all support objects.
- Optimize memory usage and library size (remove duplicate code)
-
- Extend testing:
- Test Add
- Remove
- Extract
- View
-
- add passwd property to archive
-
-
---------------------------------------------------------------
-| DONE DONE |
+| IMPORTANT IMPORTANT |
---------------------------------------------------------------
- Implement lxa_archivetype_supported() function DONE
- Implement lxa_compressiontype_supported() function DONE
+
+ Comment library functionsi
+ (explain their purpose)
- Implement 'NewArchiveDialog' DONE
+ Make thunar-vfs dependency optional.
+ (Can be replaced by an internal libmime)
- Implement archive-type verification and 'open' support for existing archives
- - done for .tar
- .tar.gz
- .tar.bz2
- .zip
+ Complete TODO-file
+
Modified: xarchiver/branches/xarchiver-psybsd/configure.ac
===================================================================
--- xarchiver/branches/xarchiver-psybsd/configure.ac 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/configure.ac 2006-08-12 22:53:25 UTC (rev 22733)
@@ -38,6 +38,7 @@
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.2.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.2.0])
XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.2.0])
+XDT_CHECK_PACKAGE([THUNARVFS], [thunar-vfs-1], [0.3.3])
dnl check for debugging support
XDT_FEATURE_DEBUG
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am 2006-08-12 22:53:25 UTC (rev 22733)
@@ -2,17 +2,15 @@
libxarchiver_a_SOURCES = \
libxarchiver.c libxarchiver.h \
+ internals.c internals.h \
archive.c archive.h \
- internals.c internals.h \
archive-support.c archive-support.h \
- archive-support-zip.c archive-support-zip.h \
- archive-support-gnu-tar.c archive-support-gnu-tar.h \
- compression-support.c compression-support.h \
- compression-support-gzip.c compression-support-gzip.h \
- compression-support-bzip2.c compression-support-bzip2.h
+ archive-support-zip.c archive-support-zip.h \
+ archive-support-gnu-tar.c archive-support-gnu-tar.h
libxarchiver_a_CFLAGS = \
- $(GLIB_CFLAGS)
+ $(GLIB_CFLAGS) \
+ $(THUNARVFS_CFLAGS)
libxarchiver_a_LIBADD =
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,54 +16,20 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
+#define EXO_API_SUBJECT_TO_CHANGE
+
#include <glib.h>
+
#include <glib-object.h>
-#include <libintl.h>
+#include <thunar-vfs/thunar-vfs.h>
+
#include "archive.h"
#include "archive-support.h"
#include "archive-support-gnu-tar.h"
-#include "compression-support.h"
-
#include "internals.h"
-#define _(String) gettext(String)
-
-enum
-{
- LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_OVERWRITE = 1,
- LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_TOUCH,
- LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_STRIP
-};
-
-gint
-lxa_archive_support_gnu_tar_add(LXAArchive *archive);
-
-gint
-lxa_archive_support_gnu_tar_extract(LXAArchive *archive);
-
-gint
-lxa_archive_support_gnu_tar_remove(LXAArchive *archive);
-
-gint
-lxa_archive_support_gnu_tar_view(LXAArchive *archive);
-
void
-lxa_archive_support_gnu_tar_child_watch_func(GPid pid, gint status, gpointer data);
-
-void
-lxa_archive_support_gnu_tar_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-void
-lxa_archive_support_gnu_tar_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-gboolean
-lxa_archive_support_gnu_tar_view_func(GIOChannel *source, GIOCondition condition, gpointer data);
-
-void
lxa_archive_support_gnu_tar_init(LXAArchiveSupportGnuTar *support);
void
lxa_archive_support_gnu_tar_class_init(LXAArchiveSupportGnuTarClass *supportclass);
@@ -99,67 +65,35 @@
LXAArchiveSupport *archive_support = LXA_ARCHIVE_SUPPORT(support);
archive_support->id = "Gnu Tar";
- archive_support->type = LXA_ARCHIVETYPE_TAR;
+ if(g_find_program_in_path("gtar"))
+ support->app_name = "gtar";
+ else
+ support->app_name = "tar";
+
+ lxa_archive_support_add_mime(archive_support, "application/x-tar");
+ /* Check for existence of compress -- required for x-tarz */
+ if(g_find_program_in_path("compress"))
+ lxa_archive_support_add_mime(archive_support, "application/x-tarz");
+ /* Check for existence of gzip -- required for x-compressed-tar*/
+ if(g_find_program_in_path("gzip"))
+ lxa_archive_support_add_mime(archive_support, "application/x-compressed-tar");
+ /* Check for existence of bzip2 -- required for x-bzip-compressed-tar */
+ if(g_find_program_in_path("bzip2"))
+ lxa_archive_support_add_mime(archive_support, "application/x-bzip-compressed-tar");
+
archive_support->add = lxa_archive_support_gnu_tar_add;
archive_support->extract = lxa_archive_support_gnu_tar_extract;
- archive_support->remove = lxa_archive_support_gnu_tar_remove;
- archive_support->view = lxa_archive_support_gnu_tar_view;
- archive_support->column_nr = 6;
- archive_support->column_names = g_new0(gchar *, archive_support->column_nr);
- archive_support->column_types = g_new0(GType , archive_support->column_nr);
- archive_support->column_names[0] = _("Filename");
- archive_support->column_names[1] = _("Permissions");
- archive_support->column_names[2] = _("Owner/Group");
- archive_support->column_names[3] = _("Size");
- archive_support->column_names[4] = _("Date");
- archive_support->column_names[5] = _("Time");
- archive_support->column_types[0] = G_TYPE_STRING;
- archive_support->column_types[1] = G_TYPE_STRING;
- archive_support->column_types[2] = G_TYPE_STRING;
- archive_support->column_types[3] = G_TYPE_UINT;
- archive_support->column_types[4] = G_TYPE_STRING;
- archive_support->column_types[5] = G_TYPE_STRING;
}
void
lxa_archive_support_gnu_tar_class_init(LXAArchiveSupportGnuTarClass *supportclass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (supportclass);
- GParamSpec *pspec = NULL;
- LXAArchiveSupportGnuTarClass *klass = LXA_ARCHIVE_SUPPORT_GNU_TAR_CLASS (supportclass);
-
- object_class->set_property = lxa_archive_support_gnu_tar_set_property;
- object_class->get_property = lxa_archive_support_gnu_tar_get_property;
-
- pspec = g_param_spec_boolean("extract-overwrite",
- "Overwrite exisiting files",
- "Overwrite existing files on extraction",
- FALSE,
- G_PARAM_READWRITE);
- g_object_class_install_property(object_class, LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_OVERWRITE, pspec);
-
- pspec = g_param_spec_boolean("extract-touch",
- "Touch files",
- "Touch files",
- FALSE,
- G_PARAM_READWRITE);
- g_object_class_install_property(object_class, LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_TOUCH, pspec);
-
- pspec = g_param_spec_uint("extract-strip",
- "Strip directories",
- "Strip directories",
- 0,
- 128,
- 0,
- G_PARAM_READWRITE);
- g_object_class_install_property(object_class, LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_STRIP, pspec);
}
LXAArchiveSupport*
lxa_archive_support_gnu_tar_new()
{
- guint i;
LXAArchiveSupportGnuTar *support;
support = g_object_new(LXA_TYPE_ARCHIVE_SUPPORT_GNU_TAR, NULL);
@@ -168,173 +102,83 @@
}
gint
-lxa_archive_support_gnu_tar_add(LXAArchive *archive)
+lxa_archive_support_gnu_tar_add(LXAArchiveSupport *support, LXAArchive *archive, GSList *filenames)
{
- gchar *command;
- GSList *files = archive->tmp_data;
-
- if(archive->compression == LXA_COMPRESSIONTYPE_NONE)
+ if(!LXA_IS_ARCHIVE_SUPPORT_GNU_TAR(support))
{
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar -rf ", archive->path, " ", files->data, NULL);
- else
- command = g_strconcat("tar -cf ", archive->path, " ", files->data, NULL);
+ g_critical("Support is not GNU TAR");
+ return -1;
}
- else
- {
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar -rf ", archive->tmp_file, " ", files->data, NULL);
- else
- command = g_strconcat("tar -cf ", archive->tmp_file, " ", files->data, NULL);
- }
- if(lxa_execute(command, archive, lxa_archive_support_gnu_tar_child_watch_func, NULL, NULL, NULL))
- return 1;
-
- return 0;
-}
-
-gint
-lxa_archive_support_gnu_tar_extract(LXAArchive *archive)
-{
- /*
- * TODO: use extract- options
- */
- gchar *command;
- GSList *files = archive->tmp_data;
-
- if(archive->compression == LXA_COMPRESSIONTYPE_NONE)
+ if(!lxa_archive_support_mime_supported(support, archive->mime))
{
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar -xf ", archive->path, " -C ", files->data, NULL);
- else
- return 1;
+ return 1;
}
else
{
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar -xf ", archive->tmp_file, " -C ", files->data, NULL);
- else
- return 1;
+ gchar *command = NULL;
+ gchar *files = lxa_concat_filenames(filenames);
+ if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
+ {
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -rf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tarz"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -Zrf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -zrf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-bzip-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -jrf ", archive->path, " ", files, NULL);
+ } else
+ {
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -cf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tarz"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -Zcf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -zcf ", archive->path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-bzip-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -jcf ", archive->path, " ", files, NULL);
+ }
+ if(command)
+ lxa_execute(command, archive, NULL, NULL, NULL, NULL);
}
-
- if(lxa_execute(command, archive, lxa_archive_support_gnu_tar_child_watch_func, NULL, NULL, NULL))
- return 1;
return 0;
}
gint
-lxa_archive_support_gnu_tar_remove(LXAArchive *archive)
+lxa_archive_support_gnu_tar_extract(LXAArchiveSupport *support, LXAArchive *archive, gchar *dest_path, GSList *filenames)
{
- gchar *command;
-
- GSList *files = archive->tmp_data;
-
- if(archive->compression == LXA_COMPRESSIONTYPE_NONE)
+ if(!LXA_IS_ARCHIVE_SUPPORT_GNU_TAR(support))
{
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar --delete -f ", archive->path, " ", files->data, NULL);
- else
- return 2;
+ g_critical("Support is not GNU TAR");
+ return -1;
}
- else
- {
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar --delete -f ", archive->tmp_file, " ", files->data, NULL);
- else
- return 2;
- }
- if(lxa_execute(command, archive, lxa_archive_support_gnu_tar_child_watch_func, NULL, NULL, NULL))
- return 1;
-
- return 0;
-
-}
-
-gint
-lxa_archive_support_gnu_tar_view(LXAArchive *archive)
-{
- gchar *command;
- if(archive->compression == LXA_COMPRESSIONTYPE_NONE)
+ if(!lxa_archive_support_mime_supported(support, archive->mime))
{
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar --list -f ", archive->path, NULL);
- else
- return 2;
+ return 1;
}
else
{
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- command = g_strconcat("tar --list -f ", archive->tmp_file, NULL);
- else
- return 2;
+ gchar *command = NULL;
+ gchar *files = lxa_concat_filenames(filenames);
+ if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
+ {
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -xf ", archive->path, " -C ", dest_path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-tarz"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -Zxf ", archive->path, " -C ", dest_path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -zxf ", archive->path, " -C ", dest_path, " ", files, NULL);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-bzip-compressed-tar"))
+ command = g_strconcat(LXA_ARCHIVE_SUPPORT_GNU_TAR(support)->app_name, " -jxf ", archive->path, " -C ", dest_path, " ", files, NULL);
+ if(command)
+ {
+ g_debug("Extracting archive '%s' to '%s'", archive->path, dest_path);
+ lxa_execute(command, archive, NULL, NULL, NULL, NULL);
+ }
+ } else
+ return 1;
}
-
- if(lxa_execute(command, archive, lxa_archive_support_gnu_tar_child_watch_func, NULL, lxa_archive_support_gnu_tar_view_func, NULL))
- return 1;
return 0;
}
-
-void
-lxa_archive_support_gnu_tar_child_watch_func(GPid pid, gint status, gpointer data)
-{
- GSList *find_result;
- LXACompressionSupport *compression_support;
- LXAArchive *archive = data;
-
- archive->child_pid = 0;
- if((archive->compression != LXA_COMPRESSIONTYPE_NONE) && (archive->status != LXA_ARCHIVESTATUS_EXTRACT))
- {
- find_result = g_slist_find_custom(lxa_compression_support_list, &(archive->compression), lookup_compression_support);
- if(find_result)
- {
- compression_support = find_result->data;
- compression_support->compress(archive);
- }
- } else
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_IDLE);
-}
-
-void
-lxa_archive_support_gnu_tar_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- switch(prop_id)
- {
- case LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_OVERWRITE:
- LXA_ARCHIVE_SUPPORT_GNU_TAR(object)->_extr_overwrite = g_value_get_boolean(value);
- break;
- case LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_TOUCH:
- LXA_ARCHIVE_SUPPORT_GNU_TAR(object)->_extr_touch = g_value_get_boolean(value);
- break;
- case LXA_ARCHIVE_SUPPORT_GNU_TAR_EXTRACT_STRIP:
- LXA_ARCHIVE_SUPPORT_GNU_TAR(object)->_extr_strip = g_value_get_uint(value);
- break;
- }
-}
-
-void
-lxa_archive_support_gnu_tar_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
-
-}
-
-gboolean
-lxa_archive_support_gnu_tar_view_func(GIOChannel *ioc, GIOCondition condition, gpointer data)
-{
- gchar *line = NULL;
- GIOStatus status = 0;
- GError *error = NULL;
-
- if (condition & (G_IO_IN | G_IO_PRI) )
- {
- status = g_io_channel_read_line(ioc, &line, NULL,NULL,&error);
- }
- else if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL) )
- {
- g_io_channel_shutdown ( ioc,TRUE,NULL );
- g_io_channel_unref (ioc);
- return FALSE;
- }
- return TRUE;
-}
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -46,10 +46,7 @@
struct _LXAArchiveSupportGnuTar
{
LXAArchiveSupport parent;
- LXAArchiveType type;
- gboolean _extr_overwrite;
- gboolean _extr_touch;
- guint _extr_strip;
+ gchar *app_name;
};
typedef struct _LXAArchiveSupportGnuTarClass LXAArchiveSupportGnuTarClass;
@@ -62,6 +59,9 @@
GType lxa_archive_support_gnu_tar_get_type(void);
LXAArchiveSupport * lxa_archive_support_gnu_tar_new();
+gint lxa_archive_support_gnu_tar_add(LXAArchiveSupport *, LXAArchive *, GSList *);
+gint lxa_archive_support_gnu_tar_extract(LXAArchiveSupport *, LXAArchive *, gchar *, GSList *);
+
G_END_DECLS
#endif /* __LIBXARCHIVER_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-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,42 +16,19 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
+#define EXO_API_SUBJECT_TO_CHANGE
+
#include <glib.h>
#include <glib-object.h>
-#include <libintl.h>
+#include <thunar-vfs/thunar-vfs.h>
+
#include "archive.h"
#include "archive-support.h"
#include "archive-support-zip.h"
-#include "compression-support.h"
-
#include "internals.h"
-#define _(String) gettext(String)
-
-gint
-lxa_archive_support_zip_add(LXAArchive *archive);
-
-gint
-lxa_archive_support_zip_extract(LXAArchive *archive);
-
-gint
-lxa_archive_support_zip_remove(LXAArchive *archive);
-
-gint
-lxa_archive_support_zip_view(LXAArchive *archive);
-
void
-lxa_archive_support_zip_child_watch_func(GPid pid, gint status, gpointer data);
-
-gboolean
-lxa_archive_support_zip_view_func(GIOChannel *source, GIOCondition condition, gpointer data);
-
-void
lxa_archive_support_zip_init(LXAArchiveSupportZip *support);
void
lxa_archive_support_zip_class_init(LXAArchiveSupportZipClass *supportclass);
@@ -87,31 +64,12 @@
LXAArchiveSupport *archive_support = LXA_ARCHIVE_SUPPORT(support);
archive_support->id = "Zip";
- archive_support->type = LXA_ARCHIVETYPE_ZIP;
+ lxa_archive_support_add_mime(archive_support, "application/zip");
+ lxa_archive_support_add_mime(archive_support, "application/x-zip");
+
archive_support->add = lxa_archive_support_zip_add;
archive_support->extract = lxa_archive_support_zip_extract;
- archive_support->remove = lxa_archive_support_zip_remove;
- archive_support->view = lxa_archive_support_zip_view;
- archive_support->column_nr = 8;
- archive_support->column_names = g_new0(gchar *, archive_support->column_nr);
- archive_support->column_types = g_new0(GType , archive_support->column_nr);
- archive_support->column_names[0] = _("Filename");
- archive_support->column_names[1] = _("Original");
- archive_support->column_names[2] = _("Method");
- archive_support->column_names[3] = _("Compressed");
- archive_support->column_names[4] = _("Ratio");
- archive_support->column_names[5] = _("Date");
- archive_support->column_names[6] = _("Time");
- archive_support->column_names[7] = _("CRC-32");
- archive_support->column_types[0] = G_TYPE_STRING;
- archive_support->column_types[1] = G_TYPE_UINT64;
- archive_support->column_types[2] = G_TYPE_STRING;
- archive_support->column_types[3] = G_TYPE_UINT64;
- archive_support->column_types[4] = G_TYPE_STRING;
- archive_support->column_types[5] = G_TYPE_STRING;
- archive_support->column_types[6] = G_TYPE_STRING;
- archive_support->column_types[7] = G_TYPE_STRING;
}
void
@@ -134,106 +92,60 @@
}
gint
-lxa_archive_support_zip_add(LXAArchive *archive)
+lxa_archive_support_zip_add(LXAArchiveSupport *support, LXAArchive *archive, GSList *filenames)
{
- gchar *command;
- GSList *files = archive->tmp_data;
+ if(!LXA_IS_ARCHIVE_SUPPORT_ZIP(support))
+ {
+ g_critical("Support is not zip");
+ return -1;
+ }
- command = g_strconcat("zip -r ", archive->path, " ", files->data, NULL);
-
- if(lxa_execute(command, archive, lxa_archive_support_zip_child_watch_func, NULL, NULL, NULL))
+ if(!lxa_archive_support_mime_supported(support, archive->mime))
+ {
return 1;
-
- return 0;
-}
-
-gint
-lxa_archive_support_zip_extract(LXAArchive *archive)
-{
- /*
- * TODO: use extract- options
- */
- gchar *command;
- GSList *files = archive->tmp_data;
-
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("unzip -o ", archive->path, " -d ", files->data, NULL);
+ }
else
- return 1;
-
- if(lxa_execute(command, archive, lxa_archive_support_zip_child_watch_func, NULL, NULL, NULL))
- return 1;
+ {
+ gchar *command = NULL;
+ gchar *files = lxa_concat_filenames(filenames);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-zip") ||
+ !g_strcasecmp((gchar *)archive->mime, "application/zip"))
+ {
+ command = g_strconcat("zip -r ", archive->path, " ", files, NULL);
+ lxa_execute(command, archive, NULL, NULL, NULL, NULL);
+ }
+ }
return 0;
}
gint
-lxa_archive_support_zip_remove(LXAArchive *archive)
+lxa_archive_support_zip_extract(LXAArchiveSupport *support, LXAArchive *archive, gchar *dest_path, GSList *filenames)
{
- gchar *command;
+ if(!LXA_IS_ARCHIVE_SUPPORT_ZIP(support))
+ {
+ g_critical("Support is not Zip");
+ return -1;
+ }
- GSList *files = archive->tmp_data;
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("zip -d ", archive->path, " ", files->data, NULL);
- else
- return 2;
-
- if(lxa_execute(command, archive, lxa_archive_support_zip_child_watch_func, NULL, NULL, NULL))
+ if(!lxa_archive_support_mime_supported(support, archive->mime))
+ {
return 1;
-
- return 0;
-
-}
-
-gint
-lxa_archive_support_zip_view(LXAArchive *archive)
-{
- gchar *command;
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- command = g_strconcat("unzip -vl -qq ", archive->path, NULL);
+ }
else
- return 2;
-
- if(lxa_execute(command, archive, lxa_archive_support_zip_child_watch_func, NULL, lxa_archive_support_zip_view_func, NULL))
- return 1;
- return 0;
-}
-
-void
-lxa_archive_support_zip_child_watch_func(GPid pid, gint status, gpointer data)
-{
- GSList *find_result;
- LXACompressionSupport *compression_support;
- LXAArchive *archive = data;
-
- archive->child_pid = 0;
- if((archive->compression != LXA_COMPRESSIONTYPE_NONE) && (archive->status != LXA_ARCHIVESTATUS_EXTRACT))
{
- find_result = g_slist_find_custom(lxa_compression_support_list, &(archive->compression), lookup_compression_support);
- if(find_result)
+ gchar *command = NULL;
+ gchar *files = lxa_concat_filenames(filenames);
+ if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
{
- compression_support = find_result->data;
- compression_support->compress(archive);
- }
- } else
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_IDLE);
-}
-
-gboolean
-lxa_archive_support_zip_view_func(GIOChannel *ioc, GIOCondition condition, gpointer data)
-{
- gchar *line = NULL;
- GIOStatus status = 0;
- GError *error = NULL;
-
- if (condition & (G_IO_IN | G_IO_PRI) )
- {
- status = g_io_channel_read_line(ioc, &line, NULL,NULL,&error);
+ if(!g_strcasecmp((gchar *)archive->mime, "application/x-zip") ||
+ !g_strcasecmp((gchar *)archive->mime, "application/zip"))
+ {
+ command = g_strconcat("unzip -o ", archive->path, " -d ", dest_path, " ", files, NULL);
+ g_debug("Extracting archive '%s' to '%s'", archive->path, dest_path);
+ lxa_execute(command, archive, NULL, NULL, NULL, NULL);
+ }
+ } else
+ return 1;
}
- else if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL) )
- {
- g_io_channel_shutdown ( ioc,TRUE,NULL );
- g_io_channel_unref (ioc);
- return FALSE;
- }
- return TRUE;
+ return 0;
}
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -46,7 +46,6 @@
struct _LXAArchiveSupportZip
{
LXAArchiveSupport parent;
- LXAArchiveType type;
};
typedef struct _LXAArchiveSupportZipClass LXAArchiveSupportZipClass;
@@ -59,6 +58,9 @@
GType lxa_archive_support_zip_get_type(void);
LXAArchiveSupport * lxa_archive_support_zip_new();
+gint lxa_archive_support_zip_add(LXAArchiveSupport *, LXAArchive *, GSList *);
+gint lxa_archive_support_zip_extract(LXAArchiveSupport *, LXAArchive *, gchar *, GSList *);
+
G_END_DECLS
#endif /* __LIBXARCHIVER_ARCHIVE_SUPPORT_ZIP_H__ */
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,29 +16,26 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
+#define EXO_API_SUBJECT_TO_CHANGE
+
#include <glib.h>
+#include <glib/gstdio.h>
#include <glib-object.h>
-#include <libintl.h>
+#include <thunar-vfs/thunar-vfs.h>
+
#include "archive.h"
#include "archive-support.h"
-#define _(String) gettext(String)
+#include "internals.h"
-gint
-lxa_archive_support_dummy(LXAArchive *archive);
-
-
void
lxa_archive_support_init(LXAArchiveSupport *support);
void
lxa_archive_support_class_init(LXAArchiveSupportClass *supportclass);
-static guint lxa_archive_support_signals[2];
-
+/*
+ *
+ */
GType
lxa_archive_support_get_type ()
{
@@ -64,21 +61,19 @@
return lxa_archive_support_type;
}
-gint
-lxa_archive_support_dummy(LXAArchive *archive)
-{
- return -1;
-}
-
+/*
+ *
+ */
void
lxa_archive_support_init(LXAArchiveSupport *support)
{
- support->add = lxa_archive_support_dummy;
- support->extract = lxa_archive_support_dummy;
- support->remove = lxa_archive_support_dummy;
- support->view = lxa_archive_support_dummy;
+ support->add = NULL;
+ support->extract = NULL;
}
+/*
+ *
+ */
void
lxa_archive_support_class_init(LXAArchiveSupportClass *supportclass)
{
@@ -86,31 +81,11 @@
GObjectClass *gobject_class = G_OBJECT_CLASS (supportclass);
LXAArchiveSupportClass *klass = LXA_ARCHIVE_SUPPORT_CLASS (supportclass);
*/
-
- lxa_archive_support_signals[0] = g_signal_new("lxa_add_complete",
- G_TYPE_FROM_CLASS(supportclass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER,
- NULL);
- lxa_archive_support_signals[1] = g_signal_new("lxa_extract_complete",
- G_TYPE_FROM_CLASS(supportclass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER,
- NULL);
}
+/*
+ *
+ */
LXAArchiveSupport*
lxa_archive_support_new()
{
@@ -121,76 +96,80 @@
return support;
}
+/*
+ *
+ */
void
-lxa_archive_support_emit_signal(LXAArchiveSupport *support, guint signal_id, LXAArchive *archive)
+lxa_archive_support_add_mime(LXAArchiveSupport *support, gchar *mime)
{
- g_signal_emit(G_OBJECT(support), lxa_archive_support_signals[signal_id], 0, archive);
+ support->mime = g_slist_prepend(support->mime, mime);
}
+/*
+ *
+ */
gboolean
-lxa_archive_discover_type(LXAArchive *archive)
+lxa_archive_support_mime_supported(LXAArchiveSupport *support, const gchar *mime)
{
- FILE *fp = NULL;
+ GSList *result = g_slist_find_custom(support->mime, mime, lxa_archive_support_lookup_mime);
+ if(!result)
+ return FALSE;
+ return TRUE;
+}
- gchar magic[6];
- /*
- * Check if the compression-type has been discovered
- */
- if(archive->compression > 1)
- {
- /*
- * Extract and check the tmp-file
- */
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- {
- fp = fopen(archive->tmp_file, "r");
- if(!fp)
- return FALSE;
- } else
- return FALSE;
- }
- else
- {
- fp = fopen(archive->path, "r");
- if(!fp)
- return FALSE;
- }
+/*
+ *
+ */
+gboolean
+lxa_register_support(LXAArchiveSupport *support)
+{
+ if(!LXA_IS_ARCHIVE_SUPPORT(support))
+ return FALSE;
- fseek(fp, 0, SEEK_SET);
- if ( fseek ( fp , 257, SEEK_CUR ) == 0 )
- {
- /* TAR */
- if ( fread ( magic, 1, 5, fp ) )
- {
- /* check magic */
- if ( memcmp ( magic,"ustar",5 ) == 0 )
- {
- archive->type = LXA_ARCHIVETYPE_TAR;
- }
- /* check extension */
- else
- {
- switch(archive->compression)
- {
- case(LXA_COMPRESSIONTYPE_NONE):
- if(g_str_has_suffix(archive->path, ".tar"))
- archive->type = LXA_ARCHIVETYPE_TAR;
- break;
- case(LXA_COMPRESSIONTYPE_GZIP):
- if(g_str_has_suffix(archive->path, ".tar.gz") || g_str_has_suffix(archive->path, ".tgz"))
- archive->type = LXA_ARCHIVETYPE_TAR;
- break;
- case(LXA_COMPRESSIONTYPE_BZIP2):
- if(g_str_has_suffix(archive->path, ".tar.bz2") || g_str_has_suffix(archive->path, ".tbz2") || g_str_has_suffix(archive->path, ".tar.bz") || g_str_has_suffix(archive->path, ".tbz"))
- archive->type = LXA_ARCHIVETYPE_TAR;
- break;
- }
+ lxa_archive_support_list = g_slist_prepend(lxa_archive_support_list, support);
+ g_object_ref(support);
- }
- }
- }
- if(archive->type == LXA_ARCHIVETYPE_UNKNOWN)
- archive->type == LXA_ARCHIVETYPE_NONE;
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_IDLE);
return TRUE;
}
+
+/*
+ *
+ */
+LXAArchiveSupport *
+lxa_get_support_for_mime(gchar *mime)
+{
+ return lxa_get_support_for_mime_from_slist(lxa_archive_support_list, mime);
+}
+
+/*
+ *
+ */
+LXAArchiveSupport *
+lxa_get_support_for_mime_from_slist(GSList *list, gchar *mime)
+{
+ GSList *result = g_slist_find_custom(list, mime, lxa_archive_support_lookup_support);
+ if(result)
+ return result->data;
+ return NULL;
+}
+
+/*
+ *
+ */
+gint
+lxa_archive_support_lookup_mime(gconstpointer support_mime, gconstpointer mime)
+{
+ return g_strcasecmp((gchar *)support_mime, (gchar *)mime);
+}
+
+/*
+ *
+ */
+gint
+lxa_archive_support_lookup_support(gconstpointer support, gconstpointer mime)
+{
+ if(lxa_archive_support_mime_supported(LXA_ARCHIVE_SUPPORT(support), (gchar *)mime))
+ return 0;
+ else
+ return 1;
+}
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -41,35 +41,48 @@
G_TYPE_CHECK_CLASS_TYPE ((klass), \
LXA_TYPE_ARCHIVE_SUPPORT))
+
typedef struct _LXAArchiveSupport LXAArchiveSupport;
struct _LXAArchiveSupport
{
- GObject parent;
- LXAArchiveType type;
- gchar *id;
- gint (*add) (LXAArchive *);
- gint (*extract) (LXAArchive *);
- gint (*remove) (LXAArchive *);
- gint (*view) (LXAArchive *);
- gint column_nr;
- gchar **column_names;
- GType *column_types;
+ GObject parent;
+ gchar *id;
+ GSList *mime;
+/*
+ * The following functions should _NOT_ be called directly.
+ *
+ * lxa_archive_support_add()
+ * lxa_archive_support_extract()
+ *
+ * should be called instead.
+ */
+ gint (*add)(LXAArchiveSupport *support, LXAArchive *archive, GSList *files);
+ gint (*extract)(LXAArchiveSupport *support, LXAArchive *archive, gchar *dest_path, GSList *files);
};
typedef struct _LXAArchiveSupportClass LXAArchiveSupportClass;
struct _LXAArchiveSupportClass
{
- GObjectClass parent;
+ GObjectClass parent;
};
GType lxa_archive_support_get_type(void);
LXAArchiveSupport * lxa_archive_support_new();
-void lxa_archive_support_emit_signal(LXAArchiveSupport *support, guint signal_id, LXAArchive *archive);
+void lxa_archive_support_add_mime(LXAArchiveSupport *support, gchar *mime);
+gboolean lxa_archive_support_mime_supported(LXAArchiveSupport *,const gchar *mime);
-gboolean lxa_archive_discover_type(LXAArchive *archive);
+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);
+gint lxa_archive_support_lookup_mime(gconstpointer support_mime, gconstpointer mime);
+gint lxa_archive_support_lookup_support(gconstpointer support, gconstpointer mime);
+
+gint lxa_archive_support_add(LXAArchiveSupport *, LXAArchive *, GSList *);
+gint lxa_archive_support_extract(LXAArchiveSupport *, LXAArchive *, gchar *, GSList *);
+
G_END_DECLS
#endif /* __LIBXARCHIVER_ARCHIVE_SUPPORT_H__ */
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,13 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <signal.h>
+#define EXO_API_SUBJECT_TO_CHANGE
+
#include <glib.h>
#include <glib/gstdio.h>
#include <glib-object.h>
+#include <thunar-vfs/thunar-vfs.h>
#include "archive.h"
#include "archive-support.h"
-#include "compression-support.h"
#include "internals.h"
@@ -37,8 +38,6 @@
lxa_archive_finalize(GObject *object);
-static guint lxa_archive_signals[3];
-
GType
lxa_archive_get_type ()
{
@@ -71,40 +70,6 @@
GObjectClass *object_class = G_OBJECT_CLASS(archive_class);
object_class->finalize = lxa_archive_finalize;
-
- lxa_archive_signals[0] = g_signal_new("lxa_status_changed",
- G_TYPE_FROM_CLASS(archive_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER,
- NULL);
-
- lxa_archive_signals[1] = g_signal_new("lxa_init_complete",
- G_TYPE_FROM_CLASS(archive_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0,
- NULL);
- lxa_archive_signals[2] = g_signal_new("lxa_operation_failure",
- G_TYPE_FROM_CLASS(archive_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER,
- NULL);
}
static void
@@ -121,9 +86,10 @@
}
LXAArchive *
-lxa_archive_new(gchar *path, LXAArchiveType type, LXACompressionType compression, GCallback initialized_func)
+lxa_archive_new(gchar *path, gchar *mime)
{
LXAArchive *archive;
+ ThunarVfsMimeInfo *mime_info;
archive = g_object_new(lxa_archive_get_type(), NULL);
if(path)
@@ -131,216 +97,33 @@
else
archive->path = NULL;
- g_signal_connect(G_OBJECT(archive), "lxa_init_complete", initialized_func, NULL);
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_INIT);
-
- if(compression == LXA_COMPRESSIONTYPE_UNKNOWN)
- {
- /*Discover compression-type*/
- if(lxa_compression_discover_type(archive))
- g_debug("COMPRESSION TYPE FOUND");
- else
- g_debug("COMPRESSION TYPE NOT FOUND");
- compression = archive->compression;
- }
+ if(!mime)
+ mime_info = thunar_vfs_mime_database_get_info_for_file(lxa_mime_database, archive->path, g_path_get_basename(archive->path));
else
- {
- archive->compression = compression;
- archive->type = type;
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_IDLE);
- return archive;
- }
- if(archive->compression == LXA_COMPRESSIONTYPE_NONE)
- {
- if(type == LXA_ARCHIVETYPE_UNKNOWN)
- {
- /*Discover archive-type*/
- if(lxa_archive_discover_type(archive))
- g_debug("ARCHIVE TYPE FOUND");
- else
- g_debug("ARCHIVE TYPE NOT FOUND");
- type = archive->type;
- }
- }
+ mime_info = thunar_vfs_mime_info_new(mime, -1);
+
+ archive->mime = g_strdup(thunar_vfs_mime_info_get_name(mime_info));
+ g_print("%s\n", archive->mime);
+
return archive;
}
-void
-lxa_archive_set_status(LXAArchive *archive, LXAArchiveStatus status)
-{
- archive->oldstatus = archive->status;
- archive->status = status;
- if(archive->oldstatus == LXA_ARCHIVESTATUS_INIT && archive->status == LXA_ARCHIVESTATUS_IDLE)
- g_signal_emit(G_OBJECT(archive), lxa_archive_signals[1], 0, archive);
- else
- g_signal_emit(G_OBJECT(archive), lxa_archive_signals[0], 0, archive);
-}
-
gint
-lxa_archive_decompress(LXAArchive *archive)
+lxa_archive_support_add(LXAArchiveSupport *support, LXAArchive *archive, GSList *files)
{
- GSList *find_result;
- LXACompressionSupport *compression_support;
- if(archive->compression != LXA_COMPRESSIONTYPE_NONE)
- {
- find_result = g_slist_find_custom(lxa_compression_support_list, &(archive->compression), lookup_compression_support);
- if(find_result)
- {
- compression_support = find_result->data;
- if(!archive->tmp_file)
- {
- archive->tmp_file = g_strconcat(lxa_tmp_dir, "/xarchiver-XXXXXX" , NULL);
- g_mkstemp(archive->tmp_file);
- }
- lxa_tmp_files_list = g_slist_prepend(lxa_tmp_files_list, archive->tmp_file);
-
- /* Check if the archive already exists */
- if(g_file_test(archive->path, G_FILE_TEST_EXISTS))
- {
- /* since we only need the filename: we unlink it */
- if(g_file_test(archive->tmp_file, G_FILE_TEST_EXISTS))
- g_unlink(archive->tmp_file);
- compression_support->decompress(archive);
- }
- else
- return 1;
- }
- }
+ if(support->add)
+ return support->add(support, archive, files);
else
- return 2;
- return 0;
+ g_critical("ADD NOT IMPLEMENTED BY SUPPORT OBJECT '%s'", support->id);
+ return -1;
}
gint
-lxa_archive_add(LXAArchive *archive, GSList *files)
+lxa_archive_support_extract(LXAArchiveSupport *support, LXAArchive *archive, gchar *dest_path, GSList *files)
{
- GSList *find_result;
- LXAArchiveSupport *archive_support;
-
- if(archive->status != LXA_ARCHIVESTATUS_IDLE)
- {
-#ifdef DEBUG
- g_debug("archive is buzy...");
-#endif
- return 1;
- }
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_ADD);
-
- archive->tmp_data = files;
-
- lxa_archive_decompress(archive);
- find_result = g_slist_find_custom(lxa_archive_support_list, &(archive->type), lookup_archive_support);
- if(find_result)
- {
- archive_support = find_result->data;
- archive_support->add(archive);
- } else
- return 2;
- return 0;
-}
-
-gint
-lxa_archive_extract(LXAArchive *archive, GSList *files, gchar *destination)
-{
- if(!destination)
- return 1;
- GSList *find_result;
- LXAArchiveSupport *archive_support;
-
- if(archive->status != LXA_ARCHIVESTATUS_IDLE)
- {
-#ifdef DEBUG
- g_debug("archive is buzy...");
-#endif
- return 1;
- }
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_EXTRACT);
-
- archive->tmp_data = g_slist_prepend(files, destination);
-
- if(archive->compression != LXA_COMPRESSIONTYPE_NONE)
- lxa_archive_decompress(archive);
+ if(support->extract)
+ return support->extract(support, archive, dest_path, files);
else
- {
- find_result = g_slist_find_custom(lxa_archive_support_list, &(archive->type), lookup_archive_support);
- if(find_result)
- {
- archive_support = find_result->data;
- archive_support->extract(archive);
- } else
- return 2;
- }
- return 0;
+ g_critical("EXTRACT NOT IMPLEMENTED BY SUPPORT OBJECT '%s'", support->id);
+ return -1;
}
-
-gint
-lxa_archive_remove(LXAArchive *archive, GSList *files)
-{
- GSList *find_result;
- LXAArchiveSupport *archive_support;
-
- if(archive->status != LXA_ARCHIVESTATUS_IDLE)
- {
-#ifdef DEBUG
- g_debug("archive is buzy...");
-#endif
- return 1;
- }
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_REMOVE);
-
- archive->tmp_data = files;
-
- lxa_archive_decompress(archive);
- find_result = g_slist_find_custom(lxa_archive_support_list, &(archive->type), lookup_archive_support);
- if(find_result)
- {
- archive_support = find_result->data;
- archive_support->remove(archive);
- } else
- return 2;
- return 0;
-}
-
-gint
-lxa_archive_view(LXAArchive *archive, gint column_nr, gchar **column_names, GType *column_types)
-{
- GSList *find_result;
- LXAArchiveSupport *archive_support;
-
- if(archive->status != LXA_ARCHIVESTATUS_IDLE)
- {
-#ifdef DEBUG
- g_debug("archive is buzy...");
-#endif
- return 1;
- }
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_REMOVE);
-
- archive->tmp_data = NULL;
-
- lxa_archive_decompress(archive);
- find_result = g_slist_find_custom(lxa_archive_support_list, &(archive->type), lookup_archive_support);
- if(find_result)
- {
- archive_support = find_result->data;
-
- column_nr = archive_support->column_nr;
- column_names = archive_support->column_names;
- column_types = archive_support->column_types;
-
- archive_support->view(archive);
- } else
- return 2;
- return 0;
-}
-
-gint
-lxa_archive_stop(LXAArchive *archive)
-{
- if(kill(archive->child_pid, SIGABRT) < 0)
- return 1;
- lxa_archive_set_status(archive, LXA_ARCHIVESTATUS_USERBREAK);
- archive->child_pid = 0;
- return 0;
-}
-
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -21,28 +21,7 @@
typedef enum
{
- LXA_ARCHIVETYPE_NONE, /* if archive-type is not supported / it is no archive */
- LXA_ARCHIVETYPE_UNKNOWN, /* archive-type has not been discovered yet */
- LXA_ARCHIVETYPE_TAR,
- LXA_ARCHIVETYPE_RAR,
- LXA_ARCHIVETYPE_ZIP,
- LXA_ARCHIVETYPE_ARJ,
- LXA_ARCHIVETYPE_RPM,
- LXA_ARCHIVETYPE_7ZIP,
- LXA_ARCHIVETYPE_ISO
-} LXAArchiveType;
-
-typedef enum
-{
- LXA_COMPRESSIONTYPE_NONE,
- LXA_COMPRESSIONTYPE_UNKNOWN,
- LXA_COMPRESSIONTYPE_BZIP2,
- LXA_COMPRESSIONTYPE_GZIP
-} LXACompressionType;
-
-typedef enum
-{
- LXA_ARCHIVESTATUS_IDLE,
+ LXA_ARCHIVESTATUS_IDLE = 0,
LXA_ARCHIVESTATUS_INIT,
LXA_ARCHIVESTATUS_ADD,
LXA_ARCHIVESTATUS_EXTRACT,
@@ -78,13 +57,8 @@
struct _LXAArchive
{
GObject parent;
- LXAArchiveStatus status;
- LXAArchiveStatus oldstatus;
- LXAArchiveType type;
- LXACompressionType compression;
gchar *path;
- gchar *tmp_file;
- gpointer tmp_data;
+ gchar *mime;
GPid child_pid;
};
@@ -95,20 +69,11 @@
GObjectClass parent;
};
-GType lxa_archive_get_type(void);
-LXAArchive *lxa_archive_new(gchar *, LXAArchiveType, LXACompressionType, GCallback);
+GType lxa_archive_get_type(void);
+LXAArchive *lxa_archive_new(gchar *, gchar *);
-void lxa_archive_set_status(LXAArchive *archive, LXAArchiveStatus status);
+gchar *lxa_archive_discover_mime(LXAArchive *archive);
-gint lxa_archive_decompress(LXAArchive *archive);
-
-gint lxa_archive_add(LXAArchive *archive, GSList *files);
-gint lxa_archive_extract(LXAArchive *archive, GSList *files, gchar *destination);
-gint lxa_archive_view(LXAArchive *archive, gint, gchar **, GType *);
-
-gint lxa_archive_stop(LXAArchive *archive);
-
-
G_END_DECLS
#endif /* __LIBXARCHIVER_ARCHIVE_H__ */
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-bzip2.c
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-bzip2.h
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-gzip.c
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support-gzip.h
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support.c
Deleted: xarchiver/branches/xarchiver-psybsd/libxarchiver/compression-support.h
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -1,34 +1,33 @@
+
+/*
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * 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>
+#include <thunar-vfs/thunar-vfs.h>
#include "archive.h"
#include "archive-support.h"
-#include "compression-support.h"
#include "internals.h"
-gint
-lookup_archive_support( gconstpointer support , gconstpointer type)
-{
- if(support == 0)
- return 1;
- if(((const LXAArchiveSupport *)support)->type == *(LXAArchiveType *)type)
- return 0;
- else
- return 1;
-}
-
-gint
-lookup_compression_support( gconstpointer support , gconstpointer type)
-{
- if(support == 0)
- return 1;
- if(((const LXACompressionSupport *)support)->type == *(LXACompressionType *)type)
- return 0;
- else
- return 1;
-}
-
void
lxa_default_child_watch_func(GPid pid, gint status, gpointer data)
{
@@ -109,3 +108,21 @@
}
return 0;
}
+
+gchar *
+lxa_concat_filenames(GSList *filenames)
+{
+ GSList *_filenames = filenames;
+ gchar *concat_str = " ";
+
+ while(_filenames)
+ {
+ if(g_file_test(_filenames->data, G_FILE_TEST_EXISTS))
+ {
+ concat_str = g_strconcat(concat_str, " ", _filenames->data, NULL);
+ }
+ _filenames = _filenames->next;
+ }
+ return concat_str;
+}
+
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,28 +16,25 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-const gchar *lxa_tmp_dir;
-GSList *lxa_archive_support_list;
-GSList *lxa_compression_support_list;
-GSList *lxa_tmp_files_list;
+const gchar *lxa_tmp_dir;
+ThunarVfsMimeDatabase *lxa_mime_database;
+GSList *lxa_archive_support_list;
-gint
-lookup_archive_support( gconstpointer support , gconstpointer type);
-
-gint
-lookup_compression_support( gconstpointer support , gconstpointer type);
-
/*
* gint
* lxa_execute(gchar *command)
*
* general function for executing child-apps
*/
-gint lxa_execute(
- gchar *command,
- LXAArchive *archive,
- GChildWatchFunc function,
- GIOFunc f_in,
- GIOFunc f_out,
- GIOFunc f_err);
+gint
+lxa_execute(
+ gchar *command,
+ LXAArchive *archive,
+ GChildWatchFunc function,
+ GIOFunc f_in,
+ GIOFunc f_out,
+ GIOFunc f_err);
+gchar *
+lxa_concat_filenames(GSList *filenames);
+
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -16,44 +16,30 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include <glib.h>
#include <glib/gstdio.h>
#include <glib-object.h>
+
#include "libxarchiver.h"
-#include "archive-support.h"
-#include "archive-support-gnu-tar.h"
-#include "archive-support-zip.h"
-#include "compression-support.h"
-#include "compression-support-gzip.h"
-#include "compression-support-bzip2.h"
#include "internals.h"
void
lxa_init()
{
- lxa_archive_support_list = g_slist_alloc();
- lxa_archive_support_list = g_slist_prepend(lxa_archive_support_list, lxa_archive_support_gnu_tar_new());
- lxa_archive_support_list = g_slist_prepend(lxa_archive_support_list, lxa_archive_support_zip_new());
-
- lxa_compression_support_list = g_slist_alloc();
- lxa_compression_support_list = g_slist_prepend(lxa_compression_support_list, lxa_compression_support_gzip_new());
- lxa_compression_support_list = g_slist_prepend(lxa_compression_support_list, lxa_compression_support_bzip2_new());
-
lxa_tmp_dir = g_get_tmp_dir();
+ lxa_mime_database = thunar_vfs_mime_database_get_default();
-#ifdef DEBUG
- g_debug("lxa_tmp_dir: %s\n", lxa_tmp_dir); g_debug("lxa_cmp_list_length: %d\n", g_slist_length(lxa_compression_support_list));
-#endif
+ lxa_register_support(lxa_archive_support_zip_new());
+ lxa_register_support(lxa_archive_support_gnu_tar_new());
}
void
lxa_destroy()
{
- g_slist_foreach(lxa_tmp_files_list,(void *)g_unlink, NULL);
- g_slist_foreach(lxa_tmp_files_list,(void *)g_free, NULL);
- g_slist_free(lxa_tmp_files_list);
+ g_object_unref(lxa_mime_database);
}
/*
@@ -61,7 +47,7 @@
*
*/
gint
-lxa_new_archive(gchar *path, LXAArchiveType type, LXACompressionType compression, gboolean overwrite, LXAArchive **lp_archive, GCallback initialized_func)
+lxa_new_archive(gchar *path, gboolean overwrite, gchar *mime, LXAArchive **lp_archive)
{
if(overwrite)
g_unlink(path);
@@ -72,7 +58,7 @@
return 1;
}
- LXAArchive *archive = lxa_archive_new(path, type, compression, initialized_func);
+ LXAArchive *archive = lxa_archive_new(path, mime);
(*lp_archive) = archive;
return 0;
}
@@ -83,7 +69,7 @@
*
*/
gint
-lxa_open_archive(gchar *path, LXAArchive **lp_archive, GCallback initialized_func)
+lxa_open_archive(gchar *path, LXAArchive **lp_archive)
{
if(!g_file_test(path, G_FILE_TEST_EXISTS))
{
@@ -91,7 +77,7 @@
return 1;
}
- LXAArchive *archive = lxa_archive_new(path, LXA_ARCHIVETYPE_UNKNOWN, LXA_COMPRESSIONTYPE_UNKNOWN, initialized_func);
+ LXAArchive *archive = lxa_archive_new(path, NULL);
(*lp_archive) = archive;
return 0;
}
@@ -99,21 +85,4 @@
void
lxa_close_archive(LXAArchive *archive)
{
- g_unlink(archive->tmp_file);
}
-
-gboolean
-lxa_archivetype_supported (LXAArchiveType type)
-{
- if(g_slist_find_custom(lxa_archive_support_list, &type, lookup_archive_support))
- return TRUE;
- return FALSE;
-}
-
-gboolean
-lxa_compressiontype_supported (LXACompressionType type)
-{
- if(g_slist_find_custom(lxa_compression_support_list, &type, lookup_compression_support))
- return TRUE;
- return FALSE;
-}
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -18,7 +18,13 @@
#ifndef __LIBXARCHIVER_H__
#define __LIBXARCHIVER_H__
+#define EXO_API_SUBJECT_TO_CHANGE
+
+#include <thunar-vfs/thunar-vfs.h>
#include <libxarchiver/archive.h>
+#include <libxarchiver/archive-support.h>
+#include <libxarchiver/archive-support-zip.h>
+#include <libxarchiver/archive-support-gnu-tar.h>
G_BEGIN_DECLS
@@ -46,11 +52,9 @@
*/
gint
lxa_new_archive( gchar *path,
- LXAArchiveType,
- LXACompressionType,
gboolean overwrite,
- LXAArchive **lp_archive,
- GCallback initialized_func);
+ gchar *mime,
+ LXAArchive **lp_archive);
/*
* gint
@@ -62,8 +66,7 @@
*/
gint
lxa_open_archive( gchar *path,
- LXAArchive **lp_archive,
- GCallback initialized_func);
+ LXAArchive **lp_archive);
/*
* void
@@ -73,19 +76,6 @@
void
lxa_close_archive( LXAArchive *archive );
-/*
- *
- */
-GSList *
-lxa_get_supported_compression_types();
-
-/*
- *
- */
-GSList *
-lxa_get_supported_archive_types();
-
-
G_END_DECLS
#endif /* __LIBXARCHIVER_H__ */
Modified: xarchiver/branches/xarchiver-psybsd/src/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/Makefile.am 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/Makefile.am 2006-08-12 22:53:25 UTC (rev 22733)
@@ -8,6 +8,7 @@
xarchiver_CFLAGS = \
@GTK_CFLAGS@ \
@GLIB_CFLAGS@ \
+ @THUNARVFS_CFLAGS@ \
-DDATADIR=\"$(datadir)\" \
-DSRCDIR=\"$(top_srcdir)\" \
-DLOCALEDIR=\"$(localedir)\"
@@ -15,7 +16,8 @@
xarchiver_LDADD = \
$(top_srcdir)/libxarchiver/libxarchiver.a \
@GTK_LIBS@ \
- @GLIB_LIBS@
+ @GLIB_LIBS@ \
+ @THUNARVFS_LIBS@
INCLUDES = \
-I${top_srcdir}
Modified: xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -17,21 +17,28 @@
*/
#include <config.h>
-#include <gettext.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libxarchiver/libxarchiver.h>
#include "extract_dialog.h"
+enum
+{
+ XA_EXTRACT_ARCHIVE_DIALOG_ARCHIVE = 1
+};
+
static void
xa_extract_archive_dialog_class_init(XAExtractArchiveDialogClass *archive_class);
static void
xa_extract_archive_dialog_init(XAExtractArchiveDialog *archive);
-static void
-xa_extract_archive_dialog_finalize(GObject *object);
+void
+xa_extract_archive_dialog_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+void
+xa_extract_archive_dialog_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+
GType
xa_extract_archive_dialog_get_type ()
{
@@ -66,13 +73,16 @@
static void
xa_extract_archive_dialog_init(XAExtractArchiveDialog *dialog)
{
+ gtk_dialog_add_buttons(GTK_DIALOG(dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ _("Extract"), GTK_RESPONSE_OK,
+ NULL);
}
GtkWidget *
-xa_extract_archive_dialog_new()
+xa_extract_archive_dialog_new(LXAArchive *archive)
{
GtkWidget *dialog;
- GtkFileFilter *filter = NULL;
dialog = g_object_new(xa_extract_archive_dialog_get_type(), "title", _("Extract archive"), "action", GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, "do-overwrite-confirmation", TRUE, NULL);
Modified: xarchiver/branches/xarchiver-psybsd/src/extract_dialog.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/extract_dialog.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/extract_dialog.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -43,6 +43,7 @@
struct _XAExtractArchiveDialog
{
GtkFileSelection parent;
+ LXAArchive *archive;
};
typedef struct _XAExtractArchiveDialogClass XAExtractArchiveDialogClass;
Modified: xarchiver/branches/xarchiver-psybsd/src/main.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/main.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -17,7 +17,6 @@
*/
#include <config.h>
-#include <gettext.h>
#include <glib.h>
#include <glib-object.h>
#include <libxarchiver/libxarchiver.h>
@@ -27,9 +26,7 @@
#include "extract_dialog.h"
#include "main.h"
-gboolean no_gui = FALSE;
gboolean new_archive = FALSE;
-gboolean silent = FALSE;
gboolean extract_archive = FALSE;
gchar *extract_archive_path = NULL;
@@ -69,109 +66,42 @@
void
archive_status_changed(LXAArchive *archive, gpointer data)
{
- GtkWidget *dialog;
- gchar *msg_string;
- switch(archive->status)
- {
- case(LXA_ARCHIVESTATUS_IDLE):
- if(add_archive || extract_archive || extract_archive_path || add_archive_path)
- opened_archives--;
- break;
- case(LXA_ARCHIVESTATUS_ERROR):
- if(add_archive || extract_archive || extract_archive_path || add_archive_path)
- opened_archives--;
- break;
- case(LXA_ARCHIVESTATUS_ADD):
- break;
- case(LXA_ARCHIVESTATUS_USERBREAK):
- case(LXA_ARCHIVESTATUS_REMOVE):
- case(LXA_ARCHIVESTATUS_EXTRACT):
- case(LXA_ARCHIVESTATUS_VIEW):
- break;
- }
- if(opened_archives <= 0)
- {
- gtk_main_quit();
- }
}
void
archive_operation_failed(LXAArchive *archive, gpointer data)
{
- GtkWidget *dialog;
- gchar *msg_string;
- switch(archive->status)
- {
- case(LXA_ARCHIVESTATUS_ADD):
- msg_string = _("Could not add file(s) to archive '%s'");
- break;
- case(LXA_ARCHIVESTATUS_EXTRACT):
- msg_string = _("Could not extract archive '%s'");
- break;
- case(LXA_ARCHIVESTATUS_REMOVE):
- msg_string = _("Could not remove file(s) from archive '%s'");
- break;
- }
- dialog = gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,msg_string, archive->path);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- gtk_dialog_run (GTK_DIALOG (dialog) );
- gtk_widget_destroy (GTK_WIDGET (dialog) );
}
void
archive_initialized(LXAArchive *archive, gpointer data)
{
- GtkWidget *dialog;
- GSList *files = NULL;
- gint i = 0;
- if(add_archive_path)
- {
- for(i = 1; i < _argc; i++)
- {
- if(g_file_test(_argv[i], G_FILE_TEST_EXISTS))
- files = g_slist_prepend(files, _argv[i]);
- else
- {
- dialog = gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("File '%s' does not exist: ABORTING"), _argv[i]);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- gtk_dialog_run (GTK_DIALOG (dialog) );
- gtk_widget_destroy (GTK_WIDGET (dialog) );
- g_slist_free(files);
- lxa_close_archive(archive);
- gtk_main_quit();
- }
- }
- lxa_archive_add(archive, files);
- }
- if(extract_archive_path)
- lxa_archive_extract(archive, files, extract_archive_path);
}
int main(int argc, char **argv)
{
- GError *cli_error = NULL;
- GtkWidget *dialog;
- LXAArchive *xa_archive = NULL;
gint result = 0;
+ GtkWidget *dialog = NULL;
+ LXAArchive *lpArchive;
+ LXAArchiveSupport *lpSupport;
+ GError *cli_error = NULL;
gint i = 0;
- GSList *files = NULL;
- LXAArchiveType new_archivetype;
- LXACompressionType new_compressiontype;
- gchar *temp_path;
-
- #ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
- #endif
+ #ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+ #endif
+ g_thread_init(NULL);
+
+
gtk_init_with_args(&argc, &argv, _("[archive name]"), entries, PACKAGE, &cli_error);
+ thunar_vfs_init();
+
lxa_init();
- _argc = argc;
- _argv = argv;
if(extract_archive_path || extract_archive)
{
if(argc == 1)
@@ -179,10 +109,7 @@
return 1;
}
if(!extract_archive_path)
- {
- /*
- * TODO: Show extract-dialog.
- */
+ {
dialog = xa_extract_archive_dialog_new();
result = gtk_dialog_run (GTK_DIALOG (dialog) );
if(result == GTK_RESPONSE_CANCEL || result == GTK_RESPONSE_DELETE_EVENT)
@@ -190,156 +117,46 @@
gtk_widget_destroy (GTK_WIDGET (dialog) );
return 2;
}
+ extract_archive_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog) );
}
for(i = 1; i < argc; i++)
{
- if(!lxa_open_archive(argv[i], &xa_archive, G_CALLBACK(archive_initialized)))
+ if(!lxa_open_archive(argv[i], &lpArchive))
{
- opened_archives++;
- g_signal_connect(G_OBJECT(xa_archive), "lxa_status_changed", G_CALLBACK(archive_status_changed), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_init_complete", G_CALLBACK(archive_initialized), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_operation_failure", G_CALLBACK(archive_operation_failed), NULL);
+ lpSupport = lxa_get_support_for_mime(lpArchive->mime);
+ lxa_archive_support_extract(lpSupport, lpArchive, extract_archive_path, NULL);
}
- else
- {
- dialog = gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Could not extract archive '%s'"), argv[i]);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- gtk_dialog_run (GTK_DIALOG (dialog) );
- gtk_widget_destroy (GTK_WIDGET (dialog) );
- return 1;
- }
}
}
-
- if(add_archive_path || new_archive)
+ if(new_archive)
{
- if(argc < 2)
+ dialog = xa_new_archive_dialog_new();
+ result = gtk_dialog_run (GTK_DIALOG (dialog) );
+ if(result == GTK_RESPONSE_CANCEL || result == GTK_RESPONSE_DELETE_EVENT)
{
- dialog = gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("You should provide at least one file to add\n") );
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- gtk_dialog_run (GTK_DIALOG (dialog) );
gtk_widget_destroy (GTK_WIDGET (dialog) );
- return 1;
+ return 2;
}
- if(add_archive_path && !lxa_open_archive(add_archive_path, &xa_archive, G_CALLBACK(archive_initialized)))
+ if(result == GTK_RESPONSE_OK)
{
- g_signal_connect(G_OBJECT(xa_archive), "lxa_status_changed", G_CALLBACK(archive_status_changed), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_init_complete", G_CALLBACK(archive_initialized), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_operation_failure", G_CALLBACK(archive_operation_failed), NULL);
- opened_archives++;
- }
- else /* No file-name provided, a new archive has to be created: */
- {
- dialog = xa_new_archive_dialog_new();
- result = gtk_dialog_run (GTK_DIALOG (dialog) );
- if(result == GTK_RESPONSE_CANCEL || result == GTK_RESPONSE_DELETE_EVENT)
+ add_archive_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog) );
+ if(!lxa_new_archive(add_archive_path, TRUE, NULL, &lpArchive))
{
- gtk_widget_destroy (GTK_WIDGET (dialog) );
- return 2;
- }
- if(result == GTK_RESPONSE_OK)
- {
- /* do crazy stuff */
- new_archivetype = xa_new_archive_dialog_get_archive_type(XA_NEW_ARCHIVE_DIALOG(dialog));
- new_compressiontype = xa_new_archive_dialog_get_compression_type(XA_NEW_ARCHIVE_DIALOG(dialog));
- add_archive_path = xa_new_archive_dialog_get_filename(XA_NEW_ARCHIVE_DIALOG(dialog));
- if(new_archivetype == LXA_ARCHIVETYPE_UNKNOWN)
+ GSList *files = NULL;
+ for(i = 1; i < argc; i++)
{
- /* auto-detect
- * FIXME: should not work if type is unsupported
- * TODO: Move this code to new_dialog, if possible
- */
- if(g_str_has_suffix(add_archive_path, ".tgz") || g_str_has_suffix(add_archive_path, ".tar.gz"))
- {
- new_archivetype = LXA_ARCHIVETYPE_TAR;
- new_compressiontype = LXA_COMPRESSIONTYPE_GZIP;
- }
- if(g_str_has_suffix(add_archive_path, ".tbz") || g_str_has_suffix(add_archive_path, ".tar.bz") || g_str_has_suffix(add_archive_path, ".tar.bz2"))
- {
- new_archivetype = LXA_ARCHIVETYPE_TAR;
- new_compressiontype = LXA_COMPRESSIONTYPE_BZIP2;
- }
- if(g_str_has_suffix(add_archive_path, ".tar"))
- {
- new_archivetype = LXA_ARCHIVETYPE_TAR;
- new_compressiontype = LXA_COMPRESSIONTYPE_NONE;
- }
- if(g_str_has_suffix(add_archive_path, ".zip"))
- {
- new_archivetype = LXA_ARCHIVETYPE_ZIP;
- new_compressiontype = LXA_COMPRESSIONTYPE_NONE;
- }
+ files = g_slist_prepend(files, argv[i]);
}
- if(new_archivetype != LXA_ARCHIVETYPE_UNKNOWN)
- {
- if(new_archivetype == LXA_ARCHIVETYPE_TAR)
- {
- if(new_compressiontype == LXA_COMPRESSIONTYPE_GZIP)
- {
- if(!g_str_has_suffix(add_archive_path, ".tgz") && !g_str_has_suffix(add_archive_path, ".tar.gz"))
- {
- temp_path = g_strconcat(add_archive_path, ".tar.gz", NULL);
- g_free(add_archive_path);
- add_archive_path = temp_path;
- }
- g_debug("TAR.GZ\n");
- }
- if(new_compressiontype == LXA_COMPRESSIONTYPE_BZIP2)
- {
- if(!g_str_has_suffix(add_archive_path, ".tbz") && !g_str_has_suffix(add_archive_path, ".tar.bz") && !g_str_has_suffix(add_archive_path, ".tar.bz2"))
- {
- temp_path = g_strconcat(add_archive_path, ".tar.bz2", NULL);
- g_free(add_archive_path);
- add_archive_path = temp_path;
- }
- g_debug("TAR.BZ2\n");
- }
- if(new_compressiontype == LXA_COMPRESSIONTYPE_NONE)
- {
- if(!g_str_has_suffix(add_archive_path, ".tar"))
- {
- temp_path = g_strconcat(add_archive_path, ".tar", NULL);
- g_free(add_archive_path);
- add_archive_path = temp_path;
- }
- g_debug("TAR\n");
- }
- }
- if(new_archivetype == LXA_ARCHIVETYPE_ZIP)
- {
- if(!g_str_has_suffix(add_archive_path, ".zip"))
- {
- temp_path = g_strconcat(add_archive_path, ".zip", NULL);
- g_free(add_archive_path);
- add_archive_path = temp_path;
- }
- g_debug("ZIP\n");
- }
- if(!lxa_new_archive(add_archive_path, new_archivetype, new_compressiontype, TRUE, &xa_archive, G_CALLBACK(archive_initialized)))
- {
- g_signal_connect(G_OBJECT(xa_archive), "lxa_status_changed", G_CALLBACK(archive_status_changed), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_init_complete", G_CALLBACK(archive_initialized), NULL);
- g_signal_connect(G_OBJECT(xa_archive), "lxa_operation_failure", G_CALLBACK(archive_operation_failed), NULL);
- opened_archives++;
- }
- }
- else
- {
- gtk_widget_destroy (GTK_WIDGET (dialog) );
- dialog = gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Archive type unknown\n"));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- gtk_dialog_run (GTK_DIALOG (dialog) );
- return 1;
- }
+ lpSupport = lxa_get_support_for_mime(lpArchive->mime);
+ lxa_archive_support_add(lpSupport, lpArchive, files);
}
- gtk_widget_destroy (GTK_WIDGET (dialog) );
}
+
}
- if(!new_archive && !extract_archive && !extract_archive_path && !add_archive_path)
- return 0;
-
gtk_main();
-
+
return 0;
}
Modified: xarchiver/branches/xarchiver-psybsd/src/new_dialog.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/new_dialog.c 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/new_dialog.c 2006-08-12 22:53:25 UTC (rev 22733)
@@ -17,7 +17,6 @@
*/
#include <config.h>
-#include <gettext.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libxarchiver/libxarchiver.h>
@@ -29,9 +28,6 @@
static void
xa_new_archive_dialog_init(XANewArchiveDialog *archive);
-static void
-xa_new_archive_dialog_finalize(GObject *object);
-
GType
xa_new_archive_dialog_get_type ()
{
@@ -66,86 +62,17 @@
static void
xa_new_archive_dialog_init(XANewArchiveDialog *dialog)
{
- GtkTreeIter iter;
- GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
- GValue *str_value = g_new0(GValue, 1);
- GValue *at_value = g_new0(GValue, 1);
- GValue *ct_value = g_new0(GValue, 1);
-
+/*
GtkWidget *hbox = gtk_hbox_new(FALSE, 10);
gtk_box_pack_start (GTK_BOX (hbox),gtk_label_new (_("Archive type:")),FALSE, FALSE, 0);
- dialog->filetype_model = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT);
- dialog->filetype_selector = gtk_combo_box_new_with_model(GTK_TREE_MODEL(dialog->filetype_model));
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dialog->filetype_selector), renderer, FALSE);
- gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(dialog->filetype_selector), renderer, "text", 0);
-
- str_value = g_value_init(str_value, G_TYPE_STRING);
- at_value = g_value_init(at_value, G_TYPE_UINT);
- ct_value = g_value_init(ct_value, G_TYPE_UINT);
-
- gtk_list_store_append(dialog->filetype_model, &iter);
-
- g_value_set_string(str_value, _("Automatic"));
- gtk_list_store_set_value(dialog->filetype_model, &iter, 0, str_value);
- g_value_set_uint(at_value, LXA_ARCHIVETYPE_UNKNOWN);
- g_value_set_uint(ct_value, LXA_COMPRESSIONTYPE_UNKNOWN);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 1, at_value);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 2, ct_value);
-
- if(lxa_archivetype_supported(LXA_ARCHIVETYPE_TAR))
- {
- gtk_list_store_append(dialog->filetype_model, &iter);
- g_value_set_string(str_value, _("Tar (uncompressed) '.tar'"));
- gtk_list_store_set_value(dialog->filetype_model, &iter, 0, str_value);
-
- g_value_set_uint(at_value, LXA_ARCHIVETYPE_TAR);
- g_value_set_uint(ct_value, LXA_COMPRESSIONTYPE_NONE);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 1, at_value);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 2, ct_value);
- if(lxa_compressiontype_supported(LXA_COMPRESSIONTYPE_GZIP))
- {
- gtk_list_store_append(dialog->filetype_model, &iter);
- g_value_set_string(str_value, _("Gzip compressed Tar '.tar.gz'"));
- gtk_list_store_set_value(dialog->filetype_model, &iter, 0, str_value);
- g_value_set_uint(at_value, LXA_ARCHIVETYPE_TAR);
- g_value_set_uint(ct_value, LXA_COMPRESSIONTYPE_GZIP);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 1, at_value);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 2, ct_value);
- }
- if(lxa_compressiontype_supported(LXA_COMPRESSIONTYPE_BZIP2))
- {
- gtk_list_store_append(dialog->filetype_model, &iter);
- g_value_set_string(str_value, _("Bzip2 compressed Tar '.tar.bz2'"));
- gtk_list_store_set_value(dialog->filetype_model, &iter, 0, str_value);
- g_value_set_uint(at_value, LXA_ARCHIVETYPE_TAR);
- g_value_set_uint(ct_value, LXA_COMPRESSIONTYPE_BZIP2);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 1, at_value);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 2, ct_value);
- }
- }
- if(lxa_archivetype_supported(LXA_ARCHIVETYPE_ZIP))
- {
- gtk_list_store_append(dialog->filetype_model, &iter);
- g_value_set_string(str_value, _("Zip archive '.zip'"));
- gtk_list_store_set_value(dialog->filetype_model, &iter, 0, str_value);
- g_value_set_uint(at_value, LXA_ARCHIVETYPE_ZIP);
- g_value_set_uint(ct_value, LXA_COMPRESSIONTYPE_NONE);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 1, at_value);
- gtk_list_store_set_value(dialog->filetype_model, &iter, 2, ct_value);
- }
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->filetype_selector), 0);
- gtk_box_pack_start (GTK_BOX (hbox), dialog->filetype_selector,TRUE , TRUE, 0);
gtk_widget_show_all(hbox);
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, TRUE, 0);
+*/
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_NEW, GTK_RESPONSE_OK,
NULL);
- g_free(str_value);
- g_free(at_value);
- g_free(ct_value);
}
GtkWidget *
@@ -156,62 +83,37 @@
dialog = g_object_new(xa_new_archive_dialog_get_type(), "title", _("Create new archive"), "action", GTK_FILE_CHOOSER_ACTION_SAVE, "do-overwrite-confirmation", TRUE, NULL);
- if(lxa_archivetype_supported(LXA_ARCHIVETYPE_TAR))
- {
- filter = gtk_file_filter_new();
- gtk_file_filter_add_mime_type(filter, "application/x-tar");
- gtk_file_filter_set_name(filter, _("Tar (uncompressed) '.tar'"));
- gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
- if(lxa_compressiontype_supported(LXA_COMPRESSIONTYPE_GZIP))
- {
- filter = gtk_file_filter_new();
- gtk_file_filter_add_mime_type(filter, "application/x-compressed-tar");
- gtk_file_filter_set_name(filter, _("Gzip compressed Tar '.tar.gz'"));
- gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
- }
- if(lxa_compressiontype_supported(LXA_COMPRESSIONTYPE_BZIP2))
- {
- filter = gtk_file_filter_new();
- gtk_file_filter_add_mime_type(filter, "application/x-bzip-compressed-tar");
- gtk_file_filter_set_name(filter, _("Bzip2 compressed Tar '.tar.bz2'"));
- gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
- }
- }
- if(lxa_archivetype_supported(LXA_ARCHIVETYPE_ZIP))
- {
- filter = gtk_file_filter_new();
- gtk_file_filter_add_mime_type(filter, "application/x-zip");
- gtk_file_filter_add_mime_type(filter, "application/zip");
- gtk_file_filter_set_name(filter, _("Zip archive '.zip'"));
- gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
- }
-
- return dialog;
-}
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_mime_type(filter, "application/x-tar");
+ gtk_file_filter_add_mime_type(filter, "application/x-compressed-tar");
+ gtk_file_filter_add_mime_type(filter, "application/x-bzip-compressed-tar");
+ gtk_file_filter_add_mime_type(filter, "application/x-zip");
+ gtk_file_filter_add_mime_type(filter, "application/zip");
+ gtk_file_filter_set_name(filter, _("All Archives"));
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
-LXAArchiveType
-xa_new_archive_dialog_get_archive_type (XANewArchiveDialog *dialog)
-{
- GtkTreeIter iter;
- GValue *at_value = g_new0(GValue, 1);
- LXAArchiveType type;
- gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dialog->filetype_selector), &iter);
- gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->filetype_model), &iter, 1, at_value);
- type = g_value_get_uint(at_value);
- g_free(at_value);
- return type; }
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_mime_type(filter, "application/x-tar");
+ gtk_file_filter_set_name(filter, _("Tar (uncompressed) '.tar'"));
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
-LXACompressionType
-xa_new_archive_dialog_get_compression_type (XANewArchiveDialog *dialog)
-{
- GtkTreeIter iter;
- GValue *ct_value = g_new0(GValue, 1);
- LXACompressionType type;
- gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dialog->filetype_selector), &iter);
- gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->filetype_model), &iter, 2, ct_value);
- type = g_value_get_uint(ct_value);
- g_free(ct_value);
- return type;
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_mime_type(filter, "application/x-compressed-tar");
+ gtk_file_filter_set_name(filter, _("Gzip compressed Tar '.tar.gz'"));
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_mime_type(filter, "application/x-bzip-compressed-tar");
+ gtk_file_filter_set_name(filter, _("Bzip2 compressed Tar '.tar.bz2'"));
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_mime_type(filter, "application/x-zip");
+ gtk_file_filter_add_mime_type(filter, "application/zip");
+ gtk_file_filter_set_name(filter, _("Zip '.zip'"));
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+
+ return dialog;
}
gchar *
Modified: xarchiver/branches/xarchiver-psybsd/src/new_dialog.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/new_dialog.h 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/src/new_dialog.h 2006-08-12 22:53:25 UTC (rev 22733)
@@ -58,9 +58,8 @@
GtkWidget *xa_new_archive_dialog_new();
-LXAArchiveType xa_new_archive_dialog_get_archive_type (XANewArchiveDialog *);
-LXACompressionType xa_new_archive_dialog_get_compression_type (XANewArchiveDialog *);
gchar * xa_new_archive_dialog_get_filename (XANewArchiveDialog *dialog);
+gchar * xa_new_archive_dialog_get_mimetype (XANewArchiveDialog *dialog);
G_END_DECLS
#endif /* __XARCHIVER_NEW_ARCHIVE_DIALOG_H__ */
Modified: xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in 2006-08-12 21:49:32 UTC (rev 22732)
+++ xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in 2006-08-12 22:53:25 UTC (rev 22733)
@@ -11,4 +11,4 @@
X-MultipleArgs=false
Categories=GTK;Application;Utility;
StartupNotify=true
-MimeType=application/x-gzip;application/x-bzip;application/x-bzip-compressed-tar;application/x-tar;application/x-compressed-tar;application/x-zip;application/zip;application/x-zip-compressed;
+MimeType=application/x-bzip-compressed-tar;application/x-tar;application/x-compressed-tar;application/x-zip;application/zip;
More information about the Xfce4-commits
mailing list