diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-08-29 18:24:05 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-08-29 18:37:10 +0200 |
commit | 52d960542b4d5fdf2bd06735d0dbf7934cf2ec12 (patch) | |
tree | 5e000d5ed40b52b003c02b597e51ae0b87ff22ac /src/nautilus-dbus-manager.c | |
parent | 4cafccd82859a4ee0bdfad3e31a310f2d94c0485 (diff) | |
download | nautilus-52d960542b4d5fdf2bd06735d0dbf7934cf2ec12.tar.gz |
general: run uncrustify
And make the style of Nautilus the same for all files.
Hopefully we can fix all the style issues we can find in the next days,
so expect a little of movement on this.
https://bugzilla.gnome.org/show_bug.cgi?id=770564
Diffstat (limited to 'src/nautilus-dbus-manager.c')
-rw-r--r-- | src/nautilus-dbus-manager.c | 161 |
1 files changed, 85 insertions, 76 deletions
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c index 847afb577..77d00d615 100644 --- a/src/nautilus-dbus-manager.c +++ b/src/nautilus-dbus-manager.c @@ -32,14 +32,16 @@ #include <gio/gio.h> -struct _NautilusDBusManager { - GObject parent; +struct _NautilusDBusManager +{ + GObject parent; - NautilusDBusFileOperations *file_operations; + NautilusDBusFileOperations *file_operations; }; -struct _NautilusDBusManagerClass { - GObjectClass parent_class; +struct _NautilusDBusManagerClass +{ + GObjectClass parent_class; }; G_DEFINE_TYPE (NautilusDBusManager, nautilus_dbus_manager, G_TYPE_OBJECT); @@ -47,128 +49,135 @@ G_DEFINE_TYPE (NautilusDBusManager, nautilus_dbus_manager, G_TYPE_OBJECT); static void nautilus_dbus_manager_dispose (GObject *object) { - NautilusDBusManager *self = (NautilusDBusManager *) object; + NautilusDBusManager *self = (NautilusDBusManager *) object; - if (self->file_operations) { - g_object_unref (self->file_operations); - self->file_operations = NULL; - } + if (self->file_operations) + { + g_object_unref (self->file_operations); + self->file_operations = NULL; + } - G_OBJECT_CLASS (nautilus_dbus_manager_parent_class)->dispose (object); + G_OBJECT_CLASS (nautilus_dbus_manager_parent_class)->dispose (object); } static gboolean handle_copy_file (NautilusDBusFileOperations *object, - GDBusMethodInvocation *invocation, - const gchar *source_uri, - const gchar *source_display_name, - const gchar *dest_dir_uri, - const gchar *dest_name) + GDBusMethodInvocation *invocation, + const gchar *source_uri, + const gchar *source_display_name, + const gchar *dest_dir_uri, + const gchar *dest_name) { - GFile *source_file, *target_dir; - const gchar *target_name = NULL, *source_name = NULL; + GFile *source_file, *target_dir; + const gchar *target_name = NULL, *source_name = NULL; - source_file = g_file_new_for_uri (source_uri); - target_dir = g_file_new_for_uri (dest_dir_uri); + source_file = g_file_new_for_uri (source_uri); + target_dir = g_file_new_for_uri (dest_dir_uri); - if (dest_name != NULL && dest_name[0] != '\0') - target_name = dest_name; + if (dest_name != NULL && dest_name[0] != '\0') + { + target_name = dest_name; + } - if (source_display_name != NULL && source_display_name[0] != '\0') - source_name = source_display_name; + if (source_display_name != NULL && source_display_name[0] != '\0') + { + source_name = source_display_name; + } - nautilus_file_operations_copy_file (source_file, target_dir, source_name, target_name, - NULL, NULL, NULL); + nautilus_file_operations_copy_file (source_file, target_dir, source_name, target_name, + NULL, NULL, NULL); - g_object_unref (source_file); - g_object_unref (target_dir); + g_object_unref (source_file); + g_object_unref (target_dir); - nautilus_dbus_file_operations_complete_copy_file (object, invocation); - return TRUE; /* invocation was handled */ + nautilus_dbus_file_operations_complete_copy_file (object, invocation); + return TRUE; /* invocation was handled */ } static gboolean -handle_copy_uris (NautilusDBusFileOperations *object, - GDBusMethodInvocation *invocation, - const gchar **sources, - const gchar *destination) +handle_copy_uris (NautilusDBusFileOperations *object, + GDBusMethodInvocation *invocation, + const gchar **sources, + const gchar *destination) { - GList *source_files = NULL; - GFile *dest_dir; - gint idx; + GList *source_files = NULL; + GFile *dest_dir; + gint idx; - dest_dir = g_file_new_for_uri (destination); + dest_dir = g_file_new_for_uri (destination); - for (idx = 0; sources[idx] != NULL; idx++) - source_files = g_list_prepend (source_files, - g_file_new_for_uri (sources[idx])); + for (idx = 0; sources[idx] != NULL; idx++) + { + source_files = g_list_prepend (source_files, + g_file_new_for_uri (sources[idx])); + } - nautilus_file_operations_copy (source_files, NULL, - dest_dir, - NULL, NULL, NULL); + nautilus_file_operations_copy (source_files, NULL, + dest_dir, + NULL, NULL, NULL); - g_list_free_full (source_files, g_object_unref); - g_object_unref (dest_dir); + g_list_free_full (source_files, g_object_unref); + g_object_unref (dest_dir); - nautilus_dbus_file_operations_complete_copy_uris (object, invocation); - return TRUE; /* invocation was handled */ + nautilus_dbus_file_operations_complete_copy_uris (object, invocation); + return TRUE; /* invocation was handled */ } static gboolean handle_empty_trash (NautilusDBusFileOperations *object, - GDBusMethodInvocation *invocation) + GDBusMethodInvocation *invocation) { - nautilus_file_operations_empty_trash (NULL); + nautilus_file_operations_empty_trash (NULL); - nautilus_dbus_file_operations_complete_empty_trash (object, invocation); - return TRUE; /* invocation was handled */ + nautilus_dbus_file_operations_complete_empty_trash (object, invocation); + return TRUE; /* invocation was handled */ } static void nautilus_dbus_manager_init (NautilusDBusManager *self) { - self->file_operations = nautilus_dbus_file_operations_skeleton_new (); - - g_signal_connect (self->file_operations, - "handle-copy-uris", - G_CALLBACK (handle_copy_uris), - self); - g_signal_connect (self->file_operations, - "handle-copy-file", - G_CALLBACK (handle_copy_file), - self); - g_signal_connect (self->file_operations, - "handle-empty-trash", - G_CALLBACK (handle_empty_trash), - self); + self->file_operations = nautilus_dbus_file_operations_skeleton_new (); + + g_signal_connect (self->file_operations, + "handle-copy-uris", + G_CALLBACK (handle_copy_uris), + self); + g_signal_connect (self->file_operations, + "handle-copy-file", + G_CALLBACK (handle_copy_file), + self); + g_signal_connect (self->file_operations, + "handle-empty-trash", + G_CALLBACK (handle_empty_trash), + self); } static void nautilus_dbus_manager_class_init (NautilusDBusManagerClass *klass) { - GObjectClass *oclass = G_OBJECT_CLASS (klass); + GObjectClass *oclass = G_OBJECT_CLASS (klass); - oclass->dispose = nautilus_dbus_manager_dispose; + oclass->dispose = nautilus_dbus_manager_dispose; } NautilusDBusManager * nautilus_dbus_manager_new (void) { - return g_object_new (nautilus_dbus_manager_get_type (), - NULL); + return g_object_new (nautilus_dbus_manager_get_type (), + NULL); } gboolean -nautilus_dbus_manager_register (NautilusDBusManager *self, - GDBusConnection *connection, - GError **error) +nautilus_dbus_manager_register (NautilusDBusManager *self, + GDBusConnection *connection, + GError **error) { - return g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self->file_operations), - connection, "/org/gnome/Nautilus", error); + return g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self->file_operations), + connection, "/org/gnome/Nautilus", error); } void nautilus_dbus_manager_unregister (NautilusDBusManager *self) { - g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (self->file_operations)); + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (self->file_operations)); } |