[nautilus/freedesktop-dbus: 7/9] Implement ShowFolders()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/freedesktop-dbus: 7/9] Implement ShowFolders()
- Date: Tue, 6 Dec 2011 23:48:25 +0000 (UTC)
commit 5f3b0071d11cc864d135f35b7b85b07a5395f97a
Author: Akshay Gupta <kitallis gmail com>
Date: Tue Dec 6 15:12:27 2011 -0600
Implement ShowFolders()
NautilusApplication doesn't make a distinction between showing files
and showing folders, so for now we'll use the same implementation.
src/nautilus-freedesktop-dbus.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index 99c1bea..dde3d6c 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -72,6 +72,37 @@ skeleton_handle_show_items_cb (NautilusFreedesktopFileManager1 *object,
return TRUE;
}
+static gboolean
+skeleton_handle_show_folders_cb (NautilusFreedesktopFileManager1 *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *const *uris,
+ const gchar *startup_id)
+{
+ /* FIXME: NautilusApplication makes no distinction between showing
+ * files vs. folders. For now we will just use the same
+ * implementation.
+ */
+
+ int i;
+
+ for (i = 0; uris[i] != NULL; i++) {
+ GFile *file;
+ GFile *files[1];
+
+ file = g_file_new_for_uri (uris[i]);
+ files[0] = file;
+
+ /* FIXME: we are not using the startup_id. This is not
+ * what g_application_open() expects, and neither does
+ * NautilusApplication internally.
+ */
+ g_application_open (G_APPLICATION (application), files, 1, "");
+ g_object_unref (file);
+ }
+
+ nautilus_freedesktop_file_manager1_complete_show_folders (object, invocation);
+ return TRUE;
+}
static void
bus_acquired_cb (GDBusConnection *conn,
@@ -87,6 +118,8 @@ bus_acquired_cb (GDBusConnection *conn,
g_signal_connect (skeleton, "handle-show-items",
G_CALLBACK (skeleton_handle_show_items_cb), NULL);
+ g_signal_connect (skeleton, "handle-show-folders",
+ G_CALLBACK (skeleton_handle_show_folders_cb), NULL);
g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (skeleton), connection, "/org/freedesktop/FileManager1", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]