[nautilus/wip/muktupavels/delete: 2/2] dbus-manager: clarify CreateFolder method
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/muktupavels/delete: 2/2] dbus-manager: clarify CreateFolder method
- Date: Mon, 6 Apr 2020 13:58:47 +0000 (UTC)
commit 067e1a5e1d02305d3f4b01052db10306f299c57d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Apr 6 16:49:01 2020 +0300
dbus-manager: clarify CreateFolder method
https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/504
data/dbus-interfaces2.xml | 3 ++-
src/nautilus-dbus-manager.c | 32 +++++++++++++++++---------------
2 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/data/dbus-interfaces2.xml b/data/dbus-interfaces2.xml
index 8bd24bbdd..8216be006 100644
--- a/data/dbus-interfaces2.xml
+++ b/data/dbus-interfaces2.xml
@@ -62,7 +62,8 @@
<arg type='a{sv}' name='platform_data' direction='in'/>
</method>
<method name='CreateFolder'>
- <arg type='s' name='uri' direction='in'/>
+ <arg type='s' name='parent_uri' direction='in'/>
+ <arg type='s' name='new_folder_name' direction='in'/>
<arg type='a{sv}' name='platform_data' direction='in'/>
</method>
<method name='RenameURI'>
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c
index 56213268b..6736205d1 100644
--- a/src/nautilus-dbus-manager.c
+++ b/src/nautilus-dbus-manager.c
@@ -164,22 +164,13 @@ create_folder_on_finished (GFile *new_file,
}
static void
-handle_create_folder_internal (const char *uri,
+handle_create_folder_internal (const gchar *parent_uri,
+ const gchar *new_folder_name,
NautilusFileOperationsDBusData *dbus_data)
{
- g_autoptr (GFile) file = NULL;
- g_autoptr (GFile) parent_file = NULL;
- g_autofree gchar *basename = NULL;
- g_autofree gchar *parent_file_uri = NULL;
-
- file = g_file_new_for_uri (uri);
- basename = g_file_get_basename (file);
- parent_file = g_file_get_parent (file);
- parent_file_uri = g_file_get_uri (parent_file);
-
g_application_hold (g_application_get_default ());
nautilus_file_operations_new_folder (NULL, dbus_data,
- parent_file_uri, basename,
+ parent_uri, new_folder_name,
create_folder_on_finished, NULL);
}
@@ -188,7 +179,17 @@ handle_create_folder (NautilusDBusFileOperations *object,
GDBusMethodInvocation *invocation,
const gchar *uri)
{
- handle_create_folder_internal (uri, NULL);
+ g_autoptr (GFile) file = NULL;
+ g_autoptr (GFile) parent_file = NULL;
+ g_autofree gchar *basename = NULL;
+ g_autofree gchar *parent_file_uri = NULL;
+
+ file = g_file_new_for_uri (uri);
+ basename = g_file_get_basename (file);
+ parent_file = g_file_get_parent (file);
+ parent_file_uri = g_file_get_uri (parent_file);
+
+ handle_create_folder_internal (parent_file_uri, basename, NULL);
nautilus_dbus_file_operations_complete_create_folder (object, invocation);
return TRUE; /* invocation was handled */
@@ -197,14 +198,15 @@ handle_create_folder (NautilusDBusFileOperations *object,
static gboolean
handle_create_folder2 (NautilusDBusFileOperations2 *object,
GDBusMethodInvocation *invocation,
- const gchar *uri,
+ const gchar *parent_uri,
+ const gchar *new_folder_name,
GVariant *platform_data)
{
g_autoptr (NautilusFileOperationsDBusData) dbus_data = NULL;
dbus_data = nautilus_file_operations_dbus_data_new (platform_data);
- handle_create_folder_internal (uri, dbus_data);
+ handle_create_folder_internal (parent_uri, new_folder_name, dbus_data);
nautilus_dbus_file_operations2_complete_create_folder (object, invocation);
return TRUE; /* invocation was handled */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]