file-roller r2371 - in trunk: . src
- From: paobac svn gnome org
- To: svn-commits-list gnome org
- Subject: file-roller r2371 - in trunk: . src
- Date: Sun, 20 Jul 2008 17:20:26 +0000 (UTC)
Author: paobac
Date: Sun Jul 20 17:20:25 2008
New Revision: 2371
URL: http://svn.gnome.org/viewvc/file-roller?rev=2371&view=rev
Log:
2008-07-20 Paolo Bacchilega <paobac svn gnome org>
* configure.ac:
* src/typedefs.h:
* src/Makefile.am:
Register FrCompression enum in the gobject type system, because it's
used as a property.
* src/gtk-utils.c: removed unused function.
* src/fr-window.h:
* src/fr-window.c:
* src/fr-command-zoo.c:
* src/fr-command-zip.c:
* src/fr-command-unstuff.c:
* src/fr-command-tar.c:
* src/fr-command-rpm.c:
* src/fr-command-rar.h:
* src/fr-command-rar.c:
* src/fr-command-lha.c:
* src/fr-command-jar.c:
* src/fr-command-iso.c:
* src/fr-command-cpio.c:
* src/fr-command-cfile.c:
* src/fr-command-arj.c:
* src/fr-command-ar.c:
* src/fr-command-alz.c:
* src/fr-command-ace.c:
* src/fr-command-7z.h:
* src/fr-command-7z.c:
* src/fr-command.h:
* src/fr-command.c:
* src/fr-archive.h:
* src/fr-archive.c:
* src/dlg-extract.c:
* src/dlg-delete.c:
Reduce the number of FRCommand functions arguments by using
gobject properties.
* src/fr-archive.c (action_performed): update the capabilities
after listing the content, usefull for multivolume archives that are
read-only.
* src/dlg-batch-add.c (add_clicked_cb): always create a new archive,
calling fr_window_archive_new.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/src/Makefile.am
trunk/src/dlg-batch-add.c
trunk/src/dlg-delete.c
trunk/src/dlg-extract.c
trunk/src/fr-archive.c
trunk/src/fr-archive.h
trunk/src/fr-command-7z.c
trunk/src/fr-command-7z.h
trunk/src/fr-command-ace.c
trunk/src/fr-command-alz.c
trunk/src/fr-command-ar.c
trunk/src/fr-command-arj.c
trunk/src/fr-command-cfile.c
trunk/src/fr-command-cpio.c
trunk/src/fr-command-iso.c
trunk/src/fr-command-jar.c
trunk/src/fr-command-lha.c
trunk/src/fr-command-rar.c
trunk/src/fr-command-rar.h
trunk/src/fr-command-rpm.c
trunk/src/fr-command-tar.c
trunk/src/fr-command-unstuff.c
trunk/src/fr-command-zip.c
trunk/src/fr-command-zoo.c
trunk/src/fr-command.c
trunk/src/fr-command.h
trunk/src/fr-window.c
trunk/src/fr-window.h
trunk/src/gtk-utils.c
trunk/src/typedefs.h
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sun Jul 20 17:20:25 2008
@@ -13,6 +13,7 @@
AC_PROG_LIBTOOL
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
dnl ==========================================================================
dnl
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Sun Jul 20 17:20:25 2008
@@ -32,7 +32,9 @@
BUILT_SOURCES = \
fr-marshal.c \
- fr-marshal.h
+ fr-marshal.h \
+ fr-enum-types.h \
+ fr-enum-types.c
file_roller_SOURCES = \
actions.h \
@@ -139,6 +141,27 @@
echo "#include \"fr-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=fr_marshal >> $@
+fr-enum-types.h: typedefs.h $(GLIB_MKENUMS)
+ $(GLIB_MKENUMS) \
+ --fhead "#ifndef FR_ENUM__TYPES_H\n#define FR_ENUM_TYPES_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+ --fprod "/* enumerations from \"@filename \" */\n" \
+ --vhead "GType @enum_name _get_type (void);\n#define FR_TYPE_ ENUMSHORT@ (@enum_name _get_type())\n" \
+ --ftail "G_END_DECLS\n\n#endif /* FR_ENUM_TYPES_H */" \
+ $^> xgen-$(@F) \
+ && (cmp -s xgen-$(@F) fr-enum-types.h || cp xgen-$(@F) fr-enum-types.h ) \
+ && rm -f xgen-$(@F)
+
+fr-enum-types.c: typedefs.h fr-enum-types.h
+ $(GLIB_MKENUMS) \
+ --fhead "#include <glib-object.h>\n" \
+ --fprod "\n/* enumerations from \"@filename \" */\n#include \"@filename \"" \
+ --vhead "GType\n enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G Type@Value values[] = {" \
+ --vprod " { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
+ --vtail " { 0, NULL, NULL }\n };\n etype = g_ type@_register_static (\"@EnumName \", values);\n }\n return etype;\n}\n" \
+ $^> xgen-$(@F) \
+ && (cmp -s xgen-$(@F) fr-enum-types.c || cp xgen-$(@F) fr-enum-types.c ) \
+ && rm -f xgen-$(@F)
+
file_roller_LDADD = $(FR_LIBS)
EXTRA_DIST = fr-marshal.list
Modified: trunk/src/dlg-batch-add.c
==============================================================================
--- trunk/src/dlg-batch-add.c (original)
+++ trunk/src/dlg-batch-add.c Sun Jul 20 17:20:25 2008
@@ -345,10 +345,7 @@
set_archive_password (data);
gtk_widget_destroy (data->dialog);
- if (! uri_exists (archive_file))
- fr_window_archive_new (window, archive_file);
- else
- fr_window_archive_open (window, archive_file, GTK_WINDOW (window));
+ fr_window_archive_new (window, archive_file);
g_free (archive_name);
g_free (archive_dir);
Modified: trunk/src/dlg-delete.c
==============================================================================
--- trunk/src/dlg-delete.c (original)
+++ trunk/src/dlg-delete.c Sun Jul 20 17:20:25 2008
@@ -76,7 +76,7 @@
}
else if (pattern_files) {
const char *pattern;
-
+
pattern = gtk_entry_get_text (GTK_ENTRY (data->d_files_entry));
file_list = fr_window_get_file_list_pattern (window, pattern);
if (file_list == NULL)
@@ -90,7 +90,7 @@
/* remove ! */
if (! do_not_remove_if_null || (file_list != NULL))
- fr_window_archive_remove (window, file_list, fr_window_get_compression (window));
+ fr_window_archive_remove (window, file_list);
path_list_free (file_list);
}
@@ -117,7 +117,7 @@
data->window = window;
data->selected_files = selected_files;
-
+
data->gui = glade_xml_new (GLADEDIR "/" GLADE_FILE , NULL, NULL);
if (!data->gui) {
g_warning ("Could not find " GLADE_FILE "\n");
@@ -178,16 +178,16 @@
gpointer callback_data)
{
FrWindow *window = callback_data;
- dlg_delete__common (window,
+ dlg_delete__common (window,
fr_window_get_file_list_selection (window, TRUE, NULL));
}
-void
-dlg_delete_from_sidebar (GtkWidget *widget,
+void
+dlg_delete_from_sidebar (GtkWidget *widget,
gpointer callback_data)
{
FrWindow *window = callback_data;
- dlg_delete__common (window,
+ dlg_delete__common (window,
fr_window_get_folder_tree_selection (window, TRUE, NULL));
}
Modified: trunk/src/dlg-extract.c
==============================================================================
--- trunk/src/dlg-extract.c (original)
+++ trunk/src/dlg-extract.c Sun Jul 20 17:20:25 2008
@@ -39,7 +39,7 @@
FrWindow *window;
GList *selected_files;
char *base_dir_for_selection;
-
+
GtkWidget *dialog;
GtkWidget *e_main_vbox;
@@ -181,7 +181,7 @@
GTK_DIALOG_DESTROY_WITH_PARENT,
NULL,
_("Extraction not performed"),
- _("You don't have the right permissions to extract archives in the folder \"%s\""),
+ _("You don't have the right permissions to extract archives in the folder \"%s\""),
utf8_path);
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (GTK_WIDGET (d));
@@ -223,7 +223,7 @@
if (selected_files) {
file_list = data->selected_files;
data->selected_files = NULL; /* do not the list when destroying the dialog. */
- }
+ }
else if (pattern_files) {
const char *pattern;
@@ -258,7 +258,6 @@
skip_newer,
overwrite,
junk_paths,
- password,
TRUE);
path_list_free (file_list);
@@ -540,7 +539,7 @@
FrWindow *window = callback_data;
GList *files;
char *base_dir;
-
+
files = fr_window_get_selection (window, FALSE, &base_dir);
dlg_extract__common (window, files, base_dir);
}
@@ -553,7 +552,7 @@
FrWindow *window = callback_data;
GList *files;
char *base_dir;
-
+
files = fr_window_get_selection (window, TRUE, &base_dir);
dlg_extract__common (window, files, base_dir);
}
Modified: trunk/src/fr-archive.c
==============================================================================
--- trunk/src/fr-archive.c (original)
+++ trunk/src/fr-archive.c Sun Jul 20 17:20:25 2008
@@ -126,16 +126,16 @@
typedef struct {
FrArchive *archive;
char *uri;
- char *password;
- gboolean encrypt_header;
FrAction action;
GList *file_list;
char *base_uri;
char *dest_dir;
gboolean update;
- FrCompression compression;
char *tmp_dir;
guint source_id;
+ char *password;
+ gboolean encrypt_header;
+ FrCompression compression;
} XferData;
@@ -216,6 +216,16 @@
parent_class = g_type_class_peek_parent (class);
+ gobject_class->finalize = fr_archive_finalize;
+
+ class->start = NULL;
+ class->done = NULL;
+ class->progress = NULL;
+ class->message = NULL;
+ class->working_archive = NULL;
+
+ /* signals */
+
fr_archive_signals[START] =
g_signal_new ("start",
G_TYPE_FROM_CLASS (class),
@@ -263,21 +273,14 @@
G_TYPE_NONE,
1, G_TYPE_BOOLEAN);
fr_archive_signals[WORKING_ARCHIVE] =
- g_signal_new ("working_archive",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (FrArchiveClass, working_archive),
- NULL, NULL,
- fr_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
-
- gobject_class->finalize = fr_archive_finalize;
- class->start = NULL;
- class->done = NULL;
- class->progress = NULL;
- class->message = NULL;
- class->working_archive = NULL;
+ g_signal_new ("working_archive",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FrArchiveClass, working_archive),
+ NULL, NULL,
+ fr_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
}
@@ -910,6 +913,12 @@
}
break;
+ case FR_ACTION_LISTING_CONTENT:
+ fr_command_update_capabilities (archive->command);
+ if (! fr_command_is_capable_of (archive->command, FR_COMMAND_CAN_WRITE))
+ archive->read_only = TRUE;
+ break;
+
default:
/* nothing */
break;
@@ -1092,7 +1101,8 @@
/**/
fr_process_clear (archive->process);
- fr_command_list (archive->command, password);
+ g_object_set (archive->command, "password", password, NULL);
+ fr_command_list (archive->command);
fr_process_start (archive->process);
}
@@ -1410,6 +1420,12 @@
if (archive->read_only)
return;
+ g_object_set (archive->command,
+ "password", password,
+ "encrypt_header", encrypt_header,
+ "compression", compression,
+ NULL);
+
fr_archive_stoppable (archive, fr_archive_add_is_stoppable (archive));
file_list = convert_to_local_file_list (file_list);
@@ -1512,16 +1528,13 @@
chunk_list,
tmp_base_dir,
update,
- recursive,
- password,
- encrypt_header,
- compression);
+ recursive);
prev->next = scan;
}
path_list_free (new_file_list);
- fr_command_recompress (archive->command, compression);
+ fr_command_recompress (archive->command);
if (base_dir_created) { /* remove the temp dir */
fr_process_begin_command (archive->process, "rm");
@@ -2120,7 +2133,11 @@
* files without path info. FIXME: doesn't work with remote files. */
fr_archive_stoppable (archive, FALSE);
-
+ g_object_set (archive->command,
+ "password", data->password,
+ "encrypt_header", data->encrypt_header,
+ "compression", data->compression,
+ NULL);
fr_process_clear (archive->process);
fr_command_uncompress (archive->command);
for (scan = list; scan; scan = scan->next) {
@@ -2134,14 +2151,11 @@
singleton,
basedir,
data->update,
- FALSE,
- data->password,
- data->encrypt_header,
- data->compression);
+ FALSE);
g_list_free (singleton);
g_free (basedir);
}
- fr_command_recompress (archive->command, data->compression);
+ fr_command_recompress (archive->command);
fr_process_start (archive->process);
path_list_free (data->item_list);
@@ -2322,10 +2336,10 @@
return;
fr_archive_stoppable (archive, FALSE);
-
+ g_object_set (archive->command, "compression", compression, NULL);
fr_command_uncompress (archive->command);
archive_remove (archive, file_list);
- fr_command_recompress (archive->command, compression);
+ fr_command_recompress (archive->command);
}
@@ -2399,14 +2413,15 @@
{
GList *scan;
+ g_object_set (command, "password", password, NULL);
+
if (file_list == NULL) {
fr_command_extract (command,
file_list,
dest_dir,
overwrite,
skip_older,
- junk_paths,
- password);
+ junk_paths);
return;
}
@@ -2432,8 +2447,7 @@
dest_dir,
overwrite,
skip_older,
- junk_paths,
- password);
+ junk_paths);
prev->next = scan;
}
}
@@ -2959,9 +2973,12 @@
{
fr_archive_stoppable (archive, TRUE);
+ g_object_set (archive->command,
+ "password", password,
+ NULL);
fr_process_clear (archive->process);
fr_command_set_n_files (archive->command, 0);
- fr_command_test (archive->command, password);
+ fr_command_test (archive->command);
fr_process_start (archive->process);
}
@@ -2971,20 +2988,26 @@
{
GFile *file;
const char *mime_type;
+ gboolean is_archive = FALSE;
file = g_file_new_for_uri (uri);
- mime_type = get_mime_type_from_content (file);
+ mime_type = get_mime_type_from_magic_numbers (file);
+ if (mime_type == NULL)
+ mime_type = get_mime_type_from_content (file);
+ if (mime_type == NULL)
+ mime_type = get_mime_type_from_filename (file);
+
if (mime_type != NULL) {
int i;
for (i = 0; mime_type_desc[i].mime_type != NULL; i++) {
if (strcmp (mime_type_desc[i].mime_type, mime_type) == 0) {
- g_object_unref (file);
- return TRUE;
+ is_archive = TRUE;
+ break;
}
}
}
g_object_unref (file);
- return get_archive_filename_extension (uri) != NULL;
+ return is_archive;
}
Modified: trunk/src/fr-archive.h
==============================================================================
--- trunk/src/fr-archive.h (original)
+++ trunk/src/fr-archive.h Sun Jul 20 17:20:25 2008
@@ -90,16 +90,16 @@
GType fr_archive_get_type (void);
FrArchive * fr_archive_new (void);
-void fr_archive_set_fake_load_func (FrArchive *archive,
- FakeLoadFunc func,
- gpointer data);
-gboolean fr_archive_fake_load (FrArchive *archive);
-void fr_archive_set_add_is_stoppable_func (FrArchive *archive,
- FakeLoadFunc func,
- gpointer data);
-void fr_archive_stoppable (FrArchive *archive,
- gboolean stoppable);
-void fr_archive_stop (FrArchive *archive);
+void fr_archive_set_fake_load_func (FrArchive *archive,
+ FakeLoadFunc func,
+ gpointer data);
+gboolean fr_archive_fake_load (FrArchive *archive);
+void fr_archive_set_add_is_stoppable_func (FrArchive *archive,
+ FakeLoadFunc func,
+ gpointer data);
+void fr_archive_stoppable (FrArchive *archive,
+ gboolean stoppable);
+void fr_archive_stop (FrArchive *archive);
void fr_archive_action_completed (FrArchive *archive,
FrAction action,
FrProcErrorType error_type,
@@ -107,106 +107,107 @@
/**/
-gboolean fr_archive_create (FrArchive *archive,
- const char *uri);
-gboolean fr_archive_load (FrArchive *archive,
- const char *uri,
- const char *password);
-gboolean fr_archive_load_local (FrArchive *archive,
- const char *uri,
- const char *password);
-void fr_archive_reload (FrArchive *archive,
- const char *password);
-void fr_archive_rename (FrArchive *archive,
- const char *new_uri);
+gboolean fr_archive_create (FrArchive *archive,
+ const char *uri);
+gboolean fr_archive_load (FrArchive *archive,
+ const char *uri,
+ const char *password);
+gboolean fr_archive_load_local (FrArchive *archive,
+ const char *uri,
+ const char *password);
+void fr_archive_reload (FrArchive *archive,
+ const char *password);
+void fr_archive_rename (FrArchive *archive,
+ const char *new_uri);
/**/
-void fr_archive_add (FrArchive *archive,
- GList *file_list,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- gboolean recursive,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_remove (FrArchive *archive,
- GList *file_list,
- FrCompression compression);
-void fr_archive_extract (FrArchive *archive,
- GList *file_list,
- const char *dest_uri,
- const char *base_dir,
- gboolean skip_older,
- gboolean overwrite,
- gboolean junk_path,
- const char *password);
-void fr_archive_extract_to_local (FrArchive *archive,
- GList *file_list,
- const char *dest_path,
- const char *base_dir,
- gboolean skip_older,
- gboolean overwrite,
- gboolean junk_path,
- const char *password);
-gboolean fr_archive_extract_here (FrArchive *archive,
- gboolean skip_older,
- gboolean overwrite,
- gboolean junk_path,
- const char *password);
-const char *fr_archive_get_last_extraction_destination (FrArchive *archive);
+void fr_archive_add (FrArchive *archive,
+ GList *file_list,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ gboolean recursive,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_remove (FrArchive *archive,
+ GList *file_list,
+ FrCompression compression);
+void fr_archive_extract (FrArchive *archive,
+ GList *file_list,
+ const char *dest_uri,
+ const char *base_dir,
+ gboolean skip_older,
+ gboolean overwrite,
+ gboolean junk_path,
+ const char *password);
+void fr_archive_extract_to_local (FrArchive *archive,
+ GList *file_list,
+ const char *dest_path,
+ const char *base_dir,
+ gboolean skip_older,
+ gboolean overwrite,
+ gboolean junk_path,
+ const char *password);
+gboolean fr_archive_extract_here (FrArchive *archive,
+ gboolean skip_older,
+ gboolean overwrite,
+ gboolean junk_path,
+ const char *password);
+const char *fr_archive_get_last_extraction_destination
+ (FrArchive *archive);
/**/
-void fr_archive_add_files (FrArchive *archive,
- GList *file_list,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_add_with_wildcard (FrArchive *archive,
- const char *include_files,
- const char *exclude_files,
- const char *exclude_folders,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- gboolean follow_links,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_add_directory (FrArchive *archive,
- const char *directory,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_add_items (FrArchive *archive,
- GList *item_list,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_add_dropped_items (FrArchive *archive,
- GList *item_list,
- const char *base_dir,
- const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_archive_test (FrArchive *archive,
- const char *password);
+void fr_archive_add_files (FrArchive *archive,
+ GList *file_list,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_add_with_wildcard (FrArchive *archive,
+ const char *include_files,
+ const char *exclude_files,
+ const char *exclude_folders,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ gboolean follow_links,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_add_directory (FrArchive *archive,
+ const char *directory,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_add_items (FrArchive *archive,
+ GList *item_list,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_add_dropped_items (FrArchive *archive,
+ GList *item_list,
+ const char *base_dir,
+ const char *dest_dir,
+ gboolean update,
+ const char *password,
+ gboolean encrypt_header,
+ FrCompression compression);
+void fr_archive_test (FrArchive *archive,
+ const char *password);
-/* utils */
+/* utilities */
-gboolean uri_is_archive (const char *uri);
+gboolean uri_is_archive (const char *uri);
#endif /* ARCHIVE_H */
Modified: trunk/src/fr-command-7z.c
==============================================================================
--- trunk/src/fr-command-7z.c (original)
+++ trunk/src/fr-command-7z.c Sun Jul 20 17:20:25 2008
@@ -114,6 +114,11 @@
if (! p7z_comm->list_started) {
if (strncmp (line, "--------", 8) == 0)
p7z_comm->list_started = TRUE;
+ else if (strncmp (line, "Multivolume = ", 14) == 0) {
+ fields = g_strsplit (line, " = ", 2);
+ p7z_comm->multi_volume = (strcmp (fields[1], "+") == 0);
+ g_strfreev (fields);
+ }
return;
}
@@ -206,8 +211,7 @@
static void
-fr_command_7z_list (FrCommand *comm,
- const char *password)
+fr_command_7z_list (FrCommand *comm)
{
FrCommand7z *p7z_comm = FR_COMMAND_7Z (comm);
@@ -220,7 +224,7 @@
fr_process_add_arg (comm->process, "-slt");
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
- add_password_arg (comm, password, FALSE);
+ add_password_arg (comm, comm->password, FALSE);
fr_process_add_arg (comm->process, comm->filename);
fr_process_end_command (comm->process);
@@ -228,6 +232,7 @@
file_data_free (p7z_comm->fdata);
p7z_comm->fdata = NULL;
}
+ p7z_comm->multi_volume = FALSE;
p7z_comm->list_started = FALSE;
fr_process_start (comm->process);
}
@@ -238,9 +243,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -262,11 +265,11 @@
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
fr_process_add_arg (comm->process, "-l");
- add_password_arg (comm, password, FALSE);
- if ((password != NULL) && (*password != 0) && comm->encrypt_header)
+ add_password_arg (comm, comm->password, FALSE);
+ if ((comm->password != NULL) && (*comm->password != 0) && comm->encrypt_header)
fr_process_add_arg (comm->process, "-mhe=on");
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-mx=1"); break;
case FR_COMPRESSION_FAST:
@@ -320,8 +323,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -334,7 +336,7 @@
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
- add_password_arg (comm, password, FALSE);
+ add_password_arg (comm, comm->password, FALSE);
if (dest_dir != NULL)
fr_process_add_arg_concat (comm->process, "-o", dest_dir, NULL);
@@ -349,14 +351,13 @@
static void
-fr_command_7z_test (FrCommand *comm,
- const char *password)
+fr_command_7z_test (FrCommand *comm)
{
fr_command_7z_begin_command (comm);
fr_process_add_arg (comm->process, "t");
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
- add_password_arg (comm, password, FALSE);
+ add_password_arg (comm, comm->password, FALSE);
fr_process_add_arg (comm->process, comm->filename);
fr_process_end_command (comm->process);
}
@@ -431,6 +432,10 @@
}
}
+ /* multi-volumes are read-only */
+ if ((comm->files->len > 0) && FR_COMMAND_7Z (comm)->multi_volume && (capabilities & FR_COMMAND_CAN_WRITE))
+ capabilities ^= FR_COMMAND_CAN_WRITE;
+
return capabilities;
}
Modified: trunk/src/fr-command-7z.h
==============================================================================
--- trunk/src/fr-command-7z.h (original)
+++ trunk/src/fr-command-7z.h Sun Jul 20 17:20:25 2008
@@ -42,6 +42,7 @@
FrCommand __parent;
gboolean list_started;
FileData *fdata;
+ gboolean multi_volume;
};
struct _FrCommand7zClass
Modified: trunk/src/fr-command-ace.c
==============================================================================
--- trunk/src/fr-command-ace.c (original)
+++ trunk/src/fr-command-ace.c Sun Jul 20 17:20:25 2008
@@ -76,7 +76,7 @@
fields = g_strsplit (time, ":", 2);
if (fields[0] != NULL) {
tm.tm_hour = atoi (fields[0]);
- if (fields[1] != NULL)
+ if (fields[1] != NULL)
tm.tm_min = atoi (fields[1]);
}
tm.tm_sec = 0;
@@ -87,7 +87,7 @@
static void
-process_line (char *line,
+process_line (char *line,
gpointer data)
{
FileData *fdata;
@@ -105,7 +105,7 @@
else
ace_comm->command_type = FR_ACE_COMMAND_NONFREE;
}
- return;
+ return;
}
if (! ace_comm->list_started) {
@@ -143,7 +143,7 @@
if (field_name[0] != '/') {
fdata->full_path = g_strconcat ("/", field_name, NULL);
fdata->original_path = fdata->full_path + 1;
- }
+ }
else {
fdata->full_path = g_strdup (field_name);
fdata->original_path = fdata->full_path;
@@ -156,19 +156,18 @@
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
}
static void
-fr_command_ace_list (FrCommand *comm,
- const char *password)
+fr_command_ace_list (FrCommand *comm)
{
FR_COMMAND_ACE (comm)->list_started = FALSE;
FR_COMMAND_ACE (comm)->command_type = FR_ACE_COMMAND_UNKNOWN;
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
comm);
@@ -187,14 +186,13 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
fr_process_begin_command (comm->process, "unace");
- if (dest_dir != NULL)
+ if (dest_dir != NULL)
fr_process_set_working_dir (comm->process, dest_dir);
if (junk_paths)
@@ -212,8 +210,7 @@
static void
-fr_command_ace_test (FrCommand *comm,
- const char *password)
+fr_command_ace_test (FrCommand *comm)
{
fr_process_begin_command (comm->process, "unace");
fr_process_add_arg (comm->process, "t");
@@ -224,7 +221,7 @@
static void
-fr_command_ace_handle_error (FrCommand *comm,
+fr_command_ace_handle_error (FrCommand *comm,
FrProcError *error)
{
/* FIXME */
@@ -234,28 +231,28 @@
const char *ace_mime_type[] = { "application/x-ace", NULL };
-const char **
+const char **
fr_command_ace_get_mime_types (FrCommand *comm)
{
return ace_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_ace_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("unace"))
+ if (is_program_in_path ("unace"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
-static void
+static void
fr_command_ace_class_init (FrCommandAceClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -274,8 +271,8 @@
afc->get_capabilities = fr_command_ace_get_capabilities;
}
-
-static void
+
+static void
fr_command_ace_init (FrCommand *comm)
{
comm->propAddCanUpdate = TRUE;
@@ -288,12 +285,12 @@
}
-static void
+static void
fr_command_ace_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
g_return_if_fail (FR_IS_COMMAND_ACE (object));
-
+
/* Chain up */
if (G_OBJECT_CLASS (parent_class)->finalize)
G_OBJECT_CLASS (parent_class)->finalize (object);
Modified: trunk/src/fr-command-alz.c
==============================================================================
--- trunk/src/fr-command-alz.c (original)
+++ trunk/src/fr-command-alz.c Sun Jul 20 17:20:25 2008
@@ -46,7 +46,7 @@
static time_t
-mktime_from_string (char *date_s,
+mktime_from_string (char *date_s,
char *time_s)
{
struct tm tm = {0, };
@@ -70,7 +70,7 @@
fields = g_strsplit (time_s, ":", 3);
if (fields[0] != NULL) {
tm.tm_hour = atoi (fields[0]);
- if (fields[1] != NULL)
+ if (fields[1] != NULL)
tm.tm_min = atoi (fields[1]);
}
g_strfreev (fields);
@@ -80,7 +80,7 @@
static void
-process_line (char *line,
+process_line (char *line,
gpointer data)
{
FrCommand *comm = FR_COMMAND (data);
@@ -95,7 +95,7 @@
if (! alz_comm->list_started) {
- if (strncmp (line, "-----", 5 ) == 0 )
+ if (strncmp (line, "-----", 5 ) == 0 )
alz_comm->list_started = TRUE;
return;
}
@@ -106,7 +106,7 @@
}
- if (! alz_comm->list_started)
+ if (! alz_comm->list_started)
return;
fdata = file_data_new ();
@@ -127,7 +127,7 @@
if (*name_field == '/') {
fdata->full_path = g_strdup (name_field);
fdata->original_path = fdata->full_path;
- }
+ }
else {
fdata->full_path = g_strconcat ("/", name_field, NULL);
fdata->original_path = fdata->full_path + 1;
@@ -140,7 +140,7 @@
for (s = fdata->original_path; *s != '\0'; ++s)
if (*s == '\\') *s = '/';
fdata->name = dir_name_from_path (fdata->full_path);
- }
+ }
else {
fdata->name = g_strdup (file_name_from_path (fdata->full_path));
}
@@ -166,8 +166,8 @@
for (scan = env_list; *scan != NULL; ++scan) {
char *env = getenv (*scan);
-
- if (! env)
+
+ if (! env)
continue;
if (strstr (env, "UTF-8") || strstr (env, "utf-8"))
@@ -191,7 +191,7 @@
if (password != NULL) {
fr_process_add_arg (comm->process, "-pwd");
fr_process_add_arg (comm->process, password);
- }
+ }
else if (disable_query) {
fr_process_add_arg (comm->process, "-pwd");
fr_process_add_arg (comm->process, "");
@@ -200,13 +200,12 @@
static void
-fr_command_alz_list (FrCommand *comm,
- const char *password)
+fr_command_alz_list (FrCommand *comm)
{
FR_COMMAND_ALZ (comm)->list_started = FALSE;
FR_COMMAND_ALZ (comm)->invalid_password = FALSE;
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
comm);
@@ -223,7 +222,7 @@
/* -- extract -- */
static void
-process_extract_line (char *line,
+process_extract_line (char *line,
gpointer data)
{
FrCommand *comm = FR_COMMAND (data);
@@ -241,7 +240,7 @@
if (alz_comm->extract_none && (strncmp (line, "unalziiiing :", 13) == 0)) {
alz_comm->extract_none = FALSE;
- }
+ }
else if ((strncmp (line, "done..", 6) == 0) && alz_comm->extract_none) {
fr_process_stop (comm->process);
return;
@@ -255,13 +254,12 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
FR_COMMAND_ALZ (comm)->extract_none = TRUE;
-
+
fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_extract_line,
comm);
@@ -272,16 +270,16 @@
fr_process_add_arg (comm->process, dest_dir);
}
add_codepage_arg (comm);
- add_password_arg (comm, password, TRUE);
+ add_password_arg (comm, comm->password, TRUE);
fr_process_add_arg (comm->process, comm->filename);
- for (scan = file_list; scan; scan = scan->next)
+ for (scan = file_list; scan; scan = scan->next)
fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
static void
-fr_command_alz_handle_error (FrCommand *comm,
+fr_command_alz_handle_error (FrCommand *comm,
FrProcError *error)
{
if ((error->type == FR_PROC_ERROR_STOPPED)) {
@@ -296,28 +294,28 @@
const char *alz_mime_type[] = { "application/x-alz", NULL };
-const char **
+const char **
fr_command_alz_get_mime_types (FrCommand *comm)
{
return alz_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_alz_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("unalz"))
+ if (is_program_in_path ("unalz"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
-static void
+static void
fr_command_alz_class_init (FrCommandAlzClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -337,8 +335,8 @@
afc->get_capabilities = fr_command_alz_get_capabilities;
}
-
-static void
+
+static void
fr_command_alz_init (FrCommand *comm)
{
comm->propAddCanUpdate = TRUE;
@@ -351,7 +349,7 @@
}
-static void
+static void
fr_command_alz_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
Modified: trunk/src/fr-command-ar.c
==============================================================================
--- trunk/src/fr-command-ar.c (original)
+++ trunk/src/fr-command-ar.c Sun Jul 20 17:20:25 2008
@@ -48,7 +48,7 @@
char *month_s,
char *year_s)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct tm tm = {0, };
char **fields;
@@ -91,9 +91,9 @@
int field_n)
{
const char *f_start, *f_end;
-
+
line = line + start_from;
-
+
f_start = line;
while ((*f_start == ' ') && (*f_start != *line))
f_start++;
@@ -110,13 +110,13 @@
} else
f_end++;
}
-
+
return g_strdup (f_start);
}
static void
-process_line (char *line,
+process_line (char *line,
gpointer data)
{
FileData *fdata;
@@ -182,16 +182,15 @@
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
}
static void
-fr_command_ar_list (FrCommand *comm,
- const char *password)
+fr_command_ar_list (FrCommand *comm)
{
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
comm);
@@ -208,9 +207,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -221,12 +218,12 @@
else
fr_process_add_arg (comm->process, "r");
- if (base_dir != NULL)
+ if (base_dir != NULL)
fr_process_set_working_dir (comm->process, base_dir);
fr_process_add_arg (comm->process, comm->filename);
- for (scan = file_list; scan; scan = scan->next)
+ for (scan = file_list; scan; scan = scan->next)
fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
@@ -254,14 +251,13 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
fr_process_begin_command (comm->process, "ar");
- if (dest_dir != NULL)
+ if (dest_dir != NULL)
fr_process_set_working_dir (comm->process, dest_dir);
fr_process_add_arg (comm->process, "x");
@@ -273,7 +269,7 @@
static void
-fr_command_ar_handle_error (FrCommand *comm,
+fr_command_ar_handle_error (FrCommand *comm,
FrProcError *error)
{
/* FIXME */
@@ -283,28 +279,28 @@
const char *ar_mime_type[] = { "application/x-ar", NULL };
-const char **
+const char **
fr_command_ar_get_mime_types (FrCommand *comm)
{
return ar_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_ar_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("ar"))
+ if (is_program_in_path ("ar"))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
-
+
return capabilities;
}
-static void
+static void
fr_command_ar_class_init (FrCommandArClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -324,8 +320,8 @@
afc->get_capabilities = fr_command_ar_get_capabilities;
}
-
-static void
+
+static void
fr_command_ar_init (FrCommand *comm)
{
comm->propAddCanUpdate = TRUE;
@@ -339,12 +335,12 @@
}
-static void
+static void
fr_command_ar_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
g_return_if_fail (FR_IS_COMMAND_AR (object));
-
+
/* Chain up */
if (G_OBJECT_CLASS (parent_class)->finalize)
G_OBJECT_CLASS (parent_class)->finalize (object);
Modified: trunk/src/fr-command-arj.c
==============================================================================
--- trunk/src/fr-command-arj.c (original)
+++ trunk/src/fr-command-arj.c Sun Jul 20 17:20:25 2008
@@ -160,8 +160,7 @@
static void
-fr_command_arj_list (FrCommand *comm,
- const char *password)
+fr_command_arj_list (FrCommand *comm)
{
fr_process_set_out_line_func (FR_COMMAND (comm)->process,
list__process_line,
@@ -182,9 +181,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -198,10 +195,10 @@
if (update)
fr_process_add_arg (comm->process, "-u");
- if (password != NULL)
- fr_process_add_arg_concat (comm->process, "-g/", password, NULL);
+ if (comm->password != NULL)
+ fr_process_add_arg_concat (comm->process, "-g/", comm->password, NULL);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-m3"); break;
case FR_COMPRESSION_FAST:
@@ -252,8 +249,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -273,8 +269,8 @@
if (skip_older)
fr_process_add_arg (comm->process, "-u");
- if (password != NULL)
- fr_process_add_arg_concat (comm->process, "-g/", password, NULL);
+ if (comm->password != NULL)
+ fr_process_add_arg_concat (comm->process, "-g/", comm->password, NULL);
else
fr_process_add_arg (comm->process, "-g/");
@@ -292,13 +288,12 @@
static void
-fr_command_arj_test (FrCommand *comm,
- const char *password)
+fr_command_arj_test (FrCommand *comm)
{
fr_process_begin_command (comm->process, "arj");
fr_process_add_arg (comm->process, "t");
- if (password != NULL)
- fr_process_add_arg_concat (comm->process, "-g/", password, NULL);
+ if (comm->password != NULL)
+ fr_process_add_arg_concat (comm->process, "-g/", comm->password, NULL);
fr_process_add_arg (comm->process, "-i");
fr_process_add_arg (comm->process, "-y");
fr_process_add_arg (comm->process, "-");
Modified: trunk/src/fr-command-cfile.c
==============================================================================
--- trunk/src/fr-command-cfile.c (original)
+++ trunk/src/fr-command-cfile.c Sun Jul 20 17:20:25 2008
@@ -42,7 +42,7 @@
static char *
-get_uncompressed_name_from_archive (FrCommand *comm,
+get_uncompressed_name_from_archive (FrCommand *comm,
const char *archive)
{
int fd;
@@ -52,11 +52,11 @@
if (! is_mime_type (comm->mime_type, "application/x-gzip"))
return NULL;
-
+
fd = open (archive, O_RDONLY);
- if (fd < 0)
+ if (fd < 0)
return NULL;
-
+
if (read (fd, &buffer, 11) < 11) {
close (fd);
return NULL;
@@ -73,7 +73,7 @@
close (fd);
return NULL;
}
-
+
str = g_string_new ("");
/* Don't lose the first character */
g_string_append_c (str, buffer[10]);
@@ -87,10 +87,10 @@
#endif
return filename;
}
-
+
g_string_append_c (str, buffer[0]);
}
-
+
close (fd);
g_string_free (str, TRUE);
@@ -99,7 +99,7 @@
static void
-list__process_line (char *line,
+list__process_line (char *line,
gpointer data)
{
FrCommand *comm = FR_COMMAND (data);
@@ -118,10 +118,10 @@
fdata->size = get_file_size (comm->filename);
filename = get_uncompressed_name_from_archive (comm, comm->filename);
- if (filename == NULL)
+ if (filename == NULL)
filename = remove_extension_from_path (comm->filename);
- fdata->full_path = g_strconcat ("/",
+ fdata->full_path = g_strconcat ("/",
file_name_from_path (filename),
NULL);
g_free (filename);
@@ -129,27 +129,26 @@
fdata->original_path = fdata->full_path + 1;
fdata->link = NULL;
fdata->modified = get_file_mtime_for_path (comm->filename);
-
+
fdata->name = g_strdup (file_name_from_path (fdata->full_path));
fdata->path = remove_level_from_path (fdata->full_path);
-
+
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
}
static void
-fr_command_cfile_list (FrCommand *comm,
- const char *password)
+fr_command_cfile_list (FrCommand *comm)
{
FrCommandCFile *comm_cfile = FR_COMMAND_CFILE (comm);
if (is_mime_type (comm->mime_type, "application/x-gzip")) {
/* gzip let us known the uncompressed size */
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
list__process_line,
comm);
@@ -159,10 +158,10 @@
fr_process_add_arg (comm->process, comm->filename);
fr_process_end_command (comm->process);
fr_process_start (comm->process);
- }
+ }
else {
- /* ... other compressors do not support this feature so
- * simply use the archive size, suboptimal but there is no
+ /* ... other compressors do not support this feature so
+ * simply use the archive size, suboptimal but there is no
* alternative. */
FileData *fdata;
@@ -171,7 +170,7 @@
fdata = file_data_new ();
filename = remove_extension_from_path (comm->filename);
- fdata->full_path = g_strconcat ("/",
+ fdata->full_path = g_strconcat ("/",
file_name_from_path (filename),
NULL);
g_free (filename);
@@ -180,20 +179,20 @@
fdata->link = NULL;
fdata->size = get_file_size_for_path (comm->filename);
fdata->modified = get_file_mtime_for_path (comm->filename);
-
+
fdata->name = g_strdup (file_name_from_path (fdata->full_path));
fdata->path = remove_level_from_path (fdata->full_path);
-
+
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
-
+
comm_cfile->error.type = FR_PROC_ERROR_NONE;
comm_cfile->error.status = 0;
- g_signal_emit_by_name (G_OBJECT (comm),
+ g_signal_emit_by_name (G_OBJECT (comm),
"done",
- comm->action,
+ comm->action,
&comm_cfile->error);
}
}
@@ -204,9 +203,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
const char *filename;
char *temp_dir;
@@ -281,7 +278,7 @@
fr_process_end_command (comm->process);
compressed_filename = g_strconcat (filename, ".rz", NULL);
}
-
+
/* copy compressed file to the dest dir */
fr_process_begin_command (comm->process, "cp");
@@ -321,8 +318,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
char *temp_dir;
char *dest_file;
@@ -390,13 +386,13 @@
fr_process_add_arg (comm->process, temp_file);
fr_process_end_command (comm->process);
}
-
+
/* copy uncompress file to the dest dir */
uncompr_file = remove_extension_from_path (temp_file);
-
+
compr_file = get_uncompressed_name_from_archive (comm, comm->filename);
- if (compr_file == NULL)
+ if (compr_file == NULL)
compr_file = remove_extension_from_path (file_name_from_path (comm->filename));
dest_file = g_strconcat (dest_dir,
"/",
@@ -425,8 +421,8 @@
}
-const char *cfile_mime_type[] = { "application/x-gzip",
- "application/x-bzip",
+const char *cfile_mime_type[] = { "application/x-gzip",
+ "application/x-bzip",
"application/x-compress",
"application/x-lzma",
"application/x-lzop",
@@ -434,19 +430,19 @@
NULL };
-const char **
+const char **
fr_command_cfile_get_mime_types (FrCommand *comm)
{
return cfile_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_cfile_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_DO_NOTHING;
if (is_mime_type (mime_type, "application/x-gzip")) {
if (is_program_in_path ("gzip"))
@@ -474,12 +470,12 @@
if (is_program_in_path ("rzip"))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
}
-
+
return capabilities;
}
-static void
+static void
fr_command_cfile_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
@@ -491,7 +487,7 @@
}
-static void
+static void
fr_command_cfile_class_init (FrCommandCFileClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -510,12 +506,12 @@
afc->get_capabilities = fr_command_cfile_get_capabilities;
}
-
-static void
+
+static void
fr_command_cfile_init (FrCommand *comm)
{
comm->propAddCanUpdate = TRUE;
- comm->propAddCanReplace = TRUE;
+ comm->propAddCanReplace = TRUE;
comm->propExtractCanAvoidOverwrite = FALSE;
comm->propExtractCanSkipOlder = FALSE;
comm->propExtractCanJunkPaths = FALSE;
Modified: trunk/src/fr-command-cpio.c
==============================================================================
--- trunk/src/fr-command-cpio.c (original)
+++ trunk/src/fr-command-cpio.c Sun Jul 20 17:20:25 2008
@@ -45,11 +45,11 @@
/* -- list -- */
static time_t
-mktime_from_string (char *month,
+mktime_from_string (char *month,
char *mday,
char *year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct tm tm = {0, };
@@ -72,7 +72,7 @@
tm.tm_hour = atoi (fields[0]);
tm.tm_min = atoi (fields[1]);
-
+
now = time(NULL);
now_tm = localtime (&now);
tm.tm_year = now_tm->tm_year;
@@ -85,7 +85,7 @@
static void
-list__process_line (char *line,
+list__process_line (char *line,
gpointer data)
{
FileData *fdata;
@@ -129,9 +129,9 @@
}
fdata->dir = line[0] == 'd';
-
+
if (*(fields[0]) == '/') {
- char *name = fields[0];
+ char *name = fields[0];
if (fdata->dir && (name[strlen (name) - 1] != '/')) {
fdata->full_path = g_strconcat (name, "/", NULL);
fdata->original_path = g_strdup (fields[0]);
@@ -141,9 +141,9 @@
fdata->full_path = g_strdup (fields[0]);
fdata->original_path = fdata->full_path;
}
- }
+ }
else {
- char *name = fields[0];
+ char *name = fields[0];
if (fdata->dir && (name[strlen (name) - 1] != '/')) {
fdata->full_path = g_strconcat ("/", name, "/", NULL);
fdata->original_path = g_strdup (fields[0]);
@@ -167,29 +167,28 @@
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
}
static void
-fr_command_cpio_list (FrCommand *comm,
- const char *password)
+fr_command_cpio_list (FrCommand *comm)
{
GString *cmd;
-
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
list__process_line,
comm);
fr_process_begin_command (comm->process, "sh");
fr_process_add_arg (comm->process, "-c");
-
+
cmd = g_string_new ("cpio -itv < ");
g_string_append (cmd, comm->e_filename);
fr_process_add_arg (comm->process, cmd->str);
g_string_free (cmd, TRUE);
-
+
fr_process_end_command (comm->process);
fr_process_start (comm->process);
}
@@ -201,8 +200,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
GString *cmd;
@@ -211,10 +209,10 @@
fr_process_add_arg (comm->process, "-c");
if (dest_dir != NULL)
fr_process_set_working_dir (comm->process, dest_dir);
-
+
cmd = g_string_new ("cpio -idu ");
for (scan = file_list; scan; scan = scan->next) {
- char *filename = g_shell_quote (scan->data);
+ char *filename = g_shell_quote (scan->data);
g_string_append (cmd, filename);
g_free (filename);
g_string_append (cmd, " ");
@@ -223,7 +221,7 @@
g_string_append (cmd, comm->e_filename);
fr_process_add_arg (comm->process, cmd->str);
g_string_free (cmd, TRUE);
-
+
fr_process_end_command (comm->process);
fr_process_start (comm->process);
}
@@ -232,28 +230,28 @@
const char *cpio_mime_type[] = { "application/x-cpio", NULL };
-const char **
+const char **
fr_command_cpio_get_mime_types (FrCommand *comm)
{
return cpio_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_cpio_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("cpio"))
+ if (is_program_in_path ("cpio"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
-static void
+static void
fr_command_cpio_class_init (FrCommandCpioClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -270,8 +268,8 @@
afc->get_capabilities = fr_command_cpio_get_capabilities;
}
-
-static void
+
+static void
fr_command_cpio_init (FrCommand *comm)
{
comm->propAddCanUpdate = FALSE;
@@ -285,7 +283,7 @@
}
-static void
+static void
fr_command_cpio_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
Modified: trunk/src/fr-command-iso.c
==============================================================================
--- trunk/src/fr-command-iso.c (original)
+++ trunk/src/fr-command-iso.c Sun Jul 20 17:20:25 2008
@@ -128,8 +128,7 @@
static void
-fr_command_iso_list (FrCommand *comm,
- const char *password)
+fr_command_iso_list (FrCommand *comm)
{
FrCommandIso *comm_iso = FR_COMMAND_ISO (comm);
@@ -157,8 +156,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -201,23 +199,23 @@
const char *iso_mime_type[] = { "application/x-cd-image", NULL };
-const char **
+const char **
fr_command_iso_get_mime_types (FrCommand *comm)
{
return iso_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_iso_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("isoinfo"))
+ if (is_program_in_path ("isoinfo"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
Modified: trunk/src/fr-command-jar.c
==============================================================================
--- trunk/src/fr-command-jar.c (original)
+++ trunk/src/fr-command-jar.c Sun Jul 20 17:20:25 2008
@@ -53,9 +53,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
FrProcess *proc = comm->process;
GList *zip_list = NULL, *jardata_list = NULL, *jar_list = NULL;
@@ -119,10 +117,10 @@
}
if (zip_list != NULL)
- parent_class->add (comm, zip_list, base_dir, update, FALSE, password, compression);
+ parent_class->add (comm, zip_list, base_dir, update, FALSE);
if (jar_list != NULL)
- parent_class->add (comm, jar_list, tmp_dir, update, FALSE, password, compression);
+ parent_class->add (comm, jar_list, tmp_dir, update, FALSE);
fr_process_begin_command (proc, "rm");
fr_process_set_working_dir (proc, "/");
Modified: trunk/src/fr-command-lha.c
==============================================================================
--- trunk/src/fr-command-lha.c (original)
+++ trunk/src/fr-command-lha.c Sun Jul 20 17:20:25 2008
@@ -44,11 +44,11 @@
/* -- list -- */
static time_t
-mktime_from_string (char *month,
- char *mday,
+mktime_from_string (char *month,
+ char *mday,
char *time_or_year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct tm tm = {0, };
char **fields;
@@ -82,7 +82,7 @@
fields = g_strsplit (time_or_year, ":", 2);
if (fields[0] != NULL) {
tm.tm_hour = atoi (fields[0]);
- if (fields[1] != NULL)
+ if (fields[1] != NULL)
tm.tm_min = atoi (fields[1]);
}
g_strfreev (fields);
@@ -109,12 +109,12 @@
fields[i++] = g_strdup ("");
fields[i++] = g_strdup ("");
line += strlen ("[MS-DOS]");
- }
+ }
else if (strncmp (line, "[generic]", 9) == 0) {
fields[i++] = g_strdup ("");
fields[i++] = g_strdup ("");
line += strlen ("[generic]");
- }
+ }
else if (strncmp (line, "[unknown]", 9) == 0) {
fields[i++] = g_strdup ("");
fields[i++] = g_strdup ("");
@@ -141,13 +141,13 @@
const char *field;
int n = 7;
- if (strncmp (line, "[MS-DOS]", 8) == 0)
+ if (strncmp (line, "[MS-DOS]", 8) == 0)
n--;
- if (strncmp (line, "[generic]", 9) == 0)
+ if (strncmp (line, "[generic]", 9) == 0)
n--;
- if (strncmp (line, "[unknown]", 9) == 0)
+ if (strncmp (line, "[unknown]", 9) == 0)
n--;
field = eat_spaces (line);
@@ -161,7 +161,7 @@
static void
-process_line (char *line,
+process_line (char *line,
gpointer data)
{
FileData *fdata;
@@ -175,8 +175,8 @@
fields = split_line_lha (line);
fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
- fdata->modified = mktime_from_string (fields[4],
- fields[5],
+ fdata->modified = mktime_from_string (fields[4],
+ fields[5],
fields[6]);
g_strfreev (fields);
@@ -210,10 +210,9 @@
static void
-fr_command_lha_list (FrCommand *comm,
- const char *password)
+fr_command_lha_list (FrCommand *comm)
{
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
comm);
@@ -230,21 +229,19 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
fr_process_begin_command (comm->process, "lha");
- if (base_dir != NULL)
+ if (base_dir != NULL)
fr_process_set_working_dir (comm->process, base_dir);
if (update)
fr_process_add_arg (comm->process, "u");
else
fr_process_add_arg (comm->process, "a");
fr_process_add_arg (comm->process, comm->filename);
- for (scan = file_list; scan; scan = scan->next)
+ for (scan = file_list; scan; scan = scan->next)
fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
@@ -271,28 +268,27 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
char options[5];
int i = 0;
fr_process_begin_command (comm->process, "lha");
-
- if (dest_dir != NULL)
+
+ if (dest_dir != NULL)
fr_process_set_working_dir (comm->process, dest_dir);
options[i++] = 'x';
options[i++] = 'f'; /* Always overwrite.
- * The overwrite option is handled in
+ * The overwrite option is handled in
* fr_archive_extract,
* this is because lha asks the user whether he
* wants to overwrite a file. */
if (junk_paths)
options[i++] = 'i';
-
+
options[i++] = 0;
fr_process_add_arg (comm->process, options);
fr_process_add_arg (comm->process, comm->filename);
@@ -307,28 +303,28 @@
const char *lha_mime_type[] = { "application/x-lha", NULL };
-const char **
+const char **
fr_command_lha_get_mime_types (FrCommand *comm)
{
return lha_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_lha_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("lha"))
+ if (is_program_in_path ("lha"))
capabilities |= FR_COMMAND_CAN_READ_WRITE;
-
+
return capabilities;
}
-static void
+static void
fr_command_lha_class_init (FrCommandLhaClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -347,12 +343,12 @@
afc->get_capabilities = fr_command_lha_get_capabilities;
}
-
-static void
+
+static void
fr_command_lha_init (FrCommand *comm)
{
- comm->propAddCanUpdate = TRUE;
- comm->propAddCanReplace = TRUE;
+ comm->propAddCanUpdate = TRUE;
+ comm->propAddCanReplace = TRUE;
comm->propAddCanStoreFolders = TRUE;
comm->propExtractCanAvoidOverwrite = FALSE;
comm->propExtractCanSkipOlder = FALSE;
@@ -362,7 +358,7 @@
}
-static void
+static void
fr_command_lha_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
Modified: trunk/src/fr-command-rar.c
==============================================================================
--- trunk/src/fr-command-rar.c (original)
+++ trunk/src/fr-command-rar.c Sun Jul 20 17:20:25 2008
@@ -106,6 +106,8 @@
rar_comm->list_started = TRUE;
rar_comm->odd_line = TRUE;
}
+ else if (strncmp (line, "Volume ", 7) == 0)
+ rar_comm->multi_volume = TRUE;
return;
}
@@ -146,28 +148,38 @@
fields = split_line (line, 6);
- fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
- fdata->modified = mktime_from_string (fields[3], fields[4]);
+ if ((strcmp (fields[2], "<->") == 0)
+ || (strcmp (fields[2], "<--") == 0))
+ {
+ /* ignore files that span more volumes */
- if ((fields[5][1] == 'D') || (fields[5][0] == 'd')) {
- char *tmp;
+ file_data_free (rar_comm->fdata);
+ rar_comm->fdata = NULL;
+ }
+ else {
+ fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
+ fdata->modified = mktime_from_string (fields[3], fields[4]);
- tmp = fdata->full_path;
- fdata->full_path = g_strconcat (fdata->full_path, "/", NULL);
+ if ((fields[5][1] == 'D') || (fields[5][0] == 'd')) {
+ char *tmp;
- fdata->original_path = g_strdup (fdata->original_path);
- fdata->free_original_path = TRUE;
+ tmp = fdata->full_path;
+ fdata->full_path = g_strconcat (fdata->full_path, "/", NULL);
- g_free (tmp);
+ fdata->original_path = g_strdup (fdata->original_path);
+ fdata->free_original_path = TRUE;
- fdata->name = dir_name_from_path (fdata->full_path);
- fdata->dir = TRUE;
- }
- else
- fdata->name = g_strdup (file_name_from_path (fdata->full_path));
+ g_free (tmp);
- fr_command_add_file (comm, fdata);
- rar_comm->fdata = NULL;
+ fdata->name = dir_name_from_path (fdata->full_path);
+ fdata->dir = TRUE;
+ }
+ else
+ fdata->name = g_strdup (file_name_from_path (fdata->full_path));
+
+ fr_command_add_file (comm, fdata);
+ rar_comm->fdata = NULL;
+ }
g_strfreev (fields);
}
@@ -193,10 +205,10 @@
static void
-fr_command_rar_list (FrCommand *comm,
- const char *password)
+fr_command_rar_list (FrCommand *comm)
{
FR_COMMAND_RAR (comm)->list_started = FALSE;
+ FR_COMMAND_RAR (comm)->multi_volume = FALSE;
fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
@@ -210,7 +222,7 @@
fr_process_add_arg (comm->process, "-c-");
fr_process_add_arg (comm->process, "-v");
- add_password_arg (comm, password, TRUE);
+ add_password_arg (comm, comm->password, TRUE);
/* stop switches scanning */
fr_process_add_arg (comm->process, "--");
@@ -277,9 +289,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -298,7 +308,7 @@
else
fr_process_add_arg (comm->process, "a");
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-m1"); break;
case FR_COMPRESSION_FAST:
@@ -309,7 +319,7 @@
fr_process_add_arg (comm->process, "-m5"); break;
}
- add_password_arg (comm, password, FALSE);
+ add_password_arg (comm, comm->password, FALSE);
/* disable percentage indicator */
fr_process_add_arg (comm->process, "-Idp");
@@ -399,8 +409,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -427,7 +436,7 @@
if (junk_paths)
fr_process_add_arg (comm->process, "-ep");
- add_password_arg (comm, password, TRUE);
+ add_password_arg (comm, comm->password, TRUE);
/* disable percentage indicator */
fr_process_add_arg (comm->process, "-Idp");
@@ -448,8 +457,7 @@
static void
-fr_command_rar_test (FrCommand *comm,
- const char *password)
+fr_command_rar_test (FrCommand *comm)
{
if (have_rar ())
fr_process_begin_command (comm->process, "rar");
@@ -458,7 +466,7 @@
fr_process_add_arg (comm->process, "t");
- add_password_arg (comm, password, TRUE);
+ add_password_arg (comm, comm->password, TRUE);
/* disable percentage indicator */
fr_process_add_arg (comm->process, "-Idp");
@@ -533,7 +541,8 @@
fr_command_rar_get_capabilities (FrCommand *comm,
const char *mime_type)
{
- FrCommandCap capabilities;
+ FrCommandRar *comm_rar = FR_COMMAND_RAR (comm);
+ FrCommandCap capabilities;
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES | FR_COMMAND_CAN_ENCRYPT | FR_COMMAND_CAN_ENCRYPT_HEADER;
if (is_program_in_path ("rar"))
@@ -541,6 +550,10 @@
else if (is_program_in_path ("unrar"))
capabilities |= FR_COMMAND_CAN_READ;
+ /* multi-volumes are read-only */
+ if ((comm->files->len > 0) && comm_rar->multi_volume && (capabilities & FR_COMMAND_CAN_WRITE))
+ capabilities ^= FR_COMMAND_CAN_WRITE;
+
return capabilities;
}
Modified: trunk/src/fr-command-rar.h
==============================================================================
--- trunk/src/fr-command-rar.h (original)
+++ trunk/src/fr-command-rar.h Sun Jul 20 17:20:25 2008
@@ -42,9 +42,10 @@
{
FrCommand __parent;
- gboolean list_started;
- gboolean odd_line;
+ gboolean list_started;
+ gboolean odd_line;
FileData *fdata;
+ gboolean multi_volume;
};
struct _FrCommandRarClass
Modified: trunk/src/fr-command-rpm.c
==============================================================================
--- trunk/src/fr-command-rpm.c (original)
+++ trunk/src/fr-command-rpm.c Sun Jul 20 17:20:25 2008
@@ -45,11 +45,11 @@
/* -- list -- */
static time_t
-mktime_from_string (char *month,
+mktime_from_string (char *month,
char *mday,
char *year)
{
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct tm tm = {0, };
@@ -72,7 +72,7 @@
tm.tm_hour = atoi (fields[0]);
tm.tm_min = atoi (fields[1]);
-
+
now = time(NULL);
now_tm = localtime (&now);
tm.tm_year = now_tm->tm_year;
@@ -85,7 +85,7 @@
static void
-list__process_line (char *line,
+list__process_line (char *line,
gpointer data)
{
FileData *fdata;
@@ -126,14 +126,14 @@
if (*(fields[0]) == '/') {
fdata->full_path = g_strcompress (fields[0]);
fdata->original_path = fdata->full_path;
- }
+ }
else {
char *compressed;
-
+
compressed = g_strcompress (fields[0]);
fdata->full_path = g_strconcat ("/", compressed, NULL);
g_free (compressed);
-
+
fdata->original_path = fdata->full_path + 1;
}
@@ -146,16 +146,15 @@
if (*fdata->name == 0)
file_data_free (fdata);
- else
+ else
fr_command_add_file (comm, fdata);
}
static void
-fr_command_rpm_list (FrCommand *comm,
- const char *password)
+fr_command_rpm_list (FrCommand *comm)
{
- fr_process_set_out_line_func (FR_COMMAND (comm)->process,
+ fr_process_set_out_line_func (FR_COMMAND (comm)->process,
list__process_line,
comm);
@@ -173,29 +172,28 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
GString *cmd;
-
+
fr_process_begin_command (comm->process, "sh");
if (dest_dir != NULL)
fr_process_set_working_dir (comm->process, dest_dir);
fr_process_add_arg (comm->process, "-c");
-
+
cmd = g_string_new ("rpm2cpio ");
g_string_append (cmd, comm->e_filename);
g_string_append (cmd, " | cpio -idu ");
for (scan = file_list; scan; scan = scan->next) {
- char *filename = g_shell_quote (scan->data);
+ char *filename = g_shell_quote (scan->data);
g_string_append (cmd, filename);
g_free (filename);
g_string_append (cmd, " ");
}
fr_process_add_arg (comm->process, cmd->str);
g_string_free (cmd, TRUE);
-
+
fr_process_end_command (comm->process);
fr_process_start (comm->process);
}
@@ -204,28 +202,28 @@
const char *rpm_mime_type[] = { "application/x-rpm", NULL };
-const char **
+const char **
fr_command_rpm_get_mime_types (FrCommand *comm)
{
return rpm_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_rpm_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("rpm2cpio"))
+ if (is_program_in_path ("rpm2cpio"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
-static void
+static void
fr_command_rpm_class_init (FrCommandRpmClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
@@ -242,8 +240,8 @@
afc->get_capabilities = fr_command_rpm_get_capabilities;
}
-
-static void
+
+static void
fr_command_rpm_init (FrCommand *comm)
{
comm->propAddCanUpdate = FALSE;
@@ -256,7 +254,7 @@
}
-static void
+static void
fr_command_rpm_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
Modified: trunk/src/fr-command-tar.c
==============================================================================
--- trunk/src/fr-command-tar.c (original)
+++ trunk/src/fr-command-tar.c Sun Jul 20 17:20:25 2008
@@ -85,7 +85,7 @@
}
}
g_strfreev (fields);
-
+
return mktime (&tm);
}
@@ -138,7 +138,7 @@
return;
fdata = file_data_new ();
-
+
field_size = file_list__get_prev_field (line, date_idx, 1);
fdata->size = g_ascii_strtoull (field_size, NULL, 10);
g_free (field_size);
@@ -191,24 +191,24 @@
static void
add_compress_arg (FrCommand *comm)
{
- if (is_mime_type (comm->mime_type, "application/x-compressed-tar"))
+ if (is_mime_type (comm->mime_type, "application/x-compressed-tar"))
fr_process_add_arg (comm->process, "-z");
-
+
else if (is_mime_type (comm->mime_type, "application/x-bzip-compressed-tar"))
fr_process_add_arg (comm->process, "--use-compress-program=bzip2");
-
+
else if (is_mime_type (comm->mime_type, "application/x-tarz"))
fr_process_add_arg (comm->process, "-Z");
-
+
else if (is_mime_type (comm->mime_type, "application/x-lzma-compressed-tar"))
fr_process_add_arg (comm->process, "--use-compress-program=lzma");
-
+
else if (is_mime_type (comm->mime_type, "application/x-lzop-compressed-tar"))
fr_process_add_arg (comm->process, "--use-compress-program=lzop");
-
+
else if (is_mime_type (comm->mime_type, "application/x-7z-compressed-tar")) {
FrCommandTar *comm_tar = (FrCommandTar*) comm;
- char *option;
+ char *option;
option = g_strdup_printf ("--use-compress-program=%s", comm_tar->compress_command);
fr_process_add_arg (comm->process, option);
g_free (option);
@@ -237,8 +237,7 @@
static void
-fr_command_tar_list (FrCommand *comm,
- const char *password)
+fr_command_tar_list (FrCommand *comm)
{
fr_process_set_out_line_func (FR_COMMAND (comm)->process,
process_line,
@@ -293,9 +292,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
FrCommandTar *c_tar = FR_COMMAND_TAR (comm);
GList *scan;
@@ -311,7 +308,7 @@
fr_process_add_arg (comm->process, "--no-wildcards");
fr_process_add_arg (comm->process, "-v");
fr_process_add_arg (comm->process, "-p");
-
+
if (base_dir != NULL) {
fr_process_add_arg (comm->process, "-C");
fr_process_add_arg (comm->process, base_dir);
@@ -385,8 +382,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -404,7 +400,7 @@
fr_process_add_arg (comm->process, "-k");
if (skip_older)
fr_process_add_arg (comm->process, "--keep-newer-files");
-
+
fr_process_add_arg (comm->process, "-xf");
fr_process_add_arg (comm->process, comm->filename);
add_compress_arg (comm);
@@ -413,7 +409,7 @@
fr_process_add_arg (comm->process, "-C");
fr_process_add_arg (comm->process, dest_dir);
}
-
+
fr_process_add_arg (comm->process, "--");
for (scan = file_list; scan; scan = scan->next)
fr_process_add_arg (comm->process, scan->data);
@@ -432,8 +428,7 @@
static void
-fr_command_tar_recompress (FrCommand *comm,
- FrCompression compression)
+fr_command_tar_recompress (FrCommand *comm)
{
FrCommandTar *c_tar = FR_COMMAND_TAR (comm);
char *new_name = NULL;
@@ -442,7 +437,7 @@
fr_process_begin_command (comm->process, "gzip");
fr_process_set_sticky (comm->process, TRUE);
fr_process_set_begin_func (comm->process, begin_func__recompress, comm);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-1"); break;
case FR_COMPRESSION_FAST:
@@ -456,13 +451,13 @@
fr_process_add_arg (comm->process, c_tar->uncomp_filename);
fr_process_end_command (comm->process);
- new_name = g_strconcat (c_tar->uncomp_filename, ".gz", NULL);
+ new_name = g_strconcat (c_tar->uncomp_filename, ".gz", NULL);
}
else if (is_mime_type (comm->mime_type, "application/x-bzip-compressed-tar")) {
fr_process_begin_command (comm->process, "bzip2");
fr_process_set_sticky (comm->process, TRUE);
fr_process_set_begin_func (comm->process, begin_func__recompress, comm);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-1"); break;
case FR_COMPRESSION_FAST:
@@ -492,7 +487,7 @@
fr_process_begin_command (comm->process, "lzma");
fr_process_set_sticky (comm->process, TRUE);
fr_process_set_begin_func (comm->process, begin_func__recompress, comm);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-1"); break;
case FR_COMPRESSION_FAST:
@@ -512,7 +507,7 @@
fr_process_begin_command (comm->process, "lzop");
fr_process_set_sticky (comm->process, TRUE);
fr_process_set_begin_func (comm->process, begin_func__recompress, comm);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-1"); break;
case FR_COMPRESSION_FAST:
@@ -531,11 +526,11 @@
}
else if (is_mime_type (comm->mime_type, "application/x-7z-compressed-tar")) {
FrCommandTar *comm_tar = (FrCommandTar*) comm;
-
+
fr_process_begin_command (comm->process, comm_tar->compress_command);
fr_process_set_sticky (comm->process, TRUE);
fr_process_set_begin_func (comm->process, begin_func__recompress, comm);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-mx=1"); break;
case FR_COMPRESSION_FAST:
@@ -549,15 +544,15 @@
fr_process_add_arg (comm->process, "-bd");
fr_process_add_arg (comm->process, "-y");
fr_process_add_arg (comm->process, "-l");
-
+
new_name = g_strconcat (c_tar->uncomp_filename, ".7z", NULL);
fr_process_add_arg_concat (comm->process, new_name);
-
+
fr_process_add_arg (comm->process, c_tar->uncomp_filename);
fr_process_end_command (comm->process);
/* remove the uncompressed tar */
-
+
fr_process_begin_command (comm->process, "rm");
fr_process_add_arg (comm->process, "-f");
fr_process_add_arg (comm->process, c_tar->uncomp_filename);
@@ -566,7 +561,7 @@
if (c_tar->name_modified) {
char *tmp_dir;
-
+
/* Restore original name. */
fr_process_begin_command (comm->process, "mv");
@@ -575,15 +570,15 @@
fr_process_add_arg (comm->process, new_name);
fr_process_add_arg (comm->process, comm->filename);
fr_process_end_command (comm->process);
-
+
tmp_dir = remove_level_from_path (new_name);
-
+
fr_process_begin_command (comm->process, "rm");
fr_process_set_sticky (comm->process, TRUE);
fr_process_add_arg (comm->process, "-fr");
fr_process_add_arg (comm->process, tmp_dir);
fr_process_end_command (comm->process);
-
+
g_free (tmp_dir);
}
@@ -610,13 +605,13 @@
char *new_name = g_strdup (e_filename);
int l = strlen (new_name);
- if (is_mime_type (comm->mime_type, "application/x-compressed-tar")) {
+ if (is_mime_type (comm->mime_type, "application/x-compressed-tar")) {
/* X.tgz --> X.tar
* X.tar.gz --> X.tar */
if (file_extension_is (e_filename, ".tgz")) {
new_name[l - 2] = 'a';
new_name[l - 1] = 'r';
- }
+ }
else if (file_extension_is (e_filename, ".tar.gz"))
new_name[l - 3] = 0;
}
@@ -627,7 +622,7 @@
new_name[l - 3] = 'a';
new_name[l - 2] = 'r';
new_name[l - 1] = 0;
- }
+ }
else if (file_extension_is (e_filename, ".tar.bz2"))
new_name[l - 4] = 0;
}
@@ -640,7 +635,7 @@
new_name[l - 2] = 0;
}
else if (is_mime_type (comm->mime_type, "application/x-lzma-compressed-tar")) {
- /* X.tar.lzma --> X.tar
+ /* X.tar.lzma --> X.tar
* (There doesn't seem to be a shorthand suffix) */
if (file_extension_is (e_filename, ".tar.lzma"))
new_name[l - 5] = 0;
@@ -651,13 +646,13 @@
if (file_extension_is (e_filename, ".tzo")) {
new_name[l - 2] = 'a';
new_name[l - 1] = 'r';
- }
+ }
else if (file_extension_is (e_filename, ".tar.lzo"))
new_name[l - 4] = 0;
}
else if (is_mime_type (comm->mime_type, "application/x-7z-compressed-tar")) {
/* X.tar.7z --> X.tar */
- if (file_extension_is (e_filename, ".tar.7z"))
+ if (file_extension_is (e_filename, ".tar.7z"))
new_name[l - 3] = 0;
}
@@ -673,7 +668,7 @@
const char *filepath)
{
char *dirname = remove_level_from_path (filepath);
- char *template;
+ char *template;
char *result = NULL;
char *temp_name = NULL;
@@ -692,7 +687,7 @@
FrCommandTar *c_tar = FR_COMMAND_TAR (comm);
char *tmp_name;
gboolean archive_exists;
-
+
if (c_tar->uncomp_filename != NULL) {
g_free (c_tar->uncomp_filename);
c_tar->uncomp_filename = NULL;
@@ -714,12 +709,12 @@
fr_process_add_arg (comm->process, tmp_name);
fr_process_end_command (comm->process);
}
- }
+ }
else
tmp_name = g_strdup (comm->filename);
if (archive_exists) {
- if (is_mime_type (comm->mime_type, "application/x-compressed-tar")) {
+ if (is_mime_type (comm->mime_type, "application/x-compressed-tar")) {
fr_process_begin_command (comm->process, "gzip");
fr_process_set_begin_func (comm->process, begin_func__uncompress, comm);
fr_process_add_arg (comm->process, "-f");
@@ -760,7 +755,7 @@
}
else if (is_mime_type (comm->mime_type, "application/x-7z-compressed-tar")) {
FrCommandTar *comm_tar = (FrCommandTar*) comm;
-
+
fr_process_begin_command (comm->process, comm_tar->compress_command);
fr_process_set_begin_func (comm->process, begin_func__uncompress, comm);
fr_process_add_arg (comm->process, "e");
@@ -768,9 +763,9 @@
fr_process_add_arg (comm->process, "-y");
fr_process_add_arg (comm->process, tmp_name);
fr_process_end_command (comm->process);
-
+
/* remove the compressed tar */
-
+
fr_process_begin_command (comm->process, "rm");
fr_process_add_arg (comm->process, "-f");
fr_process_add_arg (comm->process, tmp_name);
@@ -794,33 +789,33 @@
}
-const char *tar_mime_types[] = { "application/x-tar",
- "application/x-compressed-tar",
- "application/x-bzip-compressed-tar",
- "application/x-tarz",
+const char *tar_mime_types[] = { "application/x-tar",
+ "application/x-compressed-tar",
+ "application/x-bzip-compressed-tar",
+ "application/x-tarz",
"application/x-lzma-compressed-tar",
"application/x-lzop-compressed-tar",
"application/x-7z-compressed-tar",
NULL };
-
-const char **
+
+const char **
fr_command_tar_get_mime_types (FrCommand *comm)
{
return tar_mime_types;
}
-FrCommandCap
+FrCommandCap
fr_command_tar_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
-
+
/* In solaris gtar is present under /usr/sfw/bin */
- if (! is_program_in_path ("tar") && ! is_program_in_path ("/usr/sfw/bin/gtar"))
+ if (! is_program_in_path ("tar") && ! is_program_in_path ("/usr/sfw/bin/gtar"))
return capabilities;
if (is_mime_type (mime_type, "application/x-tar")) {
@@ -851,7 +846,7 @@
else if (is_mime_type (mime_type, "application/x-7z-compressed-tar")) {
char *try_command[3] = { "7za", "7zr", "7z" };
int i;
-
+
for (i = 0; i < G_N_ELEMENTS (try_command); i++) {
if (is_program_in_path (try_command[i])) {
capabilities |= FR_COMMAND_CAN_READ_WRITE;
@@ -859,7 +854,7 @@
}
}
}
-
+
return capabilities;
}
@@ -869,13 +864,13 @@
const char *mime_type)
{
FrCommandTar *comm_tar = FR_COMMAND_TAR (comm);
-
+
FR_COMMAND_CLASS (parent_class)->set_mime_type (comm, mime_type);
if (is_mime_type (mime_type, "application/x-7z-compressed-tar")) {
char *try_command[3] = { "7za", "7zr", "7z" };
int i;
-
+
for (i = 0; i < G_N_ELEMENTS (try_command); i++) {
if (is_program_in_path (try_command[i])) {
comm_tar->compress_command = g_strdup (try_command[i]);
@@ -927,7 +922,7 @@
comm->propCanExtractNonEmptyFolders = FALSE;
comm_tar->msg = NULL;
- comm_tar->uncomp_filename = NULL;
+ comm_tar->uncomp_filename = NULL;
}
@@ -950,7 +945,7 @@
g_free (comm_tar->msg);
comm_tar->msg = NULL;
}
-
+
if (comm_tar->compress_command != NULL) {
g_free (comm_tar->compress_command);
comm_tar->compress_command = NULL;
Modified: trunk/src/fr-command-unstuff.c
==============================================================================
--- trunk/src/fr-command-unstuff.c (original)
+++ trunk/src/fr-command-unstuff.c Sun Jul 20 17:20:25 2008
@@ -127,7 +127,7 @@
else
size = g_ascii_strtoull (ssize, NULL, 10);
- if (unstuff_comm->fdata != NULL)
+ if (unstuff_comm->fdata != NULL)
unstuff_comm->fdata->size = size;
return;
@@ -180,8 +180,7 @@
static void
-fr_command_unstuff_list (FrCommand *comm,
- const char *password)
+fr_command_unstuff_list (FrCommand *comm)
{
char *arg, *path;
char *filename;
@@ -218,8 +217,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
#if 0
GList *scan;
@@ -231,7 +229,7 @@
if (dest_dir != NULL) {
char *dest_dir_dots;
char *arg;
-
+
dest_dir_dots = unstuff_is_shit_with_filenames (dest_dir);
arg = g_strdup_printf ("-d=%s", dest_dir_dots);
fr_process_add_arg (comm->process, arg);
@@ -259,7 +257,7 @@
static void
fr_command_unstuff_handle_error (FrCommand *comm,
- FrProcError *error)
+ FrProcError *error)
{
if ((error->type == FR_PROC_ERROR_COMMAND_ERROR)
&& (error->status <= 1))
@@ -270,23 +268,23 @@
const char *unstuff_mime_type[] = { "application/x-stuffit", NULL };
-const char **
+const char **
fr_command_unstuff_get_mime_types (FrCommand *comm)
{
return unstuff_mime_type;
}
-FrCommandCap
+FrCommandCap
fr_command_unstuff_get_capabilities (FrCommand *comm,
const char *mime_type)
{
FrCommandCap capabilities;
-
+
capabilities = FR_COMMAND_CAN_ARCHIVE_MANY_FILES;
- if (is_program_in_path ("unstuff"))
+ if (is_program_in_path ("unstuff"))
capabilities |= FR_COMMAND_CAN_READ;
-
+
return capabilities;
}
Modified: trunk/src/fr-command-zip.c
==============================================================================
--- trunk/src/fr-command-zip.c (original)
+++ trunk/src/fr-command-zip.c Sun Jul 20 17:20:25 2008
@@ -173,8 +173,7 @@
static void
-fr_command_zip_list (FrCommand *comm,
- const char *password)
+fr_command_zip_list (FrCommand *comm)
{
FR_COMMAND_ZIP (comm)->is_empty = FALSE;
@@ -213,9 +212,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -234,9 +231,9 @@
if (update)
fr_process_add_arg (comm->process, "-u");
- add_password_arg (comm, password);
+ add_password_arg (comm, comm->password);
- switch (compression) {
+ switch (comm->compression) {
case FR_COMPRESSION_VERY_FAST:
fr_process_add_arg (comm->process, "-1"); break;
case FR_COMPRESSION_FAST:
@@ -283,8 +280,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -306,7 +302,7 @@
fr_process_add_arg (comm->process, "-u");
if (junk_paths)
fr_process_add_arg (comm->process, "-j");
- add_password_arg (comm, password);
+ add_password_arg (comm, comm->password);
fr_process_add_arg (comm->process, comm->filename);
for (scan = file_list; scan; scan = scan->next)
@@ -317,12 +313,11 @@
static void
-fr_command_zip_test (FrCommand *comm,
- const char *password)
+fr_command_zip_test (FrCommand *comm)
{
fr_process_begin_command (comm->process, "unzip");
fr_process_add_arg (comm->process, "-t");
- add_password_arg (comm, password);
+ add_password_arg (comm, comm->password);
fr_process_add_arg (comm->process, comm->filename);
fr_process_end_command (comm->process);
}
Modified: trunk/src/fr-command-zoo.c
==============================================================================
--- trunk/src/fr-command-zoo.c (original)
+++ trunk/src/fr-command-zoo.c Sun Jul 20 17:20:25 2008
@@ -220,8 +220,7 @@
static void
-fr_command_zoo_list (FrCommand *zoo_comm,
- const char *password)
+fr_command_zoo_list (FrCommand *zoo_comm)
{
fr_process_set_out_line_func (FR_COMMAND (zoo_comm)->process,
process_zoo_line,
@@ -240,9 +239,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
GList *scan;
@@ -289,8 +286,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
GList *scan;
@@ -314,8 +310,7 @@
static void
-fr_command_zoo_test (FrCommand *comm,
- const char *password)
+fr_command_zoo_test (FrCommand *comm)
{
fr_process_begin_command (comm->process, "zoo");
fr_process_add_arg (comm->process, "-test");
Modified: trunk/src/fr-command.c
==============================================================================
--- trunk/src/fr-command.c (original)
+++ trunk/src/fr-command.c Sun Jul 20 17:20:25 2008
@@ -26,13 +26,15 @@
#include <glib.h>
#include "file-data.h"
#include "file-utils.h"
-#include "glib-utils.h"
-#include "fr-process.h"
#include "fr-command.h"
+#include "fr-enum-types.h"
#include "fr-marshal.h"
+#include "fr-process.h"
+#include "glib-utils.h"
#define INITIAL_SIZE 256
+
/* Signals */
enum {
START,
@@ -48,7 +50,11 @@
PROP_0,
PROP_FILENAME,
PROP_MIME_TYPE,
- PROP_PROCESS
+ PROP_PROCESS,
+ PROP_PASSWORD,
+ PROP_ENCRYPT_HEADER,
+ PROP_COMPRESSION,
+ PROP_VOLUME_SIZE
};
static GObjectClass *parent_class = NULL;
@@ -101,8 +107,7 @@
static void
-base_fr_command_list (FrCommand *comm,
- const char *password)
+base_fr_command_list (FrCommand *comm)
{
}
@@ -112,9 +117,7 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression)
+ gboolean recursive)
{
}
@@ -132,15 +135,13 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
}
static void
-base_fr_command_test (FrCommand *comm,
- const char *password)
+base_fr_command_test (FrCommand *comm)
{
}
@@ -152,14 +153,13 @@
static void
-base_fr_command_recompress (FrCommand *comm,
- FrCompression compression)
+base_fr_command_recompress (FrCommand *comm)
{
}
static void
-base_fr_command_handle_error (FrCommand *comm,
+base_fr_command_handle_error (FrCommand *comm,
FrProcError *error)
{
}
@@ -188,7 +188,7 @@
const char *mime_type)
{
comm->mime_type = get_static_string (mime_type);
- comm->capabilities = fr_command_get_capabilities (comm, comm->mime_type);
+ fr_command_update_capabilities (comm);
}
@@ -227,8 +227,8 @@
static void
-fr_command_set_process (FrCommand *comm,
- FrProcess *process)
+fr_command_set_process (FrCommand *comm,
+ FrProcess *process)
{
if (comm->process != NULL) {
g_signal_handlers_disconnect_matched (G_OBJECT (comm->process),
@@ -263,23 +263,36 @@
const GValue *value,
GParamSpec *pspec)
{
- FrCommand *comm;
+ FrCommand *comm;
- comm = FR_COMMAND (object);
+ comm = FR_COMMAND (object);
- switch (prop_id) {
- case PROP_PROCESS:
- fr_command_set_process (comm, g_value_get_object (value));
- break;
- case PROP_FILENAME:
- fr_command_set_filename (comm, g_value_get_string (value));
- break;
- case PROP_MIME_TYPE:
- fr_command_set_mime_type (comm, g_value_get_string (value));
- break;
- default:
- break;
- }
+ switch (prop_id) {
+ case PROP_PROCESS:
+ fr_command_set_process (comm, g_value_get_object (value));
+ break;
+ case PROP_FILENAME:
+ fr_command_set_filename (comm, g_value_get_string (value));
+ break;
+ case PROP_MIME_TYPE:
+ fr_command_set_mime_type (comm, g_value_get_string (value));
+ break;
+ case PROP_PASSWORD:
+ g_free (comm->password);
+ comm->password = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ENCRYPT_HEADER:
+ comm->encrypt_header = g_value_get_boolean (value);
+ break;
+ case PROP_COMPRESSION:
+ comm->compression = g_value_get_enum (value);
+ break;
+ case PROP_VOLUME_SIZE:
+ comm->volume_size = g_value_get_uint (value);
+ break;
+ default:
+ break;
+ }
}
@@ -289,24 +302,36 @@
GValue *value,
GParamSpec *pspec)
{
- FrCommand *comm;
+ FrCommand *comm;
- comm = FR_COMMAND (object);
+ comm = FR_COMMAND (object);
- switch (prop_id) {
- case PROP_PROCESS:
- g_value_set_object (value, comm->process);
- break;
- case PROP_FILENAME:
- g_value_set_string (value, comm->filename);
- break;
- case PROP_MIME_TYPE:
- g_value_set_static_string (value, comm->mime_type);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ switch (prop_id) {
+ case PROP_PROCESS:
+ g_value_set_object (value, comm->process);
+ break;
+ case PROP_FILENAME:
+ g_value_set_string (value, comm->filename);
+ break;
+ case PROP_MIME_TYPE:
+ g_value_set_static_string (value, comm->mime_type);
+ break;
+ case PROP_PASSWORD:
+ g_value_set_string (value, comm->password);
+ break;
+ case PROP_ENCRYPT_HEADER:
+ g_value_set_boolean (value, comm->encrypt_header);
+ break;
+ case PROP_COMPRESSION:
+ g_value_set_enum (value, comm->compression);
+ break;
+ case PROP_VOLUME_SIZE:
+ g_value_set_uint (value, comm->volume_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
@@ -323,7 +348,7 @@
gobject_class->finalize = fr_command_finalize;
gobject_class->set_property = fr_command_set_property;
- gobject_class->get_property = fr_command_get_property;
+ gobject_class->get_property = fr_command_get_property;
class->list = base_fr_command_list;
class->add = base_fr_command_add;
@@ -395,7 +420,7 @@
g_object_class_install_property (gobject_class,
PROP_PROCESS,
g_param_spec_object ("process",
- "Processs",
+ "Process",
"The process object used by the command",
FR_TYPE_PROCESS,
G_PARAM_READWRITE));
@@ -413,6 +438,37 @@
"The file mime-type",
NULL,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_PASSWORD,
+ g_param_spec_string ("password",
+ "Password",
+ "The archive password",
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_ENCRYPT_HEADER,
+ g_param_spec_boolean ("encrypt-header",
+ "Encrypt header",
+ "Whether to encrypt the archive header when creating the archive",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_COMPRESSION,
+ g_param_spec_enum ("compression",
+ "Compression type",
+ "The compression type to use when creating the archive",
+ FR_TYPE_COMPRESSION,
+ FR_COMPRESSION_NORMAL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_VOLUME_SIZE,
+ g_param_spec_uint ("volume-size",
+ "Volume size",
+ "The size of each volume or 0 to not use volumes",
+ 0L,
+ G_MAXUINT,
+ 0,
+ G_PARAM_READWRITE));
}
@@ -421,6 +477,10 @@
{
comm->files = g_ptr_array_sized_new (INITIAL_SIZE);
+ comm->password = NULL;
+ comm->encrypt_header = FALSE;
+ comm->compression = FR_COMPRESSION_NORMAL;
+ comm->volume_size = 0;
comm->filename = NULL;
comm->e_filename = NULL;
comm->fake_load = FALSE;
@@ -449,10 +509,9 @@
comm = FR_COMMAND (object);
- if (comm->filename != NULL)
- g_free (comm->filename);
- if (comm->e_filename != NULL)
- g_free (comm->e_filename);
+ g_free (comm->filename);
+ g_free (comm->e_filename);
+ g_free (comm->password);
if (comm->files != NULL)
g_ptr_array_free_full (comm->files, (GFunc) file_data_free, NULL);
fr_command_set_process (comm, NULL);
@@ -504,8 +563,7 @@
void
-fr_command_list (FrCommand *comm,
- const char *password)
+fr_command_list (FrCommand *comm)
{
g_return_if_fail (FR_IS_COMMAND (comm));
@@ -522,7 +580,7 @@
fr_process_use_standard_locale (FR_COMMAND (comm)->process, TRUE);
if (!comm->fake_load)
- FR_COMMAND_GET_CLASS (G_OBJECT (comm))->list (comm, password);
+ FR_COMMAND_GET_CLASS (G_OBJECT (comm))->list (comm);
}
@@ -531,14 +589,10 @@
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression)
+ gboolean recursive)
{
fr_command_progress (comm, -1.0);
- comm->encrypt_header = encrypt_header;
comm->action = FR_ACTION_ADDING_FILES;
fr_process_set_out_line_func (FR_COMMAND (comm)->process, NULL, NULL);
fr_process_set_err_line_func (FR_COMMAND (comm)->process, NULL, NULL);
@@ -547,15 +601,13 @@
file_list,
base_dir,
update,
- recursive,
- password,
- compression);
+ recursive);
}
void
fr_command_delete (FrCommand *comm,
- GList *file_list)
+ GList *file_list)
{
fr_command_progress (comm, -1.0);
@@ -573,8 +625,7 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
fr_command_progress (comm, -1.0);
@@ -587,14 +638,12 @@
dest_dir,
overwrite,
skip_older,
- junk_paths,
- password);
+ junk_paths);
}
void
-fr_command_test (FrCommand *comm,
- const char *password)
+fr_command_test (FrCommand *comm)
{
fr_command_progress (comm, -1.0);
@@ -602,7 +651,7 @@
fr_process_set_out_line_func (FR_COMMAND (comm)->process, NULL, NULL);
fr_process_set_err_line_func (FR_COMMAND (comm)->process, NULL, NULL);
- FR_COMMAND_GET_CLASS (G_OBJECT (comm))->test (comm, password);
+ FR_COMMAND_GET_CLASS (G_OBJECT (comm))->test (comm);
}
@@ -615,11 +664,10 @@
void
-fr_command_recompress (FrCommand *comm,
- FrCompression compression)
+fr_command_recompress (FrCommand *comm)
{
fr_command_progress (comm, -1.0);
- FR_COMMAND_GET_CLASS (G_OBJECT (comm))->recompress (comm, compression);
+ FR_COMMAND_GET_CLASS (G_OBJECT (comm))->recompress (comm);
}
@@ -630,6 +678,13 @@
}
+void
+fr_command_update_capabilities (FrCommand *comm)
+{
+ comm->capabilities = fr_command_get_capabilities (comm, comm->mime_type);
+}
+
+
FrCommandCap
fr_command_get_capabilities (FrCommand *comm,
const char *mime_type)
@@ -714,7 +769,7 @@
void
-fr_command_handle_error (FrCommand *comm,
+fr_command_handle_error (FrCommand *comm,
FrProcError *error)
{
FR_COMMAND_GET_CLASS (G_OBJECT (comm))->handle_error (comm, error);
Modified: trunk/src/fr-command.h
==============================================================================
--- trunk/src/fr-command.h (original)
+++ trunk/src/fr-command.h Sun Jul 20 17:20:25 2008
@@ -34,8 +34,8 @@
#define FR_IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FR_TYPE_COMMAND))
#define FR_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FR_TYPE_COMMAND, FrCommandClass))
-typedef struct _FrCommand FrCommand;
-typedef struct _FrCommandClass FrCommandClass;
+typedef struct _FrCommand FrCommand;
+typedef struct _FrCommandClass FrCommandClass;
typedef enum {
FR_ACTION_NONE,
@@ -65,46 +65,50 @@
{
GObject __parent;
- GPtrArray *files; /* Array of FileData* */
- int n_regular_files;
+ /*<public, read only>*/
- /*<protected>*/
-
- /* properties the command supports. */
-
- guint propAddCanUpdate : 1;
- guint propAddCanReplace : 1;
- guint propAddCanStoreFolders : 1;
- guint propExtractCanAvoidOverwrite : 1;
- guint propExtractCanSkipOlder : 1;
- guint propExtractCanJunkPaths : 1;
- guint propPassword : 1;
- guint propTest : 1;
- guint propCanExtractAll : 1;
- guint propCanDeleteNonEmptyFolders : 1;
- guint propCanExtractNonEmptyFolders : 1;
-
- /* progress data */
-
- int n_file;
- int n_files;
+ GPtrArray *files; /* Array of FileData* */
+ int n_regular_files;
+ FrProcess *process; /* the process object used to execute
+ * commands. */
+ char *filename; /* archive file path. */
+ char *e_filename; /* escaped archive filename. */
+ const char *mime_type;
/*<protected>*/
- gboolean encrypt_header;
+ /* options */
+
+ char *password;
+ gboolean encrypt_header;
+ FrCompression compression;
+ guint volume_size;
+
+ /* features. */
+
+ guint propAddCanUpdate : 1;
+ guint propAddCanReplace : 1;
+ guint propAddCanStoreFolders : 1;
+ guint propExtractCanAvoidOverwrite : 1;
+ guint propExtractCanSkipOlder : 1;
+ guint propExtractCanJunkPaths : 1;
+ guint propPassword : 1;
+ guint propTest : 1;
+ guint propCanExtractAll : 1;
+ guint propCanDeleteNonEmptyFolders : 1;
+ guint propCanExtractNonEmptyFolders : 1;
/*<private>*/
- FrProcess *process; /* the process object used to execute
- * commands. */
- FrAction action; /* current action. */
- char *filename; /* archive file path. */
- char *e_filename; /* escaped archive filename. */
- const char *mime_type;
- FrCommandCaps capabilities;
+ FrCommandCaps capabilities;
+ FrAction action; /* current action. */
+ gboolean fake_load; /* if TRUE does nothing when the list
+ * operation is invoked. */
+
+ /* progress data */
- gboolean fake_load; /* if TRUE does nothing when the list
- * operation is invoked. */
+ int n_file;
+ int n_files;
};
struct _FrCommandClass
@@ -113,15 +117,12 @@
/*<virtual functions>*/
- void (*list) (FrCommand *comm,
- const char *password);
+ void (*list) (FrCommand *comm);
void (*add) (FrCommand *comm,
GList *file_list,
const char *base_dir,
gboolean update,
- gboolean recursive,
- const char *password,
- FrCompression compression);
+ gboolean recursive);
void (*delete) (FrCommand *comm,
GList *file_list);
void (*extract) (FrCommand *comm,
@@ -129,13 +130,10 @@
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
- gboolean junk_paths,
- const char *password);
- void (*test) (FrCommand *comm,
- const char *password);
+ gboolean junk_paths);
+ void (*test) (FrCommand *comm);
void (*uncompress) (FrCommand *comm);
- void (*recompress) (FrCommand *comm,
- FrCompression compression);
+ void (*recompress) (FrCommand *comm);
void (*handle_error) (FrCommand *comm,
FrProcError *error);
const char ** (*get_mime_types) (FrCommand *comm);
@@ -159,59 +157,53 @@
const char *filename);
};
-GType fr_command_get_type (void);
-void fr_command_set_filename (FrCommand *comm,
- const char *filename);
-void fr_command_list (FrCommand *comm,
- const char *password);
-void fr_command_add (FrCommand *comm,
- GList *file_list,
- const char *base_dir,
- gboolean update,
- gboolean recursive,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
-void fr_command_delete (FrCommand *comm,
- GList *file_list);
-void fr_command_extract (FrCommand *comm,
- GList *file_list,
- const char *dest_dir,
- gboolean overwrite,
- gboolean skip_older,
- gboolean junk_paths,
- const char *password);
-void fr_command_test (FrCommand *comm,
- const char *password);
-void fr_command_uncompress (FrCommand *comm);
-void fr_command_recompress (FrCommand *comm,
- FrCompression compression);
-gboolean fr_command_is_capable_of (FrCommand *comm,
- FrCommandCaps capabilities);
-const char ** fr_command_get_mime_types (FrCommand *comm);
-FrCommandCap fr_command_get_capabilities (FrCommand *comm,
- const char *mime_type);
-void fr_command_set_mime_type (FrCommand *comm,
- const char *mime_type);
-gboolean fr_command_is_capable_of (FrCommand *comm,
- FrCommandCaps capabilities);
+GType fr_command_get_type (void);
+void fr_command_set_filename (FrCommand *comm,
+ const char *filename);
+void fr_command_list (FrCommand *comm);
+void fr_command_add (FrCommand *comm,
+ GList *file_list,
+ const char *base_dir,
+ gboolean update,
+ gboolean recursive);
+void fr_command_delete (FrCommand *comm,
+ GList *file_list);
+void fr_command_extract (FrCommand *comm,
+ GList *file_list,
+ const char *dest_dir,
+ gboolean overwrite,
+ gboolean skip_older,
+ gboolean junk_paths);
+void fr_command_test (FrCommand *comm);
+void fr_command_uncompress (FrCommand *comm);
+void fr_command_recompress (FrCommand *comm);
+gboolean fr_command_is_capable_of (FrCommand *comm,
+ FrCommandCaps capabilities);
+const char ** fr_command_get_mime_types (FrCommand *comm);
+void fr_command_update_capabilities (FrCommand *comm);
+FrCommandCap fr_command_get_capabilities (FrCommand *comm,
+ const char *mime_type);
+void fr_command_set_mime_type (FrCommand *comm,
+ const char *mime_type);
+gboolean fr_command_is_capable_of (FrCommand *comm,
+ FrCommandCaps capabilities);
/* protected functions */
-void fr_command_progress (FrCommand *comm,
- double fraction);
-void fr_command_message (FrCommand *comm,
- const char *msg);
-void fr_command_working_archive (FrCommand *comm,
- const char *archive_name);
-void fr_command_set_n_files (FrCommand *comm,
- int n_files);
-void fr_command_add_file (FrCommand *comm,
- FileData *fdata);
+void fr_command_progress (FrCommand *comm,
+ double fraction);
+void fr_command_message (FrCommand *comm,
+ const char *msg);
+void fr_command_working_archive (FrCommand *comm,
+ const char *archive_name);
+void fr_command_set_n_files (FrCommand *comm,
+ int n_files);
+void fr_command_add_file (FrCommand *comm,
+ FileData *fdata);
/* private functions */
-void fr_command_handle_error (FrCommand *comm,
- FrProcError *error);
+void fr_command_handle_error (FrCommand *comm,
+ FrProcError *error);
#endif /* FR_COMMAND_H */
Modified: trunk/src/fr-window.c
==============================================================================
--- trunk/src/fr-window.c (original)
+++ trunk/src/fr-window.c Sun Jul 20 17:20:25 2008
@@ -311,6 +311,7 @@
char * password_for_paste;
gboolean encrypt_header;
FrCompression compression;
+ guint volume_size;
guint activity_timeout_handle; /* activity timeout
* handle. */
@@ -1087,8 +1088,9 @@
scan = fdata->full_path + current_dir_len;
end = strchr (scan, '/');
- if ((end == NULL) && ! fdata->dir) /* file */
+ if ((end == NULL) && ! fdata->dir) { /* file */
fdata->list_name = g_strdup (scan);
+ }
else { /* folder */
char *dir_name;
@@ -1318,23 +1320,6 @@
}
-/*static const char *
-get_action_from_sort_method (FrWindowSortMethod sort_method)
-{
- switch (sort_method) {
- case FR_WINDOW_SORT_BY_NAME: return "SortByName";
- case FR_WINDOW_SORT_BY_SIZE: return "SortBySize";
- case FR_WINDOW_SORT_BY_TYPE: return "SortByType";
- case FR_WINDOW_SORT_BY_TIME: return "SortByDate";
- case FR_WINDOW_SORT_BY_PATH: return "SortByLocation";
- default:
- break;
- }
-
- return "SortByName";
-}*/
-
-
static void
add_selected_from_list_view (GtkTreeModel *model,
GtkTreePath *path,
@@ -2346,7 +2331,6 @@
g_free (name);
}
}
-
}
@@ -4043,7 +4027,6 @@
FALSE,
TRUE,
FALSE,
- window->priv->password,
FALSE);
path_list_free (window->priv->drag_file_list);
window->priv->drag_file_list = NULL;
@@ -6233,19 +6216,16 @@
const char *directory,
const char *base_dir,
const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression)
+ gboolean update)
{
fr_archive_add_directory (window->archive,
directory,
base_dir,
(dest_dir == NULL)? fr_window_get_current_location (window): dest_dir,
update,
- password,
- encrypt_header,
- compression);
+ window->priv->password,
+ window->priv->encrypt_header,
+ window->priv->compression);
}
@@ -6254,19 +6234,16 @@
GList *item_list,
const char *base_dir,
const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression)
+ gboolean update)
{
fr_archive_add_items (window->archive,
item_list,
base_dir,
(dest_dir == NULL)? fr_window_get_current_location (window): dest_dir,
update,
- password,
- encrypt_header,
- compression);
+ window->priv->password,
+ window->priv->encrypt_header,
+ window->priv->compression);
}
@@ -6288,13 +6265,12 @@
void
fr_window_archive_remove (FrWindow *window,
- GList *file_list,
- FrCompression compression)
+ GList *file_list)
{
fr_window_clipboard_remove_file_list (window, file_list);
fr_process_clear (window->archive->process);
- fr_archive_remove (window->archive, file_list, compression);
+ fr_archive_remove (window->archive, file_list, window->priv->compression);
fr_process_start (window->archive->process);
}
@@ -6309,7 +6285,6 @@
gboolean skip_older,
gboolean overwrite,
gboolean junk_paths,
- const char *password,
gboolean extract_here)
{
ExtractData *edata;
@@ -6323,8 +6298,6 @@
edata->junk_paths = junk_paths;
if (base_dir != NULL)
edata->base_dir = g_strdup (base_dir);
- if (password != NULL)
- edata->password = g_strdup (password);
edata->extract_here = extract_here;
return edata;
@@ -6340,7 +6313,6 @@
FALSE,
TRUE,
FALSE,
- NULL,
FALSE);
}
@@ -6353,7 +6325,6 @@
path_list_free (edata->file_list);
g_free (edata->extract_to_dir);
g_free (edata->base_dir);
- g_free (edata->password);
g_free (edata);
}
@@ -6363,8 +6334,7 @@
fr_window_archive_extract_here (FrWindow *window,
gboolean skip_older,
gboolean overwrite,
- gboolean junk_paths,
- const char *password)
+ gboolean junk_paths)
{
ExtractData *edata;
@@ -6374,7 +6344,6 @@
skip_older,
overwrite,
junk_paths,
- password,
TRUE);
fr_window_set_current_batch_action (window,
FR_BATCH_ACTION_EXTRACT,
@@ -6388,7 +6357,7 @@
edata->skip_older,
edata->overwrite,
edata->junk_paths,
- edata->password))
+ window->priv->password))
{
fr_process_start (window->archive->process);
}
@@ -6403,7 +6372,6 @@
gboolean skip_older,
gboolean overwrite,
gboolean junk_paths,
- const char *password,
gboolean ask_to_open_destination)
{
ExtractData *edata;
@@ -6416,7 +6384,6 @@
skip_older,
overwrite,
junk_paths,
- password,
FALSE);
fr_window_set_current_batch_action (window,
@@ -6498,7 +6465,7 @@
edata->skip_older,
edata->overwrite,
edata->junk_paths,
- edata->password);
+ window->priv->password);
fr_process_start (window->archive->process);
}
@@ -6510,7 +6477,6 @@
FR_BATCH_ACTION_TEST,
NULL,
NULL);
-
fr_archive_test (window->archive, window->priv->password);
}
@@ -6571,6 +6537,16 @@
}
+void
+fr_window_set_compression (FrWindow *window,
+ FrCompression compression)
+{
+ g_return_if_fail (window != NULL);
+
+ window->priv->compression = compression;
+}
+
+
FrCompression
fr_window_get_compression (FrWindow *window)
{
@@ -6579,6 +6555,23 @@
void
+fr_window_set_volume_size (FrWindow *window,
+ guint volume_size)
+{
+ g_return_if_fail (window != NULL);
+
+ window->priv->volume_size = volume_size;
+}
+
+
+guint
+fr_window_get_volume_size (FrWindow *window)
+{
+ return window->priv->volume_size;
+}
+
+
+void
fr_window_go_to_location (FrWindow *window,
const char *path,
gboolean force_update)
@@ -7603,10 +7596,9 @@
window);
fr_archive_set_fake_load_func (window->priv->copy_from_archive, always_fake_load, NULL);
}
-
fr_archive_load_local (window->priv->copy_from_archive,
data->archive_filename,
- data->archive_password);
+ data->archive_password);
}
@@ -8247,7 +8239,6 @@
edata->skip_older,
edata->overwrite,
edata->junk_paths,
- window->priv->password,
TRUE);
break;
@@ -8258,8 +8249,7 @@
fr_window_archive_extract_here (window,
FALSE,
TRUE,
- FALSE,
- window->priv->password);
+ FALSE);
break;
case FR_BATCH_ACTION_EXTRACT_INTERACT:
@@ -8275,7 +8265,6 @@
FALSE,
TRUE,
FALSE,
- window->priv->password,
TRUE);
}
else {
Modified: trunk/src/fr-window.h
==============================================================================
--- trunk/src/fr-window.h (original)
+++ trunk/src/fr-window.h Sun Jul 20 17:20:25 2008
@@ -134,24 +134,17 @@
const char *directory,
const char *base_dir,
const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
+ gboolean update);
void fr_window_archive_add_items (FrWindow *window,
GList *dir_list,
const char *base_dir,
const char *dest_dir,
- gboolean update,
- const char *password,
- gboolean encrypt_header,
- FrCompression compression);
+ gboolean update);
void fr_window_archive_add_dropped_items (FrWindow *window,
GList *item_list,
gboolean update);
void fr_window_archive_remove (FrWindow *window,
- GList *file_list,
- FrCompression compression);
+ GList *file_list);
void fr_window_archive_extract (FrWindow *window,
GList *file_list,
const char *extract_to_dir,
@@ -159,14 +152,15 @@
gboolean skip_older,
gboolean overwrite,
gboolean junk_paths,
- const char *password,
gboolean ask_to_open_destination);
void fr_window_archive_extract_here (FrWindow *window,
gboolean skip_older,
gboolean overwrite,
- gboolean junk_paths,
- const char *password);
+ gboolean junk_paths);
void fr_window_archive_test (FrWindow *window);
+
+/**/
+
void fr_window_set_password (FrWindow *window,
const char *password);
void fr_window_set_password_for_paste (FrWindow *window,
@@ -175,7 +169,12 @@
void fr_window_set_encrypt_header (FrWindow *window,
gboolean encrypt_header);
gboolean fr_window_get_encrypt_header (FrWindow *window);
+void fr_window_set_compression (FrWindow *window,
+ FrCompression compression);
FrCompression fr_window_get_compression (FrWindow *window);
+void fr_window_set_volume_size (FrWindow *window,
+ guint volume_size);
+guint fr_window_get_volume_size (FrWindow *window);
/**/
Modified: trunk/src/gtk-utils.c
==============================================================================
--- trunk/src/gtk-utils.c (original)
+++ trunk/src/gtk-utils.c Sun Jul 20 17:20:25 2008
@@ -361,16 +361,6 @@
}
-static void
-toggle_visibility (GtkWidget *widget)
-{
- if (GTK_WIDGET_VISIBLE (widget))
- gtk_widget_hide (widget);
- else
- gtk_widget_show (widget);
-}
-
-
GtkWidget*
_gtk_error_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
Modified: trunk/src/typedefs.h
==============================================================================
--- trunk/src/typedefs.h (original)
+++ trunk/src/typedefs.h Sun Jul 20 17:20:25 2008
@@ -32,7 +32,7 @@
#define OLD_RC_RECENT_FILE ".file-roller/recents"
#define OLD_RC_OPTIONS_DIR ".file-roller/options"
-typedef enum {
+typedef enum { /*< skip >*/
FR_WINDOW_SORT_BY_NAME = 0,
FR_WINDOW_SORT_BY_SIZE = 1,
FR_WINDOW_SORT_BY_TYPE = 2,
@@ -40,7 +40,7 @@
FR_WINDOW_SORT_BY_PATH = 4
} FrWindowSortMethod;
-typedef enum {
+typedef enum { /*< skip >*/
FR_WINDOW_LIST_MODE_FLAT,
FR_WINDOW_LIST_MODE_AS_DIR
} FrWindowListMode;
@@ -52,7 +52,7 @@
FR_COMPRESSION_MAXIMUM
} FrCompression;
-typedef enum {
+typedef enum { /*< skip >*/
FR_PROC_ERROR_NONE,
FR_PROC_ERROR_GENERIC,
FR_PROC_ERROR_COMMAND_ERROR,
@@ -70,7 +70,7 @@
GError *gerror;
} FrProcError;
-typedef enum {
+typedef enum { /*< skip >*/
FR_COMMAND_CAN_DO_NOTHING = 0,
FR_COMMAND_CAN_READ = 1 << 0,
FR_COMMAND_CAN_WRITE = 1 << 1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]