[nautilus/wip/antoniof/try-admin-backend-for-file-ops: 8/11] file-operations: Move job structs to private header




commit 73579b709e26cb5477811980665f4aa06802b90b
Author: António Fernandes <antoniof gnome org>
Date:   Fri Oct 15 23:44:33 2021 +0100

    file-operations: Move job structs to private header
    
    To be usable from a separate file for admin operations.

 src/meson.build                        |   1 +
 src/nautilus-file-operations-private.h | 131 +++++++++++++++++++++++++++++++++
 src/nautilus-file-operations.c         | 122 +-----------------------------
 3 files changed, 133 insertions(+), 121 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 39e0b0370..360832ac9 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -186,6 +186,7 @@ libnautilus_sources = [
   'nautilus-operations-ui-manager.h',
   'nautilus-file-operations.c',
   'nautilus-file-operations.h',
+  'nautilus-file-operations-private.h',
   'nautilus-file-operations-dbus-data.c',
   'nautilus-file-operations-dbus-data.h',
   'nautilus-file-private.h',
diff --git a/src/nautilus-file-operations-private.h b/src/nautilus-file-operations-private.h
new file mode 100644
index 000000000..4aff5aebd
--- /dev/null
+++ b/src/nautilus-file-operations-private.h
@@ -0,0 +1,131 @@
+#pragma once
+
+#include <gtk/gtk.h>
+#include <gio/gio.h>
+#include <gnome-autoar/gnome-autoar.h>
+
+#include "nautilus-file-operations.h"
+#include "nautilus-file-operations-dbus-data.h"
+#include "nautilus-progress-info.h"
+#include "nautilus-file-undo-operations.h"
+
+typedef struct
+{
+    GTimer *time;
+    GtkWindow *parent_window;
+    NautilusFileOperationsDBusData *dbus_data;
+    guint inhibit_cookie;
+    NautilusProgressInfo *progress;
+    GCancellable *cancellable;
+    GHashTable *skip_files;
+    GHashTable *skip_readdir_error;
+    NautilusFileUndoInfo *undo_info;
+    gboolean skip_all_error;
+    gboolean skip_all_conflict;
+    gboolean merge_all;
+    gboolean replace_all;
+    gboolean delete_all;
+} CommonJob;
+
+typedef struct
+{
+    CommonJob common;
+    gboolean is_move;
+    GList *files;
+    GFile *destination;
+    GFile *fake_display_source;
+    GHashTable *debuting_files;
+    gchar *target_name;
+    NautilusCopyCallback done_callback;
+    gpointer done_callback_data;
+} CopyMoveJob;
+
+typedef struct
+{
+    CommonJob common;
+    GList *files;
+    gboolean try_trash;
+    gboolean user_cancel;
+    NautilusDeleteCallback done_callback;
+    gpointer done_callback_data;
+} DeleteJob;
+
+typedef struct
+{
+    CommonJob common;
+    GFile *dest_dir;
+    char *filename;
+    gboolean make_dir;
+    GFile *src;
+    char *src_data;
+    int length;
+    GFile *created_file;
+    NautilusCreateCallback done_callback;
+    gpointer done_callback_data;
+} CreateJob;
+
+
+typedef struct
+{
+    CommonJob common;
+    GList *trash_dirs;
+    gboolean should_confirm;
+    NautilusOpCallback done_callback;
+    gpointer done_callback_data;
+} EmptyTrashJob;
+
+typedef struct
+{
+    CommonJob common;
+    GFile *file;
+    NautilusOpCallback done_callback;
+    gpointer done_callback_data;
+    guint32 file_permissions;
+    guint32 file_mask;
+    guint32 dir_permissions;
+    guint32 dir_mask;
+} SetPermissionsJob;
+
+typedef enum
+{
+    OP_KIND_COPY,
+    OP_KIND_MOVE,
+    OP_KIND_DELETE,
+    OP_KIND_TRASH,
+    OP_KIND_COMPRESS
+} OpKind;
+
+typedef struct
+{
+    CommonJob common;
+    GList *source_files;
+    GFile *destination_directory;
+    GList *output_files;
+
+    gdouble base_progress;
+
+    guint64 archive_compressed_size;
+    guint64 total_compressed_size;
+
+    NautilusExtractCallback done_callback;
+    gpointer done_callback_data;
+} ExtractJob;
+
+typedef struct
+{
+    CommonJob common;
+    GList *source_files;
+    GFile *output_file;
+
+    AutoarFormat format;
+    AutoarFilter filter;
+    gchar *passphrase;
+
+    guint64 total_size;
+    guint total_files;
+
+    gboolean success;
+
+    NautilusCreateCallback done_callback;
+    gpointer done_callback_data;
+} CompressJob;
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 78fb006b2..60b012224 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 
 #include "nautilus-file-operations.h"
+#include "nautilus-file-operations-private.h"
 
 #include "nautilus-file-changes-queue.h"
 #include "nautilus-lib-self-check-functions.h"
@@ -70,92 +71,6 @@
 
 /* TODO: TESTING!!! */
 
-typedef struct
-{
-    GTimer *time;
-    GtkWindow *parent_window;
-    NautilusFileOperationsDBusData *dbus_data;
-    guint inhibit_cookie;
-    NautilusProgressInfo *progress;
-    GCancellable *cancellable;
-    GHashTable *skip_files;
-    GHashTable *skip_readdir_error;
-    NautilusFileUndoInfo *undo_info;
-    gboolean skip_all_error;
-    gboolean skip_all_conflict;
-    gboolean merge_all;
-    gboolean replace_all;
-    gboolean delete_all;
-} CommonJob;
-
-typedef struct
-{
-    CommonJob common;
-    gboolean is_move;
-    GList *files;
-    GFile *destination;
-    GFile *fake_display_source;
-    GHashTable *debuting_files;
-    gchar *target_name;
-    NautilusCopyCallback done_callback;
-    gpointer done_callback_data;
-} CopyMoveJob;
-
-typedef struct
-{
-    CommonJob common;
-    GList *files;
-    gboolean try_trash;
-    gboolean user_cancel;
-    NautilusDeleteCallback done_callback;
-    gpointer done_callback_data;
-} DeleteJob;
-
-typedef struct
-{
-    CommonJob common;
-    GFile *dest_dir;
-    char *filename;
-    gboolean make_dir;
-    GFile *src;
-    char *src_data;
-    int length;
-    GFile *created_file;
-    NautilusCreateCallback done_callback;
-    gpointer done_callback_data;
-} CreateJob;
-
-
-typedef struct
-{
-    CommonJob common;
-    GList *trash_dirs;
-    gboolean should_confirm;
-    NautilusOpCallback done_callback;
-    gpointer done_callback_data;
-} EmptyTrashJob;
-
-typedef struct
-{
-    CommonJob common;
-    GFile *file;
-    NautilusOpCallback done_callback;
-    gpointer done_callback_data;
-    guint32 file_permissions;
-    guint32 file_mask;
-    guint32 dir_permissions;
-    guint32 dir_mask;
-} SetPermissionsJob;
-
-typedef enum
-{
-    OP_KIND_COPY,
-    OP_KIND_MOVE,
-    OP_KIND_DELETE,
-    OP_KIND_TRASH,
-    OP_KIND_COMPRESS
-} OpKind;
-
 typedef struct
 {
     int num_files_children;
@@ -189,41 +104,6 @@ typedef struct
     gboolean partial_progress;
 } TransferInfo;
 
-typedef struct
-{
-    CommonJob common;
-    GList *source_files;
-    GFile *destination_directory;
-    GList *output_files;
-
-    gdouble base_progress;
-
-    guint64 archive_compressed_size;
-    guint64 total_compressed_size;
-
-    NautilusExtractCallback done_callback;
-    gpointer done_callback_data;
-} ExtractJob;
-
-typedef struct
-{
-    CommonJob common;
-    GList *source_files;
-    GFile *output_file;
-
-    AutoarFormat format;
-    AutoarFilter filter;
-    gchar *passphrase;
-
-    guint64 total_size;
-    guint total_files;
-
-    gboolean success;
-
-    NautilusCreateCallback done_callback;
-    gpointer done_callback_data;
-} CompressJob;
-
 static void
 source_info_clear (SourceInfo *source_info)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]