[Xfce4-commits] r25244 - in squeeze/trunk: libsqueeze src
Stephan Arts
stephan at xfce.org
Wed Mar 21 05:53:53 CET 2007
Author: stephan
Date: 2007-03-21 04:53:53 +0000 (Wed, 21 Mar 2007)
New Revision: 25244
Added:
squeeze/trunk/libsqueeze/vfs-mime.c
squeeze/trunk/libsqueeze/vfs-mime.h
Modified:
squeeze/trunk/libsqueeze/Makefile.am
squeeze/trunk/libsqueeze/archive-command.c
squeeze/trunk/libsqueeze/archive-command.h
squeeze/trunk/libsqueeze/archive.c
squeeze/trunk/libsqueeze/archive.h
squeeze/trunk/libsqueeze/command-builder-compr.c
squeeze/trunk/libsqueeze/command-builder-compr.h
squeeze/trunk/libsqueeze/command-builder-gnu-tar.c
squeeze/trunk/libsqueeze/command-builder-gnu-tar.h
squeeze/trunk/libsqueeze/command-builder-rar.c
squeeze/trunk/libsqueeze/command-builder-rar.h
squeeze/trunk/libsqueeze/command-builder-zip.c
squeeze/trunk/libsqueeze/command-builder-zip.h
squeeze/trunk/libsqueeze/command-builder.c
squeeze/trunk/libsqueeze/command-builder.h
squeeze/trunk/libsqueeze/internals.h
squeeze/trunk/libsqueeze/libsqueeze-archive.h
squeeze/trunk/libsqueeze/libsqueeze-command.h
squeeze/trunk/libsqueeze/libsqueeze-module.h
squeeze/trunk/libsqueeze/libsqueeze.c
squeeze/trunk/libsqueeze/spawn-command.c
squeeze/trunk/libsqueeze/spawn-command.h
squeeze/trunk/src/add_dialog.c
squeeze/trunk/src/add_dialog.h
squeeze/trunk/src/application.c
squeeze/trunk/src/archive_store.c
squeeze/trunk/src/archive_store.h
squeeze/trunk/src/extract_dialog.c
squeeze/trunk/src/extract_dialog.h
squeeze/trunk/src/main_window.c
squeeze/trunk/src/new_dialog.c
squeeze/trunk/src/notebook.c
squeeze/trunk/src/notebook.h
squeeze/trunk/src/tool_bar.c
Log:
fixed compile errors
Modified: squeeze/trunk/libsqueeze/Makefile.am
===================================================================
--- squeeze/trunk/libsqueeze/Makefile.am 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/Makefile.am 2007-03-21 04:53:53 UTC (rev 25244)
@@ -8,6 +8,7 @@
libsqueeze-view.h \
libsqueeze-module.h \
slist.c slist.h \
+ vfs-mime.c vfs-mime.h \
archive.c archive.h \
archive-iter.c archive-iter.h \
archive-command.c archive-command.h \
@@ -20,10 +21,6 @@
command-builder-rar.c command-builder-rar.h \
command-builder-compr.c command-builder-compr.h \
command-builder-gnu-tar.c command-builder-gnu-tar.h
-#archive-support-compr.c archive-support-compr.h
-#archive-support-zip.c archive-support-zip.h
-#archive-support-rar.c archive-support-rar.h
-#archive-support-gnu-tar.c archive-support-gnu-tar.h
libsqueeze_1_la_CFLAGS = \
$(GLIB_CFLAGS) \
Modified: squeeze/trunk/libsqueeze/archive-command.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-command.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/archive-command.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -115,8 +115,8 @@
/**
- * lsq_archive_command_run:
- * @command: the archive_command to be run
+ * lsq_archive_command_executr:
+ * @command: the archive_command to be executed
*
* Returns: true on success
*/
Modified: squeeze/trunk/libsqueeze/archive-command.h
===================================================================
--- squeeze/trunk/libsqueeze/archive-command.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/archive-command.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -38,6 +38,8 @@
gboolean
lsq_archive_command_stop(LSQArchiveCommand *command);
+gboolean
+lsq_archive_command_execute(LSQArchiveCommand *command);
const gchar *
lsq_archive_command_get_comment(LSQArchiveCommand *archive_command);
Modified: squeeze/trunk/libsqueeze/archive.c
===================================================================
--- squeeze/trunk/libsqueeze/archive.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/archive.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -505,3 +505,69 @@
{
g_signal_emit(G_OBJECT(archive), lsq_archive_signals[LSQ_ARCHIVE_SIGNAL_REFRESHED], 0, NULL);
}
+
+gboolean
+lsq_archive_add(LSQArchive *archive, GSList *files)
+{
+ g_return_val_if_fail(archive->builder, FALSE);
+ LSQCommandBuilder *builder = archive->builder;
+ if(archive->command)
+ return FALSE;
+
+ archive->command = builder->build_add(builder, archive, files);
+
+ lsq_archive_command_execute(archive->command);
+ return FALSE;
+}
+
+gboolean
+lsq_archive_extract(LSQArchive *archive, const gchar *dest_path, GSList *files)
+{
+ g_return_val_if_fail(archive->builder, FALSE);
+ LSQCommandBuilder *builder = archive->builder;
+ if(archive->command)
+ return FALSE;
+
+ archive->command = builder->build_extract(builder, archive, dest_path, files);
+ lsq_archive_command_execute(archive->command);
+ return FALSE;
+}
+
+gboolean
+lsq_archive_remove(LSQArchive *archive, GSList *files)
+{
+ g_return_val_if_fail(archive->builder, FALSE);
+ LSQCommandBuilder *builder = archive->builder;
+ if(archive->command)
+ return FALSE;
+
+ archive->command = builder->build_remove(builder, archive, files);
+ lsq_archive_command_execute(archive->command);
+ return FALSE;
+}
+
+gboolean
+lsq_archive_refresh(LSQArchive *archive)
+{
+ g_return_val_if_fail(archive->builder, FALSE);
+ LSQCommandBuilder *builder = archive->builder;
+ if(archive->command)
+ return FALSE;
+
+ archive->command = builder->build_refresh(builder, archive);
+ lsq_archive_command_execute(archive->command);
+ return FALSE;
+}
+
+gboolean
+lsq_archive_view(LSQArchive *archive, GSList *files)
+{
+ g_return_val_if_fail(archive->builder, FALSE);
+ LSQCommandBuilder *builder = archive->builder;
+ if(archive->command)
+ return FALSE;
+
+ archive->command = builder->build_open(builder, archive, files);
+ lsq_archive_command_execute(archive->command);
+ return FALSE;
+}
Modified: squeeze/trunk/libsqueeze/archive.h
===================================================================
--- squeeze/trunk/libsqueeze/archive.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/archive.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -37,7 +37,7 @@
guint64 n_files;
guint64 n_directories;
} props;
- LSQCommandBuilder *cmd_builder;
+ LSQCommandBuilder *builder;
gchar *temp_dir;
GSList *monitor_list;
LSQArchiveIterPool *pool;
Modified: squeeze/trunk/libsqueeze/command-builder-compr.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-compr.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-compr.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -68,7 +68,7 @@
NULL
};
- lsq_command_builder_compr_type = g_type_register_static (G_TYPE_OBJECT, "LSQCommandBuilderCompr", &lsq_command_builder_compr_info, 0);
+ lsq_command_builder_compr_type = g_type_register_static (LSQ_TYPE_COMMAND_BUILDER, "LSQCommandBuilderCompr", &lsq_command_builder_compr_info, 0);
}
return lsq_command_builder_compr_type;
}
@@ -162,3 +162,12 @@
return NULL;
}
+LSQCommandBuilder *
+lsq_command_builder_compr_new()
+{
+ LSQCommandBuilder *builder;
+
+ builder = g_object_new(lsq_command_builder_compr_get_type(), NULL);
+
+ return builder;
+}
Modified: squeeze/trunk/libsqueeze/command-builder-compr.h
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-compr.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-compr.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -48,9 +48,10 @@
struct _LSQCommandBuilderComprClass
{
- GObjectClass parent;
+ LSQCommandBuilderClass parent;
};
GType lsq_command_builder_compr_get_type(void);
+LSQCommandBuilder *lsq_command_builder_compr_new();
#endif /* __LIBSQUEEZE_COMMAND_BUILDER_COMPR_H__ */
Modified: squeeze/trunk/libsqueeze/command-builder-gnu-tar.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-gnu-tar.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-gnu-tar.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -48,11 +48,11 @@
lsq_command_builder_gnu_tar_build_remove(LSQCommandBuilder *builder, LSQArchive *archive, GSList *files);
static gboolean
-lsq_command_builder_gnu_tar_refresh_parse_output(LSQArchiveCommand *archive_command, gpointer user_data);
+lsq_command_builder_gnu_tar_refresh_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data);
static gboolean
-lsq_command_builder_gnu_tar_compress_parse_output(LSQArchiveCommand *archive_command, gpointer user_data);
+lsq_command_builder_gnu_tar_compress_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data);
static gboolean
-lsq_command_builder_gnu_tar_decompress_parse_output(LSQArchiveCommand *archive_command, gpointer user_data);
+lsq_command_builder_gnu_tar_decompress_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data);
static GObjectClass *parent_class;
@@ -77,7 +77,7 @@
NULL
};
- lsq_command_builder_gnu_tar_type = g_type_register_static (G_TYPE_OBJECT, "LSQCommandBuilderGnuTar", &lsq_command_builder_gnu_tar_info, 0);
+ lsq_command_builder_gnu_tar_type = g_type_register_static (LSQ_TYPE_COMMAND_BUILDER, "LSQCommandBuilderGnuTar", &lsq_command_builder_gnu_tar_info, 0);
}
return lsq_command_builder_gnu_tar_type;
}
@@ -323,12 +323,12 @@
static gboolean
-lsq_command_builder_gnu_tar_refresh_parse_output(LSQArchiveCommand *archive_command, gpointer user_data)
+lsq_command_builder_gnu_tar_refresh_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data)
{
gchar *line = NULL;
gsize linesize = 0;
GIOStatus status = G_IO_STATUS_NORMAL;
- LSQArchive *archive = lsq_archive_command_get_archive(archive_command);
+ LSQArchive *archive = lsq_archive_command_get_archive(LSQ_ARCHIVE_COMMAND(spawn_command));
guint64 size;
gpointer props[6];
gint n = 0, a = 0, i = 0;
@@ -336,7 +336,7 @@
LSQArchiveIter *entry;
- status = lsq_archive_command_read_line(archive_command, 1, &line, &linesize, NULL);
+ status = lsq_spawn_command_read_line(spawn_command, 1, &line, &linesize, NULL);
if (line == NULL)
{
if(status == G_IO_STATUS_AGAIN)
@@ -440,7 +440,7 @@
}
static gboolean
-lsq_command_builder_gnu_tar_decompress_parse_output(LSQArchiveCommand *archive_command, gpointer user_data)
+lsq_command_builder_gnu_tar_decompress_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data)
{
GIOStatus status = G_IO_STATUS_NORMAL;
gchar *buf = g_new0(gchar, 1024);
@@ -448,13 +448,13 @@
GError *error = NULL;
FILE *out_file;
- const gchar *out_filename = g_object_get_data(G_OBJECT(archive_command), LSQ_ARCHIVE_TEMP_FILE);
+ const gchar *out_filename = g_object_get_data(G_OBJECT(spawn_command), LSQ_ARCHIVE_TEMP_FILE);
out_file = fopen(out_filename, "ab");
if(!out_file)
return FALSE;
- status = lsq_archive_command_read_bytes(archive_command, 1, buf, 1024, (gsize *)&read, &error);
+ status = lsq_spawn_command_read_bytes(spawn_command, 1, buf, 1024, (gsize *)&read, &error);
if(status == G_IO_STATUS_EOF)
{
fclose(out_file);
@@ -472,20 +472,20 @@
}
static gboolean
-lsq_command_builder_gnu_tar_compress_parse_output(LSQArchiveCommand *archive_command, gpointer user_data)
+lsq_command_builder_gnu_tar_compress_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data)
{
GIOStatus status = G_IO_STATUS_NORMAL;
gchar *buf = g_new0(gchar, 1024);
- LSQArchive *archive = lsq_archive_command_get_archive(archive_command);
+ LSQArchive *archive = lsq_archive_command_get_archive(LSQ_ARCHIVE_COMMAND(spawn_command));
guint read = 0;
GError *error = NULL;
FILE *out_file;
const gchar *out_filename = lsq_archive_get_path(archive);
- gboolean remove = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(archive_command), "compressing"));
+ gboolean remove = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(spawn_command), "compressing"));
if(remove == FALSE)
{
- g_object_set_data(G_OBJECT(archive_command), "compressing", GUINT_TO_POINTER(TRUE));
+ g_object_set_data(G_OBJECT(spawn_command), "compressing", GUINT_TO_POINTER(TRUE));
g_unlink(out_filename);
}
@@ -493,7 +493,7 @@
if(!out_file)
return FALSE;
- status = lsq_archive_command_read_bytes(archive_command, 1, buf, 1024, (gsize *)&read, &error);
+ status = lsq_spawn_command_read_bytes(spawn_command, 1, buf, 1024, (gsize *)&read, &error);
if(status == G_IO_STATUS_EOF)
{
fclose(out_file);
@@ -508,3 +508,13 @@
g_free(buf);
return TRUE;
}
+
+LSQCommandBuilder *
+lsq_command_builder_gnu_tar_new()
+{
+ LSQCommandBuilder *builder;
+
+ builder = g_object_new(lsq_command_builder_gnu_tar_get_type(), NULL);
+
+ return builder;
+}
Modified: squeeze/trunk/libsqueeze/command-builder-gnu-tar.h
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-gnu-tar.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-gnu-tar.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -48,9 +48,10 @@
struct _LSQCommandBuilderGnuTarClass
{
- GObjectClass parent;
+ LSQCommandBuilderClass parent;
};
GType lsq_command_builder_gnu_tar_get_type(void);
+LSQCommandBuilder *lsq_command_builder_gnu_tar_new();
#endif /* __LIBSQUEEZE_COMMAND_BUILDER_GNU_TAR_H__ */
Modified: squeeze/trunk/libsqueeze/command-builder-rar.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-rar.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-rar.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -68,7 +68,7 @@
NULL
};
- lsq_command_builder_rar_type = g_type_register_static (G_TYPE_OBJECT, "LSQCommandBuilderRar", &lsq_command_builder_rar_info, 0);
+ lsq_command_builder_rar_type = g_type_register_static (LSQ_TYPE_COMMAND_BUILDER, "LSQCommandBuilderRar", &lsq_command_builder_rar_info, 0);
}
return lsq_command_builder_rar_type;
}
@@ -166,3 +166,12 @@
return spawn;
}
+LSQCommandBuilder *
+lsq_command_builder_rar_new()
+{
+ LSQCommandBuilder *builder;
+
+ builder = g_object_new(lsq_command_builder_rar_get_type(), NULL);
+
+ return builder;
+}
Modified: squeeze/trunk/libsqueeze/command-builder-rar.h
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-rar.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-rar.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -48,9 +48,10 @@
struct _LSQCommandBuilderRarClass
{
- GObjectClass parent;
+ LSQCommandBuilderClass parent;
};
GType lsq_command_builder_rar_get_type(void);
+LSQCommandBuilder *lsq_command_builder_rar_new();
#endif /* __LIBSQUEEZE_COMMAND_BUILDER_RAR_H__ */
Modified: squeeze/trunk/libsqueeze/command-builder-zip.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-zip.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-zip.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -47,7 +47,7 @@
lsq_command_builder_zip_build_remove(LSQCommandBuilder *builder, LSQArchive *archive, GSList *files);
static gboolean
-lsq_command_builder_zip_refresh_parse_output(LSQArchiveCommand *archive_command, gpointer user_data);
+lsq_command_builder_zip_refresh_parse_output(LSQSpawnCommand *, gpointer);
static GObjectClass *parent_class;
@@ -72,7 +72,7 @@
NULL
};
- lsq_command_builder_zip_type = g_type_register_static (G_TYPE_OBJECT, "LSQCommandBuilderZip", &lsq_command_builder_zip_info, 0);
+ lsq_command_builder_zip_type = g_type_register_static (LSQ_TYPE_COMMAND_BUILDER, "LSQCommandBuilderZip", &lsq_command_builder_zip_info, 0);
}
return lsq_command_builder_zip_type;
}
@@ -85,7 +85,7 @@
object_class->dispose = lsq_command_builder_zip_dispose;
object_class->finalize = lsq_command_builder_zip_finalize;
- parent_class = g_type_class_peek(G_TYPE_OBJECT);
+ parent_class = g_type_class_peek(LSQ_TYPE_COMMAND_BUILDER);
}
@@ -177,12 +177,12 @@
}
static gboolean
-lsq_command_builder_zip_refresh_parse_output(LSQArchiveCommand *archive_command, gpointer user_data)
+lsq_command_builder_zip_refresh_parse_output(LSQSpawnCommand *spawn_command, gpointer user_data)
{
gchar *line = NULL;
gsize linesize = 0;
GIOStatus status = G_IO_STATUS_NORMAL;
- LSQArchive *archive = lsq_archive_command_get_archive(archive_command);
+ LSQArchive *archive = lsq_archive_command_get_archive(LSQ_ARCHIVE_COMMAND(spawn_command));
guint64 size;
guint64 length;
gpointer props[8];
@@ -191,7 +191,7 @@
LSQArchiveIter *entry;
- status = lsq_archive_command_read_line(archive_command, 1, &line, &linesize, NULL);
+ status = lsq_spawn_command_read_line(spawn_command, 1, &line, &linesize, NULL);
if (line == NULL)
{
if(status == G_IO_STATUS_AGAIN)
@@ -297,3 +297,13 @@
return TRUE;
}
+
+LSQCommandBuilder *
+lsq_command_builder_zip_new()
+{
+ LSQCommandBuilder *builder;
+
+ builder = g_object_new(lsq_command_builder_zip_get_type(), NULL);
+
+ return builder;
+}
Modified: squeeze/trunk/libsqueeze/command-builder-zip.h
===================================================================
--- squeeze/trunk/libsqueeze/command-builder-zip.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder-zip.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -48,9 +48,10 @@
struct _LSQCommandBuilderZipClass
{
- GObjectClass parent;
+ LSQCommandBuilderClass parent;
};
GType lsq_command_builder_zip_get_type(void);
+LSQCommandBuilder *lsq_command_builder_zip_new();
#endif /* __LIBSQUEEZE_COMMAND_BUILDER_ZIP_H__ */
Modified: squeeze/trunk/libsqueeze/command-builder.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -46,6 +46,9 @@
static LSQArchiveCommand *
lsq_command_builder_build_open(LSQCommandBuilder *builder, LSQArchive *archive, GSList *files);
+static gint
+lsq_command_builder_lookup_id(gconstpointer command_builder, gconstpointer id);
+
static GObjectClass *parent_class;
GType
@@ -129,3 +132,21 @@
return macro;
}
+
+LSQCommandBuilder *
+lsq_command_builder_get_by_id(const gchar *id)
+{
+ GSList *result = g_slist_find_custom(lsq_command_builder_list, id, lsq_command_builder_lookup_id);
+ if(result)
+ {
+ g_object_ref(result->data);
+ return result->data;
+ }
+ return NULL;
+}
+
+static gint
+lsq_command_builder_lookup_id(gconstpointer command_builder, gconstpointer id)
+{
+ return (strcmp(LSQ_COMMAND_BUILDER(command_builder)->id, (gchar *)id));
+}
Modified: squeeze/trunk/libsqueeze/command-builder.h
===================================================================
--- squeeze/trunk/libsqueeze/command-builder.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/command-builder.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -29,11 +29,11 @@
gchar *id;
gchar **mime_types;
- LSQArchiveCommand *(*build_add) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *files);
- LSQArchiveCommand *(*build_extract)(LSQCommandBuilder *builder, LSQArchive *archive, const gchar *dest_path, GSList *files);
- LSQArchiveCommand *(*build_remove) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *file_iters);
- LSQArchiveCommand *(*build_refresh)(LSQCommandBuilder *builder, LSQArchive *archive);
- LSQArchiveCommand *(*build_open) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *files);
+ LSQArchiveCommand *(*build_add) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *files) G_GNUC_WARN_UNUSED_RESULT;
+ LSQArchiveCommand *(*build_extract)(LSQCommandBuilder *builder, LSQArchive *archive, const gchar *dest_path, GSList *files) G_GNUC_WARN_UNUSED_RESULT;
+ LSQArchiveCommand *(*build_remove) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *file_iters) G_GNUC_WARN_UNUSED_RESULT;
+ LSQArchiveCommand *(*build_refresh)(LSQCommandBuilder *builder, LSQArchive *archive) G_GNUC_WARN_UNUSED_RESULT;
+ LSQArchiveCommand *(*build_open) (LSQCommandBuilder *builder, LSQArchive *archive, GSList *files) G_GNUC_WARN_UNUSED_RESULT;
};
typedef struct _LSQCommandBuilderClass LSQCommandBuilderClass;
@@ -44,5 +44,6 @@
};
GType lsq_command_builder_get_type(void);
+LSQCommandBuilder *lsq_command_builder_get_by_id(const gchar *id);
#endif /* __LIBSQUEEZE_COMMAND_BUILDER_H__ */
Modified: squeeze/trunk/libsqueeze/internals.h
===================================================================
--- squeeze/trunk/libsqueeze/internals.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/internals.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -14,7 +14,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-GSList *lsq_archive_support_list;
+GSList *lsq_command_builder_list;
GSList *lsq_opened_archive_list;
ThunarVfsPath *lsq_relative_base_path;
Modified: squeeze/trunk/libsqueeze/libsqueeze-archive.h
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze-archive.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/libsqueeze-archive.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -68,7 +68,13 @@
LSQArchiveIter *lsq_archive_iter_ref(LSQArchiveIter *iter);
void lsq_archive_iter_unref(LSQArchiveIter *iter);
+gboolean lsq_archive_add(LSQArchive *, GSList *files);
+gboolean lsq_archive_extract(LSQArchive *, const gchar *dest_path, GSList *files);
+gboolean lsq_archive_remove(LSQArchive *, GSList *files);
+gboolean lsq_archive_refresh(LSQArchive *);
+gboolean lsq_archive_view(LSQArchive *, GSList *files);
+
G_END_DECLS
#endif /* __LIBSQUEEZE_ARCHIVE_H__ */
Modified: squeeze/trunk/libsqueeze/libsqueeze-command.h
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze-command.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/libsqueeze-command.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -39,34 +39,11 @@
typedef struct _LSQArchiveCommand LSQArchiveCommand;
-typedef gboolean (*LSQParseFunc) (LSQArchiveCommand *archive_command, gpointer user_data);
typedef struct _LSQArchiveCommandClass LSQArchiveCommandClass;
GType lsq_archive_command_get_type(void);
-LSQArchiveCommand *lsq_archive_command_new(const gchar *comment,
- const gchar *command,
- gboolean safe,
- gboolean change);
-void lsq_archive_enqueue_command(LSQArchive *archive, LSQArchiveCommand *command);
-
-GIOStatus lsq_archive_command_read_line(LSQArchiveCommand *archive_command,
- guint fd,
- gchar **lines,
- gsize *length,
- GError **error);
-GIOStatus lsq_archive_command_read_bytes(LSQArchiveCommand *archive_command,
- guint fd,
- gchar *buf,
- gsize max_length,
- gsize *length,
- GError **error);
-gboolean lsq_archive_command_set_parse_func(LSQArchiveCommand *archive_command,
- guint fd,
- LSQParseFunc func,
- gpointer user_data);
-
LSQArchive *lsq_archive_command_get_archive(LSQArchiveCommand *command);
G_END_DECLS
Modified: squeeze/trunk/libsqueeze/libsqueeze-module.h
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze-module.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/libsqueeze-module.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -18,11 +18,11 @@
#include <libsqueeze/libsqueeze-archive.h>
#include <libsqueeze/libsqueeze-command.h>
-#include <libsqueeze/command-builder.h>
#include <libsqueeze/archive-command.h>
#include <libsqueeze/macro-command.h>
#include <libsqueeze/spawn-command.h>
#include <libsqueeze/dbus-command.h>
+#include <libsqueeze/command-builder.h>
#include <libsqueeze/internals.h>
G_BEGIN_DECLS
Modified: squeeze/trunk/libsqueeze/libsqueeze.c
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/libsqueeze.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -41,12 +41,10 @@
lsq_mime_database = thunar_vfs_mime_database_get_default();
-/*
- lsq_register_support(lsq_archive_support_zip_new());
- lsq_register_support(lsq_archive_support_gnu_tar_new());
- lsq_register_support(lsq_archive_support_compr_new());
- lsq_register_support(lsq_archive_support_rar_new());
- */
+ lsq_command_builder_list = g_slist_prepend(lsq_command_builder_list, lsq_command_builder_zip_new());
+ lsq_command_builder_list = g_slist_prepend(lsq_command_builder_list, lsq_command_builder_gnu_tar_new());
+ lsq_command_builder_list = g_slist_prepend(lsq_command_builder_list, lsq_command_builder_rar_new());
+ lsq_command_builder_list = g_slist_prepend(lsq_command_builder_list, lsq_command_builder_compr_new());
lsq_relative_base_path = thunar_vfs_path_new(current_dir, NULL);
lsq_opened_archive_list = NULL;
@@ -56,7 +54,7 @@
void
lsq_shutdown()
{
- g_slist_foreach(lsq_archive_support_list, (GFunc)g_object_unref, NULL);
+ g_slist_foreach(lsq_command_builder_list, (GFunc)g_object_unref, NULL);
g_slist_foreach(lsq_opened_archive_list, (GFunc)g_object_unref, NULL);
g_object_unref(lsq_mime_database);
Modified: squeeze/trunk/libsqueeze/spawn-command.c
===================================================================
--- squeeze/trunk/libsqueeze/spawn-command.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/spawn-command.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -305,7 +305,7 @@
for(; i < 500; i++)
{
/* If parse_stdout returns FALSE, something seriously went wrong and we should cancel right away */
- if(spawn_command->parse_stdout(archive_command, archive_command->user_data) == FALSE)
+ if(spawn_command->parse_stdout(spawn_command, archive_command->user_data) == FALSE)
{
cond |= G_IO_ERR;
}
Modified: squeeze/trunk/libsqueeze/spawn-command.h
===================================================================
--- squeeze/trunk/libsqueeze/spawn-command.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/libsqueeze/spawn-command.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -37,8 +37,11 @@
G_TYPE_CHECK_CLASS_TYPE ((class), \
LSQ_TYPE_SPAWN_COMMAND))
+
typedef struct _LSQSpawnCommand LSQSpawnCommand;
+typedef gboolean (*LSQParseFunc) (LSQSpawnCommand *, gpointer user_data);
+
struct _LSQSpawnCommand
{
LSQArchiveCommand parent;
@@ -76,5 +79,21 @@
gboolean
lsq_spawn_command_set_parse_func(LSQSpawnCommand *spawn_command, guint fd, LSQParseFunc func, gpointer user_data);
+GIOStatus
+lsq_spawn_command_read_line(LSQSpawnCommand *spawn_command,
+ guint fd,
+ gchar **lines,
+ gsize *length,
+ GError **error);
+
+GIOStatus
+lsq_spawn_command_read_bytes(LSQSpawnCommand *spawn_command,
+ guint fd,
+ gchar *buf,
+ gsize max_length,
+ gsize *length,
+ GError **error);
+
+
G_END_DECLS
#endif /* __LIBSQUEEZE_ARCHIVE_COMMAND_H__ */
Added: squeeze/trunk/libsqueeze/vfs-mime.c
===================================================================
--- squeeze/trunk/libsqueeze/vfs-mime.c (rev 0)
+++ squeeze/trunk/libsqueeze/vfs-mime.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+
Added: squeeze/trunk/libsqueeze/vfs-mime.h
===================================================================
--- squeeze/trunk/libsqueeze/vfs-mime.h (rev 0)
+++ squeeze/trunk/libsqueeze/vfs-mime.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+#ifndef __LIBSQUEEZE_VFS_MIME_H__
+#define __LIBSQUEEZE_VFS_MIME_H__
+
+typedef struct ThunarVfsMimeInfo LSQVfsMimeInfo;
+
+#endif
Modified: squeeze/trunk/src/add_dialog.c
===================================================================
--- squeeze/trunk/src/add_dialog.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/add_dialog.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -136,35 +136,16 @@
}
GtkWidget *
-sq_add_dialog_new(LSQArchiveSupport *support)
+sq_add_dialog_new()
{
SQAddDialog *dialog;
- GtkWidget *optionbox;
dialog = g_object_new(sq_add_dialog_get_type(),
"title", _("Add file(s) to archive"),
NULL);
- optionbox = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(dialog->optionframe), optionbox);
-
- dialog->support = support;
-/*
- if(support)
- {
- add_options = lsq_archive_support_list_properties(support, "add");
- while(add_options)
- {
- test = sq_widget_factory_create_property_widget(factory, G_OBJECT(support), g_param_spec_get_name(G_PARAM_SPEC(add_options->data)));
- gtk_box_pack_start(GTK_BOX(optionbox), test, FALSE, FALSE, 0);
- add_options = add_options->next;
- }
- }
-*/
-
gtk_widget_set_size_request(GTK_WIDGET(dialog), 400,300);
- gtk_widget_show_all(optionbox);
return (GtkWidget*)dialog;
}
Modified: squeeze/trunk/src/add_dialog.h
===================================================================
--- squeeze/trunk/src/add_dialog.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/add_dialog.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -47,7 +47,6 @@
GtkWidget *file_treeview;
GtkWidget *files_radio;
GtkWidget *dirs_radio;
- LSQArchiveSupport *support;
GtkWidget *add;
GtkWidget *remove;
};
@@ -60,7 +59,7 @@
};
GType sq_add_dialog_get_type();
-GtkWidget *sq_add_dialog_new(LSQArchiveSupport *support);
+GtkWidget *sq_add_dialog_new();
GSList *sq_add_dialog_get_filenames(SQAddDialog *dialog);
G_END_DECLS
Modified: squeeze/trunk/src/application.c
===================================================================
--- squeeze/trunk/src/application.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/application.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -152,7 +152,6 @@
{
GtkWidget *dialog = NULL;
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
if(lsq_open_archive(archive_path, &lp_archive))
{
/*
@@ -165,10 +164,9 @@
gtk_widget_destroy (GTK_WIDGET (dialog) );
return 1;
}
- lp_support = lsq_get_support_for_mimetype(lsq_archive_get_mimetype(lp_archive));
if(!dest_path)
{
- GtkWidget *extr_dialog = sq_extract_archive_dialog_new(lp_support, lp_archive, 0);
+ GtkWidget *extr_dialog = sq_extract_archive_dialog_new(lp_archive, 0);
gint result = gtk_dialog_run (GTK_DIALOG (extr_dialog) );
if(result == GTK_RESPONSE_OK)
{
@@ -183,7 +181,7 @@
return 1;
}
g_signal_connect(G_OBJECT(lp_archive), "command-terminated", G_CALLBACK(cb_sq_application_archive_command_terminated), app);
- if(lsq_archive_support_extract(lp_support, lp_archive, dest_path, NULL))
+ if(lsq_archive_extract(lp_archive, dest_path, NULL))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -207,7 +205,6 @@
GtkWidget *dialog = NULL;
gint result = 0;
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
if(!archive_path)
{
@@ -257,8 +254,7 @@
}
}
g_signal_connect(G_OBJECT(lp_archive), "command-terminated", G_CALLBACK(cb_sq_application_archive_command_terminated), app);
- lp_support = lsq_get_support_for_mimetype(lsq_archive_get_mimetype(lp_archive));
- if(lsq_archive_support_add(lp_support, lp_archive, files))
+ if(lsq_archive_add(lp_archive, files))
{
/* FIXME: show warning dialog */
GtkWidget *warning_dialog = gtk_message_dialog_new(NULL,
@@ -298,13 +294,6 @@
cb_sq_application_archive_command_terminated(LSQArchive *archive, GError *error, gpointer userdata)
{
SQApplication *app = userdata;
- if(lsq_archive_has_queue(archive))
- {
- return;
- }
- else
- {
- lsq_close_archive(archive);
- g_object_unref(app);
- }
+ lsq_close_archive(archive);
+ g_object_unref(app);
}
Modified: squeeze/trunk/src/archive_store.c
===================================================================
--- squeeze/trunk/src/archive_store.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/archive_store.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -218,7 +218,6 @@
{
as->stamp = g_random_int();
as->archive = NULL;
- as->support = NULL;
as->sort_column = GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID;
as->sort_order = GTK_SORT_ASCENDING;
as->sort_list = NULL;
@@ -1568,18 +1567,6 @@
return archive_store->archive;
}
-LSQArchiveSupport *
-sq_archive_store_get_support(SQArchiveStore *archive_store)
-{
- return archive_store->support;
-}
-
-void
-sq_archive_store_set_support(SQArchiveStore *archive_store, LSQArchiveSupport *support)
-{
- archive_store->support = support;
-}
-
static void
sq_archive_store_dispose(GObject *object)
{
Modified: squeeze/trunk/src/archive_store.h
===================================================================
--- squeeze/trunk/src/archive_store.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/archive_store.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -43,7 +43,6 @@
GObject parent;
gint stamp;
LSQArchive *archive;
- LSQArchiveSupport *support;
gint sort_column;
GtkSortType sort_order;
LSQArchiveIter **sort_list;
@@ -113,10 +112,7 @@
LSQArchive *
sq_archive_store_get_archive(SQArchiveStore *archive_store);
-LSQArchiveSupport *
-sq_archive_store_get_support(SQArchiveStore *archive_store);
void sq_archive_store_set_archive(SQArchiveStore *archive_store, LSQArchive *archive);
-void sq_archive_store_set_support(SQArchiveStore *archive_store, LSQArchiveSupport *support);
#endif /* __SQRCHIVER_ARCHIVE_STORE_H__ */
Modified: squeeze/trunk/src/extract_dialog.c
===================================================================
--- squeeze/trunk/src/extract_dialog.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/extract_dialog.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -103,7 +103,7 @@
}
GtkWidget *
-sq_extract_archive_dialog_new(LSQArchiveSupport *support, LSQArchive *archive, gboolean sel_option)
+sq_extract_archive_dialog_new(LSQArchive *archive, gboolean sel_option)
{
SQExtractArchiveDialog *dialog;
@@ -115,19 +115,6 @@
GtkWidget *r_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(dialog->r_frame), r_vbox);
- dialog->support = support;
-/*
- if(dialog->support)
- {
- extract_options = lsq_archive_support_list_properties(support, "extract");
- while(extract_options)
- {
- test = sq_widget_factory_create_property_widget(factory, G_OBJECT(support), g_param_spec_get_name(G_PARAM_SPEC(extract_options->data)));
- gtk_box_pack_start(GTK_BOX(r_vbox), test, FALSE, FALSE, 0);
- extract_options = extract_options->next;
- }
- }
-*/
/* 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);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename_components[0]);
@@ -146,7 +133,6 @@
g_value_set_boolean(val, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
- g_object_set_property(G_OBJECT(SQ_EXTRACT_ARCHIVE_DIALOG(gtk_widget_get_ancestor(widget, GTK_TYPE_DIALOG))->support), (gchar *)data, val);
g_free(val);
}
@@ -158,7 +144,6 @@
{
val = g_value_init(val, G_TYPE_STRING);
g_object_get_property(G_OBJECT(widget), "text", val);
- g_object_set_property(G_OBJECT(SQ_EXTRACT_ARCHIVE_DIALOG(gtk_widget_get_ancestor(widget, GTK_TYPE_DIALOG))->support), (gchar *)data, val);
}
g_free(val);
}
Modified: squeeze/trunk/src/extract_dialog.h
===================================================================
--- squeeze/trunk/src/extract_dialog.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/extract_dialog.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -46,7 +46,6 @@
GtkWidget *all_files_radio;
GtkWidget *sel_files_radio;
LSQArchive *archive;
- LSQArchiveSupport *support;
};
typedef struct _SQExtractArchiveDialogClass SQExtractArchiveDialogClass;
@@ -57,7 +56,7 @@
};
GType sq_extract_archive_dialog_get_type();
-GtkWidget *sq_extract_archive_dialog_new(LSQArchiveSupport *, LSQArchive *, gboolean);
+GtkWidget *sq_extract_archive_dialog_new(LSQArchive *, gboolean);
G_END_DECLS
#endif /* __SQRCHIVER_EXTRACT_ARCHIVE_DIALOG_H__ */
Modified: squeeze/trunk/src/main_window.c
===================================================================
--- squeeze/trunk/src/main_window.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/main_window.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -608,7 +608,7 @@
}
static void
-sq_main_window_new_action_menu(SQMainWindow *window, LSQArchiveSupport *support, LSQArchive *archive)
+sq_main_window_new_action_menu(SQMainWindow *window, LSQArchive *archive)
{
}
@@ -619,7 +619,6 @@
gchar *archive_path = NULL;
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
LSQArchive *archive = NULL;
- LSQArchiveSupport *support = NULL;
gint result = 0;
result = gtk_dialog_run (GTK_DIALOG (dialog) );
@@ -634,8 +633,7 @@
if(!lsq_new_archive(archive_path, TRUE, NULL, &archive))
{
- support = lsq_get_support_for_mimetype(lsq_archive_get_mimetype(archive));
- sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, support, TRUE);
+ sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, TRUE);
}
else
{
@@ -714,13 +712,12 @@
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
GSList *filenames = sq_notebook_get_selected_items(SQ_NOTEBOOK(window->notebook));
- sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive, &lp_support);
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive);
- dialog = sq_extract_archive_dialog_new(lp_support, lp_archive, g_slist_length(filenames));
+ dialog = sq_extract_archive_dialog_new(lp_archive, g_slist_length(filenames));
result = gtk_dialog_run (GTK_DIALOG (dialog) );
if(result == GTK_RESPONSE_OK)
{
@@ -731,7 +728,7 @@
g_slist_free(filenames);
filenames = NULL;
}
- if(lsq_archive_support_extract(lp_support, lp_archive, extract_archive_path, filenames))
+ if(lsq_archive_extract(lp_archive, extract_archive_path, filenames))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -757,13 +754,12 @@
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
GtkWidget *dialog = NULL;
GSList *filenames = NULL;
gint result;
- sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive, &lp_support);
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive);
- dialog = sq_add_dialog_new(lp_support);
+ dialog = sq_add_dialog_new();
result = gtk_dialog_run (GTK_DIALOG(dialog));
if(result == GTK_RESPONSE_OK)
@@ -772,7 +768,7 @@
filenames = sq_add_dialog_get_filenames(SQ_ADD_DIALOG(dialog));
if(filenames)
{
- if(lsq_archive_support_add(lp_support, lp_archive, filenames))
+ if(lsq_archive_add(lp_archive, filenames))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -792,7 +788,6 @@
{
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
GtkWidget *dialog = NULL;
gint result = 0;
GSList *filenames = sq_notebook_get_selected_items(SQ_NOTEBOOK(window->notebook));
@@ -804,9 +799,9 @@
if(result == GTK_RESPONSE_YES)
{
gtk_widget_hide(dialog);
- sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive, &lp_support);
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive);
/* gtk_tree_view_set_model(sq_notebook_get_active_tree_view(SQ_NOTEBOOK(window->notebook)), NULL); */
- if(lsq_archive_support_remove(lp_support, lp_archive, filenames))
+ if(lsq_archive_remove(lp_archive, filenames))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -841,8 +836,7 @@
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
SQArchiveStore *store = sq_notebook_get_active_store(SQ_NOTEBOOK(window->notebook));
LSQArchive *archive = sq_archive_store_get_archive(store);
- LSQArchiveSupport *support = sq_archive_store_get_support(store);
- lsq_archive_support_refresh(support, archive);
+ lsq_archive_refresh(archive);
}
static void
@@ -851,10 +845,9 @@
SQMainWindow *window = SQ_MAIN_WINDOW(userdata);
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
GtkWidget *dialog = NULL;
gint result = 0;
- sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive, &lp_support);
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive);
if(lsq_archive_can_stop(lp_archive))
lsq_archive_stop(lp_archive);
@@ -978,13 +971,12 @@
cb_sq_main_window_notebook_page_switched(SQNotebook *notebook, GtkNotebookPage *page, guint page_nr, gpointer data)
{
LSQArchive *lp_archive;
- LSQArchiveSupport *lp_support;
- sq_notebook_page_get_archive(notebook, &lp_archive, &lp_support, page_nr);
+ 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));
- sq_main_window_new_action_menu(window, lp_support, lp_archive);
+ sq_main_window_new_action_menu(window, lp_archive);
guint context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(window->statusbar), "Window Statusbar");
gtk_statusbar_push(GTK_STATUSBAR(window->statusbar), context_id, lsq_archive_get_status(lp_archive));
@@ -1025,7 +1017,6 @@
{
GtkWindow *window = GTK_WINDOW(data);
LSQArchive *lp_archive = NULL;
- LSQArchiveSupport *lp_support = NULL;
gchar *extract_archive_path = NULL;
GtkWidget *label = gtk_label_new(_("Which action do you want to perform on the selected file(s)?"));
GtkWidget *dialog = gtk_dialog_new_with_buttons("",window,GTK_DIALOG_DESTROY_WITH_PARENT, _("Open"), GTK_RESPONSE_OK, _("Extract"), GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
@@ -1039,8 +1030,8 @@
switch(result)
{
case GTK_RESPONSE_OK: /* VIEW */
- sq_notebook_get_active_archive(SQ_NOTEBOOK(notebook), &lp_archive, &lp_support);
- if(lsq_archive_support_view(lp_support, lp_archive, filenames))
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(notebook), &lp_archive);
+ if(lsq_archive_view(lp_archive, filenames))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, _("Squeeze cannot view this file.\nthe application to support this is missing."));
if(warning_dialog)
@@ -1051,8 +1042,8 @@
}
break;
case GTK_RESPONSE_ACCEPT: /* EXTRACT */
- sq_notebook_get_active_archive(SQ_NOTEBOOK(notebook), &lp_archive, &lp_support);
- extr_dialog = sq_extract_archive_dialog_new(lp_support, lp_archive, 1);
+ sq_notebook_get_active_archive(SQ_NOTEBOOK(notebook), &lp_archive);
+ extr_dialog = sq_extract_archive_dialog_new(lp_archive, 1);
result = gtk_dialog_run (GTK_DIALOG (extr_dialog) );
if(result == GTK_RESPONSE_OK)
{
@@ -1063,7 +1054,7 @@
g_slist_free(filenames);
filenames = NULL;
}
- if(lsq_archive_support_extract(lp_support, lp_archive, extract_archive_path, filenames))
+ if(lsq_archive_extract(lp_archive, extract_archive_path, filenames))
{
GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1091,15 +1082,13 @@
sq_main_window_open_archive(SQMainWindow *window, gchar *path, gint replace)
{
LSQArchive *archive = NULL;
- LSQArchiveSupport *support = NULL;
if(!lsq_open_archive(path, &archive))
{
- support = lsq_get_support_for_mimetype(lsq_archive_get_mimetype(archive));
if(replace < 0)
- sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, support, FALSE);
+ sq_notebook_add_archive(SQ_NOTEBOOK(window->notebook), archive, FALSE);
else
- sq_notebook_page_set_archive(SQ_NOTEBOOK(window->notebook), archive, support, replace);
+ sq_notebook_page_set_archive(SQ_NOTEBOOK(window->notebook), archive, replace);
gtk_widget_set_sensitive(window->menubar.menu_item_close, TRUE);
gtk_widget_set_sensitive(window->menubar.menu_item_add, TRUE);
Modified: squeeze/trunk/src/new_dialog.c
===================================================================
--- squeeze/trunk/src/new_dialog.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/new_dialog.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -76,8 +76,7 @@
gtk_widget_show_all(hbox);
- GSList *supported_mime_types = lsq_get_supported_mime_types();
- GSList *_supported_mime_types = supported_mime_types;
+ GSList *_supported_mime_types = NULL;
dialog->file_filter = gtk_file_filter_new();
gtk_file_filter_set_name(dialog->file_filter, _("Archives"));
@@ -123,8 +122,6 @@
}
gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->archive_types_combo), 0);
- g_slist_free(supported_mime_types);
-
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,
Modified: squeeze/trunk/src/notebook.c
===================================================================
--- squeeze/trunk/src/notebook.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/notebook.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -481,7 +481,7 @@
}
void
-sq_notebook_add_archive(SQNotebook *notebook, LSQArchive *archive, LSQArchiveSupport *support, gboolean new_archive)
+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));
@@ -526,7 +526,6 @@
g_signal_connect(G_OBJECT(tree_model), "file-activated", G_CALLBACK(cb_notebook_file_activated), notebook);
- sq_archive_store_set_support(SQ_ARCHIVE_STORE(tree_model), support);
sq_archive_store_connect_treeview(SQ_ARCHIVE_STORE(tree_model), GTK_TREE_VIEW(tree_view));
gtk_tree_view_set_model(GTK_TREE_VIEW(tree_view), tree_model);
@@ -548,7 +547,7 @@
if(new_archive == FALSE)
{
- lsq_archive_support_refresh(support, archive);
+ lsq_archive_refresh(archive);
}
}
@@ -722,11 +721,11 @@
}
void
-sq_notebook_get_active_archive(SQNotebook *notebook, LSQArchive **lp_archive, LSQArchiveSupport **lp_support)
+sq_notebook_get_active_archive(SQNotebook *notebook, LSQArchive **lp_archive)
{
gint n = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
- sq_notebook_page_get_archive(notebook, lp_archive, lp_support, n);
+ sq_notebook_page_get_archive(notebook, lp_archive, n);
}
GtkWidget *
@@ -738,7 +737,7 @@
}
void
-sq_notebook_page_set_archive(SQNotebook *notebook, LSQArchive *archive, LSQArchiveSupport *support, gint n)
+sq_notebook_page_set_archive(SQNotebook *notebook, LSQArchive *archive, gint n)
{
if(gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)))
{
@@ -747,11 +746,10 @@
GtkTreeModel *store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
sq_archive_store_set_archive(SQ_ARCHIVE_STORE(store), archive);
- sq_archive_store_set_support(SQ_ARCHIVE_STORE(store), support);
g_signal_connect(G_OBJECT(archive), "refreshed", G_CALLBACK(cb_notebook_archive_refreshed), treeview);
- if(lsq_archive_support_refresh(support, archive))
+ if(lsq_archive_refresh(archive))
{
/* FIXME: show warning dialog */
}
@@ -759,7 +757,7 @@
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), store);
}
else
- sq_notebook_add_archive(SQ_NOTEBOOK(notebook), archive, support, FALSE);
+ sq_notebook_add_archive(SQ_NOTEBOOK(notebook), archive, FALSE);
}
GSList *
@@ -793,14 +791,12 @@
void
-sq_notebook_page_get_archive(SQNotebook *notebook, LSQArchive **lp_archive, LSQArchiveSupport **lp_support, gint n)
+sq_notebook_page_get_archive(SQNotebook *notebook, LSQArchive **lp_archive, gint n)
{
SQArchiveStore *store = sq_notebook_get_store(notebook, n);
if(lp_archive)
(*lp_archive) = sq_archive_store_get_archive(store);
- if(lp_support)
- (*lp_support) = sq_archive_store_get_support(store);
}
static void
Modified: squeeze/trunk/src/notebook.h
===================================================================
--- squeeze/trunk/src/notebook.h 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/notebook.h 2007-03-21 04:53:53 UTC (rev 25244)
@@ -72,11 +72,11 @@
GType sq_notebook_get_type ();
void sq_notebook_set_navigation_bar(SQNotebook *, SQNavigationBar *);
-void sq_notebook_add_archive(SQNotebook *, LSQArchive *, LSQArchiveSupport *, gboolean);
-void sq_notebook_page_set_archive(SQNotebook *, LSQArchive *, LSQArchiveSupport *, gint n);
-void sq_notebook_page_get_archive(SQNotebook *, LSQArchive **, LSQArchiveSupport **, gint n);
+void sq_notebook_add_archive(SQNotebook *, LSQArchive *, gboolean);
+void sq_notebook_page_set_archive(SQNotebook *, LSQArchive *, gint n);
+void sq_notebook_page_get_archive(SQNotebook *, LSQArchive **, gint n);
void sq_notebook_set_icon_theme(SQNotebook *, GtkIconTheme *);
-void sq_notebook_get_active_archive(SQNotebook *, LSQArchive **, LSQArchiveSupport **);
+void sq_notebook_get_active_archive(SQNotebook *, LSQArchive **);
gboolean sq_notebook_is_active_archive(SQNotebook *, LSQArchive *);
GtkWidget *sq_notebook_get_active_child(SQNotebook *notebook);
SQArchiveStore *sq_notebook_get_active_store(SQNotebook *notebook);
Modified: squeeze/trunk/src/tool_bar.c
===================================================================
--- squeeze/trunk/src/tool_bar.c 2007-03-20 21:24:12 UTC (rev 25243)
+++ squeeze/trunk/src/tool_bar.c 2007-03-21 04:53:53 UTC (rev 25244)
@@ -364,8 +364,7 @@
cb_sq_tool_bar_refresh(GtkWidget *refresh_button, SQToolBar *tool_bar)
{
LSQArchive *archive = sq_archive_store_get_archive(SQ_NAVIGATION_BAR(tool_bar)->store);
- LSQArchiveSupport *archive_support = sq_archive_store_get_support(SQ_NAVIGATION_BAR(tool_bar)->store);
- lsq_archive_support_refresh(archive_support, archive);
+ lsq_archive_refresh(archive);
}
static void
More information about the Xfce4-commits
mailing list