[file-roller/wip/jtojnar/gir-cleanups: 6/7] gir: Add Fr prefix to FileData
- From: Jan Tojnar <jtojnar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller/wip/jtojnar/gir-cleanups: 6/7] gir: Add Fr prefix to FileData
- Date: Thu, 18 Aug 2022 00:31:14 +0000 (UTC)
commit 2027c592c457d19e88adcdd5abbbe0e10bf7c3b0
Author: Jan Tojnar <jtojnar gmail com>
Date: Thu Aug 18 02:00:35 2022 +0200
gir: Add Fr prefix to FileData
To make it better work with GObject Introspection.
po/POTFILES.in | 4 +-
src/dlg-prop.c | 2 +-
src/fr-archive-libarchive.c | 6 +-
src/fr-archive.c | 16 ++---
src/fr-archive.h | 8 +--
src/fr-command-7z.c | 14 ++--
src/fr-command-ace.c | 8 +--
src/fr-command-alz.c | 8 +--
src/fr-command-ar.c | 10 +--
src/fr-command-arj.c | 12 ++--
src/fr-command-cfile.c | 14 ++--
src/fr-command-cpio.c | 8 +--
src/fr-command-dpkg.c | 12 ++--
src/fr-command-iso.c | 10 +--
src/fr-command-lha.c | 8 +--
src/fr-command-lrzip.c | 8 +--
src/fr-command-rar.c | 14 ++--
src/fr-command-rpm.c | 8 +--
src/fr-command-tar.c | 8 +--
src/fr-command-unarchiver.c | 6 +-
src/fr-command-unsquashfs.c | 8 +--
src/fr-command-unstuff.c | 8 +--
src/fr-command-zip.c | 8 +--
src/fr-command-zoo.c | 8 +--
src/fr-command.c | 18 ++---
src/{file-data.c => fr-file-data.c} | 40 +++++------
src/{file-data.h => fr-file-data.h} | 31 ++++----
src/fr-init.c | 2 +-
src/fr-list-model.c | 2 +-
src/fr-window.c | 136 ++++++++++++++++++------------------
src/meson.build | 4 +-
31 files changed, 223 insertions(+), 226 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 11e90667..52a3b262 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -32,8 +32,6 @@ src/dlg-update.c
src/dlg-update.h
src/eggtreemultidnd.c
src/eggtreemultidnd.h
-src/file-data.c
-src/file-data.h
src/file-utils.c
src/file-utils.h
src/fr-application-menu.c
@@ -88,6 +86,8 @@ src/fr-command.c
src/fr-command.h
src/fr-error.c
src/fr-error.h
+src/fr-file-data.c
+src/fr-file-data.h
src/fr-file-selector-dialog.c
src/fr-file-selector-dialog.h
src/fr-init.c
diff --git a/src/dlg-prop.c b/src/dlg-prop.c
index 33d6f689..94266215 100644
--- a/src/dlg-prop.c
+++ b/src/dlg-prop.c
@@ -136,7 +136,7 @@ dlg_prop (FrWindow *window)
uncompressed_size = 0;
if (fr_window_archive_is_present (window)) {
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fd = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fd = g_ptr_array_index (window->archive->files, i);
uncompressed_size += fd->size;
}
}
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 1bfd4234..1dcf1573 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -29,7 +29,7 @@
#include <gio/gio.h>
#include <archive.h>
#include <archive_entry.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "fr-error.h"
#include "fr-archive-libarchive.h"
@@ -455,13 +455,13 @@ list_archive_thread (GSimpleAsyncResult *result,
}
while ((r = archive_read_next_header (a, &entry)) == ARCHIVE_OK) {
- FileData *file_data;
+ FrFileData *file_data;
const char *pathname;
if (g_cancellable_is_cancelled (cancellable))
break;
- file_data = file_data_new ();
+ file_data = fr_file_data_new ();
if (archive_entry_size_is_set (entry)) {
FrArchiveLibarchivePrivate *private = fr_archive_libarchive_get_instance_private
(FR_ARCHIVE_LIBARCHIVE (load_data->archive));
diff --git a/src/fr-archive.c b/src/fr-archive.c
index 79b7758c..0629fb46 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -31,7 +31,7 @@
#include "glib-utils.h"
#include "file-utils.h"
#include "gio-utils.h"
-#include "file-data.h"
+#include "fr-file-data.h"
#include "fr-archive.h"
#include "fr-command.h"
#include "fr-enum-types.h"
@@ -434,7 +434,7 @@ fr_archive_init (FrArchive *self)
FrArchivePrivate *private = fr_archive_get_instance_private (self);
self->mime_type = NULL;
- self->files = g_ptr_array_new_full (FILE_ARRAY_INITIAL_SIZE, (GDestroyNotify) file_data_free);
+ self->files = g_ptr_array_new_full (FILE_ARRAY_INITIAL_SIZE, (GDestroyNotify) fr_file_data_free);
self->files_hash = g_hash_table_new (g_str_hash, g_str_equal);
self->n_regular_files = 0;
self->password = NULL;
@@ -863,7 +863,7 @@ fr_archive_list (FrArchive *archive,
if (archive->files != NULL) {
g_hash_table_remove_all (archive->files_hash);
g_ptr_array_unref (archive->files);
- archive->files = g_ptr_array_new_full (FILE_ARRAY_INITIAL_SIZE, (GDestroyNotify)
file_data_free);
+ archive->files = g_ptr_array_new_full (FILE_ARRAY_INITIAL_SIZE, (GDestroyNotify)
fr_file_data_free);
archive->n_regular_files = 0;
}
@@ -888,12 +888,12 @@ fr_archive_operation_finish (FrArchive *archive,
if (success && (g_simple_async_result_get_source_tag (G_SIMPLE_ASYNC_RESULT (result)) ==
fr_archive_list)) {
/* order the list by name to speed up search */
- g_ptr_array_sort (archive->files, file_data_compare_by_path);
+ g_ptr_array_sort (archive->files, fr_file_data_compare_by_path);
/* update the file_data hash */
g_hash_table_remove_all (archive->files_hash);
for (guint i = 0; i < archive->files->len; i++) {
- FileData *file_data = g_ptr_array_index (archive->files, i);
+ FrFileData *file_data = g_ptr_array_index (archive->files, i);
g_hash_table_insert (archive->files_hash, file_data->original_path, file_data);
}
}
@@ -1192,7 +1192,7 @@ _fr_archive_get_file_list_size (FrArchive *archive,
for (scan = file_list; scan; scan = scan->next) {
const char *original_path = scan->data;
- FileData *file_data;
+ FrFileData *file_data;
file_data = g_hash_table_lookup (archive->files_hash, original_path);
if (file_data != NULL)
@@ -2155,9 +2155,9 @@ fr_archive_progress_get_fraction (FrArchive *self)
void
fr_archive_add_file (FrArchive *self,
- FileData *file_data)
+ FrFileData *file_data)
{
- file_data_update_content_type (file_data);
+ fr_file_data_update_content_type (file_data);
g_ptr_array_add (self->files, file_data);
if (! file_data->dir)
self->n_regular_files++;
diff --git a/src/fr-archive.h b/src/fr-archive.h
index caa05605..4823e924 100644
--- a/src/fr-archive.h
+++ b/src/fr-archive.h
@@ -23,7 +23,7 @@
#define FR_ARCHIVE_H
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "typedefs.h"
typedef enum {
@@ -72,8 +72,8 @@ struct _FrArchive {
/*<public, read only>*/
const char *mime_type;
- GPtrArray *files; /* Array of FileData */
- GHashTable *files_hash; /* Hash of FileData with original_path as key */
+ GPtrArray *files; /* Array of FrFileData */
+ GHashTable *files_hash; /* Hash of FrFileData with original_path as key */
int n_regular_files;
/*<public>*/
@@ -519,7 +519,7 @@ double fr_archive_progress_inc_completed_bytes
gsize new_completed);
double fr_archive_progress_get_fraction (FrArchive *archive);
void fr_archive_add_file (FrArchive *archive,
- FileData *file_data);
+ FrFileData *file_data);
/* utilities */
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 20dcbb72..ba7d1c29 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -26,7 +26,7 @@
#include <time.h>
#include <glib.h>
#include <glib/gi18n.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -38,7 +38,7 @@ struct _FrCommand7z
{
FrCommand parent_instance;
gboolean list_started;
- FileData *fdata;
+ FrFileData *fdata;
};
@@ -91,7 +91,7 @@ list__process_line (char *line,
FrCommand7z *self = FR_COMMAND_7Z (data);
FrArchive *archive = FR_ARCHIVE (data);
char **fields;
- FileData *fdata;
+ FrFileData *fdata;
g_return_if_fail (line != NULL);
@@ -109,7 +109,7 @@ list__process_line (char *line,
if (strcmp (line, "") == 0) {
if (self->fdata != NULL) {
if (self->fdata->original_path == NULL) {
- file_data_free (self->fdata);
+ fr_file_data_free (self->fdata);
self->fdata = NULL;
}
else {
@@ -127,7 +127,7 @@ list__process_line (char *line,
}
if (self->fdata == NULL)
- self->fdata = file_data_new ();
+ self->fdata = fr_file_data_new ();
fields = g_strsplit (line, " = ", 2);
@@ -217,7 +217,7 @@ list__begin (gpointer data)
FrCommand7z *p7z_comm = data;
if (p7z_comm->fdata != NULL) {
- file_data_free (p7z_comm->fdata);
+ fr_file_data_free (p7z_comm->fdata);
p7z_comm->fdata = NULL;
}
p7z_comm->list_started = FALSE;
@@ -527,7 +527,7 @@ fr_command_7z_handle_error (FrCommand *command,
FrArchive *archive = FR_ARCHIVE (command);
if (error->type == FR_ERROR_NONE) {
- FileData *first;
+ FrFileData *first;
char *basename;
char *testname;
diff --git a/src/fr-command-ace.c b/src/fr-command-ace.c
index ad9031b2..2a445696 100644
--- a/src/fr-command-ace.c
+++ b/src/fr-command-ace.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -91,7 +91,7 @@ static void
process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommandAce *ace_comm = FR_COMMAND_ACE (data);
FrCommand *comm = FR_COMMAND (data);
char **fields;
@@ -121,7 +121,7 @@ process_line (char *line,
return;
}
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
if (ace_comm->command_type == FR_ACE_COMMAND_PUBLIC)
fields = g_strsplit (line, "|", 6);
@@ -160,7 +160,7 @@ process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-alz.c b/src/fr-command-alz.c
index 09392837..05794a6a 100644
--- a/src/fr-command-alz.c
+++ b/src/fr-command-alz.c
@@ -25,7 +25,7 @@
#include <time.h>
#include <unistd.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "fr-command.h"
#include "fr-command-alz.h"
@@ -88,7 +88,7 @@ process_line (char *line,
{
FrCommand *comm = FR_COMMAND (data);
FrCommandAlz *alz_comm = FR_COMMAND_ALZ (comm);
- FileData *fdata;
+ FrFileData *fdata;
char **fields;
char *name_field;
char name_last;
@@ -112,7 +112,7 @@ process_line (char *line,
if (! alz_comm->list_started)
return;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 5);
fdata->modified = mktime_from_string (fields[0], fields[1]);
fdata->size = g_ascii_strtoull (fields[3], NULL, 10);
@@ -151,7 +151,7 @@ process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
diff --git a/src/fr-command-ar.c b/src/fr-command-ar.c
index c661ba27..66ca78ff 100644
--- a/src/fr-command-ar.c
+++ b/src/fr-command-ar.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "fr-command.h"
#include "fr-command-ar.h"
@@ -119,7 +119,7 @@ static void
process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
int date_idx;
@@ -128,7 +128,7 @@ process_line (char *line,
g_return_if_fail (line != NULL);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
date_idx = _g_line_get_index_from_pattern (line, "%c%c%c %a%n %n%n:%n%n %n%n%n%n");
@@ -155,7 +155,7 @@ process_line (char *line,
if (fields[0] == NULL) {
g_strfreev (fields);
g_free (field_name);
- file_data_free (fdata);
+ fr_file_data_free (fdata);
return;
}
@@ -181,7 +181,7 @@ process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-arj.c b/src/fr-command-arj.c
index d6b6f9b4..3bcf037d 100644
--- a/src/fr-command-arj.c
+++ b/src/fr-command-arj.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -37,7 +37,7 @@ struct _FrCommandArj
gboolean list_started;
int line_no;
- FileData *fdata;
+ FrFileData *fdata;
GRegex *filename_line_regex;
};
@@ -112,12 +112,12 @@ list__process_line (char *line,
}
if (g_regex_match (arj_comm->filename_line_regex, line, 0, NULL)) { /* Read the filename. */
- FileData *fdata;
+ FrFileData *fdata;
const char *name_field;
arj_comm->line_no = 1;
- arj_comm->fdata = fdata = file_data_new ();
+ arj_comm->fdata = fdata = fr_file_data_new ();
name_field = _g_str_get_last_field (line, 2);
@@ -136,7 +136,7 @@ list__process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
}
else if (arj_comm->line_no == 2) { /* Read file size and date. */
- FileData *fdata;
+ FrFileData *fdata;
char **fields;
fdata = arj_comm->fdata;
@@ -153,7 +153,7 @@ list__process_line (char *line,
g_strfreev (fields);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
arj_comm->fdata = NULL;
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c
index b112afb7..c347756c 100644
--- a/src/fr-command-cfile.c
+++ b/src/fr-command-cfile.c
@@ -27,7 +27,7 @@
#include <time.h>
#include <fcntl.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -102,12 +102,12 @@ list__process_line (char *line,
gpointer data)
{
FrCommand *comm = FR_COMMAND (data);
- FileData *fdata;
+ FrFileData *fdata;
char **fields;
GFile *file;
char *filename;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 2);
if (strcmp (fields[1], "-1") != 0)
@@ -134,7 +134,7 @@ list__process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
@@ -163,11 +163,11 @@ fr_command_cfile_list (FrCommand *comm)
* simply use the archive size, suboptimal but there is no
* alternative. */
- FileData *fdata;
+ FrFileData *fdata;
char *filename;
GFile *file;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
filename = _g_path_remove_first_extension (comm->filename);
fdata->full_path = g_strconcat ("/",
@@ -185,7 +185,7 @@ fr_command_cfile_list (FrCommand *comm)
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
diff --git a/src/fr-command-cpio.c b/src/fr-command-cpio.c
index f78f23d1..a7333983 100644
--- a/src/fr-command-cpio.c
+++ b/src/fr-command-cpio.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -87,7 +87,7 @@ static void
list__process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
const char *name_field;
@@ -96,7 +96,7 @@ list__process_line (char *line,
g_return_if_fail (line != NULL);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
#ifdef __sun
fields = _g_str_split_line (line, 9);
@@ -162,7 +162,7 @@ list__process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-dpkg.c b/src/fr-command-dpkg.c
index 22667e1c..95256a7c 100644
--- a/src/fr-command-dpkg.c
+++ b/src/fr-command-dpkg.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -45,7 +45,7 @@ static void
process_metadata_line (char *line,
FrCommand *comm)
{
- FileData *fdata;
+ FrFileData *fdata;
char **fields;
char *name;
@@ -57,7 +57,7 @@ process_metadata_line (char *line,
return;
}
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
if (fields[5] && g_str_equal (fields[4],"*")) {
@@ -82,7 +82,7 @@ static void
process_data_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
char **tmfields;
@@ -97,7 +97,7 @@ process_data_line (char *line,
return;
}
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 5);
fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
@@ -151,7 +151,7 @@ process_data_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-iso.c b/src/fr-command-iso.c
index 34e083bd..3c686808 100644
--- a/src/fr-command-iso.c
+++ b/src/fr-command-iso.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -72,7 +72,7 @@ static void
list__process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
FrCommandIso *comm_iso = FR_COMMAND_ISO (comm);
char **fields;
@@ -90,7 +90,7 @@ list__process_line (char *line,
} else if (line[0] == '-') { /* Is file */
const char *last_field, *first_bracket;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 8);
fdata->size = g_ascii_strtoull (fields[4], NULL, 10);
@@ -102,7 +102,7 @@ list__process_line (char *line,
last_field = _g_str_get_last_field (line, 9);
first_bracket = strchr (last_field, ']');
if (first_bracket == NULL) {
- file_data_free (fdata);
+ fr_file_data_free (fdata);
return;
}
@@ -110,7 +110,7 @@ list__process_line (char *line,
if ((name_field == NULL)
|| (strcmp (name_field, ".") == 0)
|| (strcmp (name_field, "..") == 0)) {
- file_data_free (fdata);
+ fr_file_data_free (fdata);
return;
}
diff --git a/src/fr-command-lha.c b/src/fr-command-lha.c
index dd076949..17381dc6 100644
--- a/src/fr-command-lha.c
+++ b/src/fr-command-lha.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -163,14 +163,14 @@ static void
process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
const char *name_field;
g_return_if_fail (line != NULL);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = split_line_lha (line);
fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
@@ -202,7 +202,7 @@ process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-lrzip.c b/src/fr-command-lrzip.c
index 61161255..f0010601 100644
--- a/src/fr-command-lrzip.c
+++ b/src/fr-command-lrzip.c
@@ -12,7 +12,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -35,7 +35,7 @@ static void
list__process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
g_return_if_fail (line != NULL);
@@ -46,7 +46,7 @@ list__process_line (char *line,
if (! g_str_has_prefix (line, "Decompressed file size:"))
return;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fdata->size = g_ascii_strtoull (_g_str_get_last_field (line, 4), NULL, 10);
struct stat st;
@@ -79,7 +79,7 @@ list__process_line (char *line,
fdata->link = NULL;
if (*fdata->name == '\0')
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
index 0b3410e5..7951314d 100644
--- a/src/fr-command-rar.c
+++ b/src/fr-command-rar.c
@@ -26,7 +26,7 @@
#include <time.h>
#include <glib.h>
#include <glib/gi18n.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "gio-utils.h"
#include "glib-utils.h"
@@ -44,7 +44,7 @@ struct _FrCommandRar
gboolean rar4_odd_line;
gboolean rar5;
gboolean rar5_30;
- FileData *fdata;
+ FrFileData *fdata;
};
@@ -199,9 +199,9 @@ parse_name_field (char *line,
FrCommandRar *rar_comm)
{
char *name_field;
- FileData *fdata;
+ FrFileData *fdata;
- rar_comm->fdata = fdata = file_data_new ();
+ rar_comm->fdata = fdata = fr_file_data_new ();
/* read file name. */
@@ -285,7 +285,7 @@ process_line (char *line,
parse_name_field (line, rar_comm);
if (! rar_comm->rar4_odd_line) {
- FileData *fdata;
+ FrFileData *fdata;
const char *size_field, *ratio_field, *date_field, *time_field, *attr_field;
fdata = rar_comm->fdata;
@@ -312,7 +312,7 @@ process_line (char *line,
if (g_strv_length (fields) < 6) {
/* wrong line format, treat this line as a filename line */
g_strfreev (fields);
- file_data_free (rar_comm->fdata);
+ fr_file_data_free (rar_comm->fdata);
rar_comm->fdata = NULL;
rar_comm->rar4_odd_line = TRUE;
parse_name_field (line, rar_comm);
@@ -323,7 +323,7 @@ process_line (char *line,
{
/* ignore files that span more volumes */
- file_data_free (rar_comm->fdata);
+ fr_file_data_free (rar_comm->fdata);
rar_comm->fdata = NULL;
}
else {
diff --git a/src/fr-command-rpm.c b/src/fr-command-rpm.c
index 7ba48d38..e0735686 100644
--- a/src/fr-command-rpm.c
+++ b/src/fr-command-rpm.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -96,7 +96,7 @@ static void
list__process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
const char *name_field;
@@ -105,7 +105,7 @@ list__process_line (char *line,
g_return_if_fail (line != NULL);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
#ifdef __sun
fields = _g_str_split_line (line, 9);
@@ -170,7 +170,7 @@ list__process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index c4c1c135..8c70cf02 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -28,7 +28,7 @@
#include <time.h>
#include <glib.h>
#include <glib/gi18n.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -127,7 +127,7 @@ static void
process_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
int date_idx;
@@ -140,7 +140,7 @@ process_line (char *line,
if (date_idx < 0)
return;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
field_size = _g_line_get_prev_field (line, date_idx, 1);
fdata->size = g_ascii_strtoull (field_size, NULL, 10);
@@ -188,7 +188,7 @@ process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-unarchiver.c b/src/fr-command-unarchiver.c
index b08d30fa..1c159845 100644
--- a/src/fr-command-unarchiver.c
+++ b/src/fr-command-unarchiver.c
@@ -29,7 +29,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <json-glib/json-glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "gio-utils.h"
#include "glib-utils.h"
@@ -93,11 +93,11 @@ list_command_completed (gpointer data)
content = json_object_get_array_member (root, "lsarContents");
for (guint i = 0; i < json_array_get_length (content); i++) {
JsonObject *entry;
- FileData *fdata;
+ FrFileData *fdata;
const char *filename;
entry = json_array_get_object_element (content, i);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
if (json_object_has_member (entry, "XADFileSize"))
fdata->size = json_object_get_int_member (entry, "XADFileSize");
fdata->modified = mktime_from_string (json_object_get_string_member (entry,
"XADLastModificationDate"));
diff --git a/src/fr-command-unsquashfs.c b/src/fr-command-unsquashfs.c
index 8e203b67..62c7dad9 100644
--- a/src/fr-command-unsquashfs.c
+++ b/src/fr-command-unsquashfs.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -49,7 +49,7 @@ static void
process_data_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
UnsquashfsData *d = data;
char **fields;
char **tmfields;
@@ -65,7 +65,7 @@ process_data_line (char *line,
return;
}
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 5);
fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
@@ -112,7 +112,7 @@ process_data_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (d->command), fdata);
}
diff --git a/src/fr-command-unstuff.c b/src/fr-command-unstuff.c
index 1c760d3d..a5301417 100644
--- a/src/fr-command-unstuff.c
+++ b/src/fr-command-unstuff.c
@@ -25,7 +25,7 @@
#include <time.h>
#include <unistd.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "fr-command.h"
#include "fr-command-unstuff.h"
@@ -37,7 +37,7 @@ struct _FrCommandUnstuff
FrCommand parent_instance;
char *target_dir;
- FileData *fdata;
+ FrFileData *fdata;
};
@@ -116,7 +116,7 @@ process_line (char *line,
const char *str_start;
char *filename, *real_filename;
int i;
- FileData *fdata;
+ FrFileData *fdata;
g_return_if_fail (line != NULL);
@@ -165,7 +165,7 @@ process_line (char *line,
}
real_filename = g_strndup (str_start, i);
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fdata->full_path = filename;
fdata->original_path = filename;
fdata->link = NULL;
diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c
index 0e67e6d1..17e47f87 100644
--- a/src/fr-command-zip.c
+++ b/src/fr-command-zip.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -96,7 +96,7 @@ list__process_line (char *line,
{
FrCommandZip *comm = data;
FrCommandZipPrivate *priv = fr_command_zip_get_instance_private (comm);
- FileData *fdata;
+ FrFileData *fdata;
char **fields;
const char *name_field;
size_t line_l;
@@ -125,7 +125,7 @@ list__process_line (char *line,
/**/
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fields = _g_str_split_line (line, 7);
fdata->size = g_ascii_strtoull (fields[3], NULL, 10);
@@ -155,7 +155,7 @@ list__process_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (comm), fdata);
}
diff --git a/src/fr-command-zoo.c b/src/fr-command-zoo.c
index 8af3edf0..ebb9f4ca 100644
--- a/src/fr-command-zoo.c
+++ b/src/fr-command-zoo.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <time.h>
#include <glib.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "fr-command.h"
@@ -175,7 +175,7 @@ static void
process_zoo_line (char *line,
gpointer data)
{
- FileData *fdata;
+ FrFileData *fdata;
FrCommand *zoo_comm = FR_COMMAND (data);
char **fields;
const char *name_field;
@@ -188,7 +188,7 @@ process_zoo_line (char *line,
if (fields == NULL)
return;
- fdata = file_data_new ();
+ fdata = fr_file_data_new ();
fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
fdata->modified = mktime_from_string_zoo (fields[1],
@@ -212,7 +212,7 @@ process_zoo_line (char *line,
fdata->path = _g_path_remove_level (fdata->full_path);
if (*fdata->name == 0)
- file_data_free (fdata);
+ fr_file_data_free (fdata);
else
fr_archive_add_file (FR_ARCHIVE (zoo_comm), fdata);
}
diff --git a/src/fr-command.c b/src/fr-command.c
index 80be46e2..18445247 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -29,7 +29,7 @@
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "fr-command.h"
#include "fr-error.h"
@@ -756,7 +756,7 @@ create_tmp_base_dir (GFile *base_dir,
}
-static FileData *
+static FrFileData *
find_file_in_archive (FrArchive *archive,
char *path)
{
@@ -764,9 +764,9 @@ find_file_in_archive (FrArchive *archive,
g_return_val_if_fail (path != NULL, NULL);
- i = find_path_in_file_data_array (archive->files, path);
+ i = fr_find_path_in_file_data_array (archive->files, path);
if (i >= 0)
- return (FileData *) g_ptr_array_index (archive->files, i);
+ return (FrFileData *) g_ptr_array_index (archive->files, i);
else
return NULL;
}
@@ -787,7 +787,7 @@ newer_files_only (FrArchive *archive,
for (scan = file_list; scan; scan = scan->next) {
char *filename = scan->data;
GFile *file;
- FileData *fdata;
+ FrFileData *fdata;
fdata = find_file_in_archive (archive, filename);
@@ -1522,7 +1522,7 @@ delete_from_archive (FrCommand *self,
if (file_list == NULL) {
for (guint i = 0; i < archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (archive->files, i);
file_list = g_list_prepend (file_list, fdata->original_path);
}
@@ -2113,7 +2113,7 @@ _fr_command_extract (FrCommand *self,
if (extract_all && (! all_options_supported || ! archive->propCanExtractAll)) {
file_list = NULL;
for (guint i = 0; i < archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (archive->files, i);
file_list = g_list_prepend (file_list, g_strdup (fdata->original_path));
}
file_list_created = TRUE;
@@ -2164,7 +2164,7 @@ _fr_command_extract (FrCommand *self,
if (extract_all && ! file_list_created) {
file_list = NULL;
for (guint i = 0; i < archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (archive->files, i);
file_list = g_list_prepend (file_list, g_strdup (fdata->original_path));
}
@@ -2173,7 +2173,7 @@ _fr_command_extract (FrCommand *self,
filtered = NULL;
for (scan = file_list; scan; scan = scan->next) {
- FileData *fdata;
+ FrFileData *fdata;
char *archive_list_filename = scan->data;
const char *filename;
GFile *destination_file;
diff --git a/src/file-data.c b/src/fr-file-data.c
similarity index 81%
rename from src/file-data.c
rename to src/fr-file-data.c
index 97d98129..7b4ce389 100644
--- a/src/file-data.c
+++ b/src/fr-file-data.c
@@ -24,18 +24,18 @@
#include <gio/gio.h>
#include "glib-utils.h"
#include "file-utils.h"
-#include "file-data.h"
+#include "fr-file-data.h"
-G_DEFINE_BOXED_TYPE(FileData, file_data, file_data_copy, file_data_free)
+G_DEFINE_BOXED_TYPE(FrFileData, fr_file_data, fr_file_data_copy, fr_file_data_free)
-FileData *
-file_data_new (void)
+FrFileData *
+fr_file_data_new (void)
{
- FileData *fdata;
+ FrFileData *fdata;
- fdata = g_new0 (FileData, 1);
+ fdata = g_new0 (FrFileData, 1);
fdata->content_type = NULL;
fdata->free_original_path = FALSE;
fdata->dir_size = 0;
@@ -45,7 +45,7 @@ file_data_new (void)
void
-file_data_free (FileData *fdata)
+fr_file_data_free (FrFileData *fdata)
{
if (fdata == NULL)
return;
@@ -62,12 +62,12 @@ file_data_free (FileData *fdata)
}
-FileData *
-file_data_copy (FileData *src)
+FrFileData *
+fr_file_data_copy (FrFileData *src)
{
- FileData *fdata;
+ FrFileData *fdata;
- fdata = g_new0 (FileData, 1);
+ fdata = g_new0 (FrFileData, 1);
fdata->original_path = g_strdup (src->original_path);
fdata->free_original_path = TRUE;
@@ -92,7 +92,7 @@ file_data_copy (FileData *src)
void
-file_data_update_content_type (FileData *fdata)
+fr_file_data_update_content_type (FrFileData *fdata)
{
g_free (fdata->content_type);
@@ -104,14 +104,14 @@ file_data_update_content_type (FileData *fdata)
gboolean
-file_data_is_dir (FileData *fdata)
+fr_file_data_is_dir (FrFileData *fdata)
{
return fdata->dir || fdata->list_dir;
}
void
-file_data_set_list_name (FileData *fdata,
+fr_file_data_set_list_name (FrFileData *fdata,
const char *value)
{
g_free (fdata->list_name);
@@ -126,23 +126,23 @@ file_data_set_list_name (FileData *fdata,
int
-file_data_compare_by_path (gconstpointer a,
+fr_file_data_compare_by_path (gconstpointer a,
gconstpointer b)
{
- FileData *data_a = *((FileData **) a);
- FileData *data_b = *((FileData **) b);
+ FrFileData *data_a = *((FrFileData **) a);
+ FrFileData *data_b = *((FrFileData **) b);
return strcmp (data_a->full_path, data_b->full_path);
}
int
-find_path_in_file_data_array (GPtrArray *array,
+fr_find_path_in_file_data_array (GPtrArray *array,
const char *path)
{
size_t path_l;
int left, right, p, cmp = -1;
- FileData *fd;
+ FrFileData *fd;
if (path == NULL)
return -1;
@@ -152,7 +152,7 @@ find_path_in_file_data_array (GPtrArray *array,
right = array->len;
while (left < right) {
p = left + ((right - left) / 2);
- fd = (FileData *) g_ptr_array_index (array, p);
+ fd = (FrFileData *) g_ptr_array_index (array, p);
cmp = strcmp (path, fd->original_path);
if (cmp != 0) {
diff --git a/src/file-data.h b/src/fr-file-data.h
similarity index 67%
rename from src/file-data.h
rename to src/fr-file-data.h
index f1440c51..60505ff6 100644
--- a/src/file-data.h
+++ b/src/fr-file-data.h
@@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef FILE_DATA_H
-#define FILE_DATA_H
+#ifndef FR_FILE_DATA_H
+#define FR_FILE_DATA_H
#include <glib.h>
#include <glib-object.h>
@@ -51,21 +51,18 @@ typedef struct {
/* Private data */
gboolean free_original_path;
-} FileData;
+} FrFileData;
-#define FR_TYPE_FILE_DATA (file_data_get_type ())
+#define FR_TYPE_FILE_DATA (fr_file_data_get_type ())
-GType file_data_get_type (void);
-FileData * file_data_new (void);
-FileData * file_data_copy (FileData *src);
-void file_data_free (FileData *fdata);
-void file_data_update_content_type (FileData *fdata);
-gboolean file_data_is_dir (FileData *fdata);
-void file_data_set_list_name (FileData *fdata,
- const char *value);
-int file_data_compare_by_path (gconstpointer a,
- gconstpointer b);
-int find_path_in_file_data_array (GPtrArray *array,
- const char *path);
+GType fr_file_data_get_type (void);
+FrFileData *fr_file_data_new (void);
+FrFileData *fr_file_data_copy (FrFileData *src);
+void fr_file_data_free (FrFileData *fdata);
+void fr_file_data_update_content_type (FrFileData *fdata);
+gboolean fr_file_data_is_dir (FrFileData *fdata);
+void fr_file_data_set_list_name (FrFileData *fdata, const char *value);
+int fr_file_data_compare_by_path (gconstpointer a, gconstpointer b);
+int fr_find_path_in_file_data_array (GPtrArray *array, const char *path);
-#endif /* FILE_DATA_H */
+#endif /* FR_FILE_DATA_H */
diff --git a/src/fr-init.c b/src/fr-init.c
index dd3c3e99..a04812bf 100644
--- a/src/fr-init.c
+++ b/src/fr-init.c
@@ -22,7 +22,7 @@
#include <config.h>
#include <stdlib.h>
#include <glib/gi18n.h>
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#if ENABLE_LIBARCHIVE
diff --git a/src/fr-list-model.c b/src/fr-list-model.c
index e520f55f..b7947969 100644
--- a/src/fr-list-model.c
+++ b/src/fr-list-model.c
@@ -57,7 +57,7 @@ fr_list_model_multi_row_draggable (EggTreeMultiDragSource *drag_source,
GtkTreeRowReference *reference = scan->data;
GtkTreePath *path;
GtkTreeIter iter;
- FileData *fdata;
+ FrFileData *fdata;
path = gtk_tree_row_reference_get_path (reference);
if (path == NULL)
diff --git a/src/fr-window.c b/src/fr-window.c
index 8b2470bb..b18fb53f 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -48,7 +48,7 @@
#include "fr-new-archive-dialog.h"
#include "fr-window.h"
#include "fr-window-actions-entries.h"
-#include "file-data.h"
+#include "fr-file-data.h"
#include "file-utils.h"
#include "glib-utils.h"
#include "gth-icon-cache.h"
@@ -954,7 +954,7 @@ fr_window_dir_exists_in_archive (FrWindow *window,
return TRUE;
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
if (strncmp (dir_name, fdata->full_path, dir_name_len) == 0) {
return TRUE;
@@ -1067,12 +1067,12 @@ check_whether_has_a_dir (GtkTreeModel *model,
gpointer data)
{
gboolean *has_a_dir = data;
- FileData *fdata;
+ FrFileData *fdata;
gtk_tree_model_get (model, iter,
COLUMN_FILE_DATA, &fdata,
-1);
- if (file_data_is_dir (fdata))
+ if (fr_file_data_is_dir (fdata))
*has_a_dir = TRUE;
}
@@ -1201,7 +1201,7 @@ fr_window_get_current_dir_list (FrWindow *window)
files = g_ptr_array_sized_new (128);
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
if (fdata->list_name == NULL)
continue;
@@ -1255,7 +1255,7 @@ get_dir_size (FrWindow *window,
size = 0;
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fd = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fd = g_ptr_array_index (window->archive->files, i);
if (strncmp (dirname, fd->full_path, dirname_l) == 0)
size += fd->size;
@@ -1270,7 +1270,7 @@ get_dir_size (FrWindow *window,
static gboolean
file_data_respects_filter (FrWindow *window,
GRegex *filter,
- FileData *fdata)
+ FrFileData *fdata)
{
if ((fdata == NULL) || (filter == NULL))
return TRUE;
@@ -1285,7 +1285,7 @@ file_data_respects_filter (FrWindow *window,
static gboolean
compute_file_list_name (FrWindow *window,
GRegex *filter,
- FileData *fdata,
+ FrFileData *fdata,
const char *current_dir,
size_t current_dir_len,
GHashTable *names_hash,
@@ -1300,7 +1300,7 @@ compute_file_list_name (FrWindow *window,
return FALSE;
if (private->list_mode == FR_WINDOW_LIST_MODE_FLAT) {
- file_data_set_list_name (fdata, fdata->name);
+ fr_file_data_set_list_name (fdata, fdata->name);
if (fdata->dir)
fdata->dir_size = 0;
return FALSE;
@@ -1317,7 +1317,7 @@ compute_file_list_name (FrWindow *window,
scan = fdata->full_path + current_dir_len;
end = strchr (scan, '/');
if ((end == NULL) && ! fdata->dir) { /* file */
- file_data_set_list_name (fdata, scan);
+ fr_file_data_set_list_name (fdata, scan);
}
else { /* folder */
char *dir_name;
@@ -1336,7 +1336,7 @@ compute_file_list_name (FrWindow *window,
if ((end != NULL) && (*(end + 1) != '\0'))
fdata->list_dir = TRUE;
- file_data_set_list_name (fdata, dir_name);
+ fr_file_data_set_list_name (fdata, dir_name);
fdata->dir_size = get_dir_size (window, current_dir, dir_name);
}
@@ -1387,9 +1387,9 @@ fr_window_compute_list_names (FrWindow *window,
filter = _fr_window_create_filter (window);
for (guint i = 0; i < files->len; i++) {
- FileData *fdata = g_ptr_array_index (files, i);
+ FrFileData *fdata = g_ptr_array_index (files, i);
- file_data_set_list_name (fdata, NULL);
+ fr_file_data_set_list_name (fdata, NULL);
fdata->list_dir = FALSE;
/* the files array is sorted by path, when the visible list
@@ -1460,7 +1460,7 @@ get_mime_type_icon (FrWindow *window,
static GdkPixbuf *
get_icon (FrWindow *window,
- FileData *fdata)
+ FrFileData *fdata)
{
FrWindowPrivate *private = fr_window_get_instance_private (window);
GIcon *icon = NULL;
@@ -1471,7 +1471,7 @@ get_icon (FrWindow *window,
else {
const char *content_type;
- if (file_data_is_dir (fdata))
+ if (fr_file_data_is_dir (fdata))
content_type = MIME_TYPE_DIRECTORY;
else
content_type = fdata->content_type;
@@ -1487,7 +1487,7 @@ get_icon (FrWindow *window,
static GdkPixbuf *
get_emblem (FrWindow *window,
- FileData *fdata)
+ FrFileData *fdata)
{
FrWindowPrivate *private = fr_window_get_instance_private (window);
const char *emblem_name;
@@ -1516,7 +1516,7 @@ add_selected_from_list_view (GtkTreeModel *model,
gpointer data)
{
GList **list = data;
- FileData *fdata;
+ FrFileData *fdata;
gtk_tree_model_get (model, iter,
COLUMN_FILE_DATA, &fdata,
@@ -1565,7 +1565,7 @@ fr_window_populate_file_list (FrWindow *window,
0);
for (guint i = 0; i < files->len; i++) {
- FileData *fdata = g_ptr_array_index (files, i);
+ FrFileData *fdata = g_ptr_array_index (files, i);
GtkTreeIter iter;
GdkPixbuf *icon, *emblem;
char *utf8_name;
@@ -1579,7 +1579,7 @@ fr_window_populate_file_list (FrWindow *window,
emblem = get_emblem (window, fdata);
utf8_name = g_filename_display_name (fdata->list_name);
- if (file_data_is_dir (fdata)) {
+ if (fr_file_data_is_dir (fdata)) {
char *utf8_path;
char *tmp;
char *s_size;
@@ -1802,7 +1802,7 @@ fr_window_update_dir_tree (FrWindow *window)
filter = _fr_window_create_filter (window);
dir_cache = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
char *dir;
if (! file_data_respects_filter (window, filter, fdata))
@@ -3335,7 +3335,7 @@ get_dir_list_from_path (FrWindow *window,
dirname = g_strdup (path);
dirname_l = strlen (dirname);
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fd = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fd = g_ptr_array_index (window->archive->files, i);
gboolean matches = FALSE;
#ifdef DEBUG_GET_DIR_LIST_FROM_PATH
@@ -3370,7 +3370,7 @@ get_dir_list_from_path (FrWindow *window,
static GList *
get_dir_list_from_file_data (FrWindow *window,
- FileData *fdata)
+ FrFileData *fdata)
{
char *dirname;
GList *list;
@@ -3407,12 +3407,12 @@ fr_window_get_file_list_selection (FrWindow *window,
list = NULL;
for (scan = selections; scan; scan = scan->next) {
- FileData *fd = scan->data;
+ FrFileData *fd = scan->data;
if (!fd)
continue;
- if (file_data_is_dir (fd)) {
+ if (fr_file_data_is_dir (fd)) {
if (has_dirs != NULL)
*has_dirs = TRUE;
@@ -3493,7 +3493,7 @@ fr_window_get_file_list_from_path_list (FrWindow *window,
GtkTreeRowReference *reference = scan->data;
GtkTreePath *path;
GtkTreeIter iter;
- FileData *fdata;
+ FrFileData *fdata;
path = gtk_tree_row_reference_get_path (reference);
if (path == NULL)
@@ -3511,12 +3511,12 @@ fr_window_get_file_list_from_path_list (FrWindow *window,
list = NULL;
for (scan = selections; scan; scan = scan->next) {
- FileData *fd = scan->data;
+ FrFileData *fd = scan->data;
if (!fd)
continue;
- if (file_data_is_dir (fd)) {
+ if (fr_file_data_is_dir (fd)) {
if (has_dirs != NULL)
*has_dirs = TRUE;
list = g_list_concat (list, get_dir_list_from_file_data (window, fd));
@@ -3544,7 +3544,7 @@ fr_window_get_file_list_pattern (FrWindow *window,
regexps = _g_regexp_split_from_patterns (pattern, G_REGEX_CASELESS);
list = NULL;
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fd = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fd = g_ptr_array_index (window->archive->files, i);
char *utf8_name;
if (fd == NULL)
@@ -3570,7 +3570,7 @@ fr_window_get_file_list (FrWindow *window)
list = NULL;
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fd = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fd = g_ptr_array_index (window->archive->files, i);
list = g_list_prepend (list, g_strdup (fd->original_path));
}
@@ -3647,13 +3647,13 @@ dir_tree_button_press_cb (GtkWidget *widget,
}
-static FileData *
+static FrFileData *
fr_window_get_selected_item_from_file_list (FrWindow *window)
{
FrWindowPrivate *private = fr_window_get_instance_private (window);
GtkTreeSelection *tree_selection;
GList *selection;
- FileData *fdata = NULL;
+ FrFileData *fdata = NULL;
g_return_val_if_fail (window != NULL, NULL);
@@ -3669,7 +3669,7 @@ fr_window_get_selected_item_from_file_list (FrWindow *window)
return NULL;
}
- fdata = file_data_copy (selection->data);
+ fdata = fr_file_data_copy (selection->data);
g_list_free (selection);
return fdata;
@@ -3709,12 +3709,12 @@ fr_window_current_folder_activated (FrWindow *window,
char *dir_path;
if (! from_sidebar) {
- FileData *fdata;
+ FrFileData *fdata;
char *dir_name;
fdata = fr_window_get_selected_item_from_file_list (window);
- if ((fdata == NULL) || ! file_data_is_dir (fdata)) {
- file_data_free (fdata);
+ if ((fdata == NULL) || ! fr_file_data_is_dir (fdata)) {
+ fr_file_data_free (fdata);
return;
}
dir_name = g_strdup (fdata->list_name);
@@ -3723,7 +3723,7 @@ fr_window_current_folder_activated (FrWindow *window,
"/",
NULL);
g_free (dir_name);
- file_data_free (fdata);
+ fr_file_data_free (fdata);
}
else
dir_path = fr_window_get_selected_folder_in_tree_view (window);
@@ -3742,7 +3742,7 @@ row_activated_cb (GtkTreeView *tree_view,
{
FrWindow *window = data;
FrWindowPrivate *private = fr_window_get_instance_private (window);
- FileData *fdata;
+ FrFileData *fdata;
GtkTreeIter iter;
if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (private->list_store),
@@ -3754,7 +3754,7 @@ row_activated_cb (GtkTreeView *tree_view,
COLUMN_FILE_DATA, &fdata,
-1);
- if (! file_data_is_dir (fdata)) {
+ if (! fr_file_data_is_dir (fdata)) {
GList *list = g_list_prepend (NULL, fdata->original_path);
fr_window_open_files (window, list, FALSE);
g_list_free (list);
@@ -5167,8 +5167,8 @@ name_column_sort_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- FileData *fdata1;
- FileData *fdata2;
+ FrFileData *fdata1;
+ FrFileData *fdata2;
GtkSortType sort_order;
int result;
@@ -5177,11 +5177,11 @@ name_column_sort_func (GtkTreeModel *model,
gtk_tree_model_get (model, a, COLUMN_FILE_DATA, &fdata1, -1);
gtk_tree_model_get (model, b, COLUMN_FILE_DATA, &fdata2, -1);
- if (file_data_is_dir (fdata1) == file_data_is_dir (fdata2)) {
+ if (fr_file_data_is_dir (fdata1) == fr_file_data_is_dir (fdata2)) {
result = strcmp (fdata1->sort_key, fdata2->sort_key);
}
else {
- result = file_data_is_dir (fdata1) ? -1 : 1;
+ result = fr_file_data_is_dir (fdata1) ? -1 : 1;
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
}
@@ -5196,8 +5196,8 @@ size_column_sort_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- FileData *fdata1;
- FileData *fdata2;
+ FrFileData *fdata1;
+ FrFileData *fdata2;
GtkSortType sort_order;
int result;
goffset size_difference;
@@ -5207,15 +5207,15 @@ size_column_sort_func (GtkTreeModel *model,
gtk_tree_model_get (model, a, COLUMN_FILE_DATA, &fdata1, -1);
gtk_tree_model_get (model, b, COLUMN_FILE_DATA, &fdata2, -1);
- if (file_data_is_dir (fdata1) == file_data_is_dir (fdata2)) {
- if (file_data_is_dir (fdata1))
+ if (fr_file_data_is_dir (fdata1) == fr_file_data_is_dir (fdata2)) {
+ if (fr_file_data_is_dir (fdata1))
size_difference = fdata1->dir_size - fdata2->dir_size;
else
size_difference = fdata1->size - fdata2->size;
result = (size_difference > 0) - (size_difference < 0);
}
else {
- result = file_data_is_dir (fdata1) ? -1 : 1;
+ result = fr_file_data_is_dir (fdata1) ? -1 : 1;
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
}
@@ -5230,8 +5230,8 @@ type_column_sort_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- FileData *fdata1;
- FileData *fdata2;
+ FrFileData *fdata1;
+ FrFileData *fdata2;
GtkSortType sort_order;
int result;
@@ -5240,8 +5240,8 @@ type_column_sort_func (GtkTreeModel *model,
gtk_tree_model_get (model, a, COLUMN_FILE_DATA, &fdata1, -1);
gtk_tree_model_get (model, b, COLUMN_FILE_DATA, &fdata2, -1);
- if (file_data_is_dir (fdata1) == file_data_is_dir (fdata2)) {
- if (file_data_is_dir (fdata1)) {
+ if (fr_file_data_is_dir (fdata1) == fr_file_data_is_dir (fdata2)) {
+ if (fr_file_data_is_dir (fdata1)) {
result = strcmp (fdata1->sort_key, fdata2->sort_key);
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
@@ -5257,7 +5257,7 @@ type_column_sort_func (GtkTreeModel *model,
}
}
else {
- result = file_data_is_dir (fdata1) ? -1 : 1;
+ result = fr_file_data_is_dir (fdata1) ? -1 : 1;
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
}
@@ -5272,8 +5272,8 @@ time_column_sort_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- FileData *fdata1;
- FileData *fdata2;
+ FrFileData *fdata1;
+ FrFileData *fdata2;
GtkSortType sort_order;
int result;
@@ -5282,8 +5282,8 @@ time_column_sort_func (GtkTreeModel *model,
gtk_tree_model_get (model, a, COLUMN_FILE_DATA, &fdata1, -1);
gtk_tree_model_get (model, b, COLUMN_FILE_DATA, &fdata2, -1);
- if (file_data_is_dir (fdata1) == file_data_is_dir (fdata2)) {
- if (file_data_is_dir (fdata1)) {
+ if (fr_file_data_is_dir (fdata1) == fr_file_data_is_dir (fdata2)) {
+ if (fr_file_data_is_dir (fdata1)) {
result = strcmp (fdata1->sort_key, fdata2->sort_key);
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
@@ -5292,7 +5292,7 @@ time_column_sort_func (GtkTreeModel *model,
result = fdata1->modified - fdata2->modified;
}
else {
- result = file_data_is_dir (fdata1) ? -1 : 1;
+ result = fr_file_data_is_dir (fdata1) ? -1 : 1;
if (sort_order == GTK_SORT_DESCENDING)
result = -1 * result;
}
@@ -5307,8 +5307,8 @@ path_column_sort_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- FileData *fdata1;
- FileData *fdata2;
+ FrFileData *fdata1;
+ FrFileData *fdata2;
char *path1;
char *path2;
int result;
@@ -6517,7 +6517,7 @@ archive_extraction_ready_cb (GObject *source_object,
names_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (guint i = 0; ! stop && (i < window->archive->files->len); i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
char *first_level;
char *second_slash;
@@ -6583,7 +6583,7 @@ _fr_window_archive_extract_from_edata (FrWindow *window,
total_size = 0;
for (scan = edata->file_list; scan; scan = scan->next) {
char *filename = scan->data;
- FileData *file_data;
+ FrFileData *file_data;
file_data = g_hash_table_lookup (window->archive->files_hash, filename);
if (file_data == NULL)
@@ -6853,7 +6853,7 @@ archive_is_encrypted (FrWindow *window,
if (file_list == NULL) {
for (guint i = 0; ! encrypted && i < window->archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
if (fdata->encrypted)
encrypted = TRUE;
@@ -6864,7 +6864,7 @@ archive_is_encrypted (FrWindow *window,
for (scan = file_list; ! encrypted && scan; scan = scan->next) {
char *filename = scan->data;
- FileData *fdata;
+ FrFileData *fdata;
fdata = g_hash_table_lookup (window->archive->files_hash, filename);
g_return_val_if_fail (fdata != NULL, FALSE);
@@ -7029,7 +7029,7 @@ _archive_extraction_generates_a_tarbomb (FrArchive *archive)
names_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
n_toplevel_items = 0;
for (guint i = 0; ! tarbomb && (i < archive->files->len); i++) {
- FileData *fdata = g_ptr_array_index (archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (archive->files, i);
char *second_separator;
char *name = NULL;
gboolean name_created;
@@ -8368,7 +8368,7 @@ name_is_present (FrWindow *window,
new_filename_l = strlen (new_filename);
for (guint i = 0; i < window->archive->files->len; i++) {
- FileData *fdata = g_ptr_array_index (window->archive->files, i);
+ FrFileData *fdata = g_ptr_array_index (window->archive->files, i);
const char *filename = fdata->full_path;
if ((strncmp (filename, new_filename, new_filename_l) == 0)
@@ -8414,13 +8414,13 @@ fr_window_rename_selection (FrWindow *window,
renaming_dir = TRUE;
}
else {
- FileData *selected_item;
+ FrFileData *selected_item;
selected_item = fr_window_get_selected_item_from_file_list (window);
if (selected_item == NULL)
return;
- renaming_dir = file_data_is_dir (selected_item);
+ renaming_dir = fr_file_data_is_dir (selected_item);
dir_in_archive = selected_item->dir && ! selected_item->list_dir;
original_path = g_strdup (selected_item->original_path);
@@ -8441,7 +8441,7 @@ fr_window_rename_selection (FrWindow *window,
old_name = g_strdup (selected_item->name);
}
- file_data_free (selected_item);
+ fr_file_data_free (selected_item);
}
retry__rename_selection:
diff --git a/src/meson.build b/src/meson.build
index d3b279cb..335e1b9b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -12,7 +12,6 @@ source_files = files(
'dlg-prop.c',
'dlg-update.c',
'eggtreemultidnd.c',
- 'file-data.c',
'file-utils.c',
'fr-application.c',
'fr-application-menu.c',
@@ -38,6 +37,7 @@ source_files = files(
'fr-command-zip.c',
'fr-command-zoo.c',
'fr-error.c',
+ 'fr-file-data.c',
'fr-file-selector-dialog.c',
'fr-init.c',
'fr-list-model.c',
@@ -58,7 +58,6 @@ source_files = files(
)
fr_headers = files(
- 'file-data.h',
'fr-application-menu.h',
'fr-application.h',
'fr-archive.h',
@@ -83,6 +82,7 @@ fr_headers = files(
'fr-command-zoo.h',
'fr-command.h',
'fr-error.h',
+ 'fr-file-data.h',
'fr-file-selector-dialog.h',
'fr-init.h',
'fr-list-model.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]