summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2009-01-22 11:25:39 +0100
committerTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2009-01-22 11:25:39 +0100
commit5ff7b4ba55d63e0605a9c9a86aa9b3fec1853ef1 (patch)
treee5d9a8000460b57291efd1c7c3ec427e77ce14ad
parentec197a03893bc59cb1703633a3f68e0e50b9cd24 (diff)
downloadnautilus-gdu-5ff7b4ba55d63e0605a9c9a86aa9b3fec1853ef1.tar.gz
nautilus-gdu-5ff7b4ba55d63e0605a9c9a86aa9b3fec1853ef1.tar.xz
nautilus-gdu-5ff7b4ba55d63e0605a9c9a86aa9b3fec1853ef1.zip
Device (presentable) matching by mounted path
Still missing code for device matching by DK ID or HAL ID - we need proper support in gvfs first.
-rw-r--r--.gitignore4
-rw-r--r--TODO6
-rw-r--r--configure.in5
-rw-r--r--src/Makefile.am7
-rw-r--r--src/nautilus-gdu-window.c120
-rw-r--r--src/nautilus-gdu-window.h37
-rw-r--r--src/nautilus-gdu.c271
-rw-r--r--src/nautilus-gdu.h12
8 files changed, 408 insertions, 54 deletions
diff --git a/.gitignore b/.gitignore
index c6b224b..e1ad8c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,7 @@ stamp-h1
*.lo
*.o
*.la
+
+.cproject
+.project
+Debug/
diff --git a/TODO b/TODO
index bc4cb62..0b76e65 100644
--- a/TODO
+++ b/TODO
@@ -1 +1,7 @@
code.
+
+- handle LUKS encrypted volumes
+
+Ideas:
+ - allow NTFS formatting and popup a PackageKit window when ntfs-3g is not available (shamelessly stolen from gnome-format discussion)
+ - make standalone executable with specification of device to format (either by mountpoint or DeviceKit ID)
diff --git a/configure.in b/configure.in
index 5850d0c..3b4923d 100644
--- a/configure.in
+++ b/configure.in
@@ -7,6 +7,7 @@ AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
GLIB_REQUIRED=2.18.0
@@ -57,6 +58,10 @@ dnl Get nautilus extensions directory
NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
AC_SUBST(NAUTILUS_EXTENSION_DIR)
+dnl WARN_CFLAGS="-Wall -Werror"
+WARN_CFLAGS="-Wall"
+AC_SUBST(WARN_CFLAGS)
+
dnl intltool stuff
AC_PROG_INTLTOOL(0.18)
dnl AM_WITH_NLS
diff --git a/src/Makefile.am b/src/Makefile.am
index ff2a4ed..45137c8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,8 +4,7 @@ INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(top_srcdir) \
-I$(top_builddir) \
- $(WARN_CFLAGS) \
- -Werror \
+ $(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(ALL_CFLAGS) \
-DGDU_API_IS_SUBJECT_TO_CHANGE \
@@ -18,7 +17,9 @@ nautilus_extension_LTLIBRARIES=libnautilus-gdu.la
libnautilus_gdu_la_SOURCES = \
nautilus-gdu.c \
nautilus-gdu.h \
- gnome-disk-utility.c
+ gnome-disk-utility.c \
+ nautilus-gdu-window.c \
+ nautilus-gdu-window.h
libnautilus_gdu_la_LDFLAGS = -module -avoid-version
libnautilus_gdu_la_LIBADD = $(ALL_LIBS)
diff --git a/src/nautilus-gdu-window.c b/src/nautilus-gdu-window.c
new file mode 100644
index 0000000..697ba13
--- /dev/null
+++ b/src/nautilus-gdu-window.c
@@ -0,0 +1,120 @@
+/*
+ * nautilus-gdu-window.c
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Tomas Bzatek <tbzatek@redhat.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h> /* for GETTEXT_PACKAGE */
+#endif
+
+#include "nautilus-gdu.h"
+#include "nautilus-gdu-window.h"
+
+#include <glib/gi18n-lib.h>
+#include <gio/gio.h>
+
+#include <gtk/gtkicontheme.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkmain.h>
+
+#include <gdu/gdu.h>
+#include <gdu-gtk/gdu-gtk.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h> /* for strcmp */
+#include <unistd.h> /* for chdir */
+#include <sys/stat.h>
+
+
+void
+nautilus_gdu_spawn_dialog (GduPresentable *presentable)
+{
+ GtkWidget *dialog;
+ GtkWidget *content_area;
+
+ g_return_if_fail (presentable != NULL);
+ /* TODO: unref presentable when dialog closes */
+
+ dialog = gtk_dialog_new_with_buttons (_("Format disk"), NULL, GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_OK,
+ GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_REJECT,
+ NULL);
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 400);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+ GtkWidget *label;
+ GtkWidget *align;
+ GtkWidget *vbox3;
+ GtkWidget *hbox;
+ GtkWidget *image;
+
+ hbox = gtk_hbox_new (FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, TRUE, 0);
+
+ image = gtk_image_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
+// shell->priv->icon_image = image;
+
+ vbox3 = gtk_vbox_new (FALSE, 0);
+ align = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
+ gtk_container_add (GTK_CONTAINER (align), vbox3);
+ gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
+
+ label = gtk_label_new ("488.8MB FAT File System");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->name_label = label;
+
+ label = gtk_label_new ("cosi cosi");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details1_label = label;
+
+ label = gtk_label_new ("Partition 1 (MSDOS)");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details2_label = label;
+
+ label = gtk_label_new ("/dev/sdb1 mounted as /mnt/flash");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details3_label = label;
+
+
+
+ GduDevice *device;
+ device = gdu_presentable_get_device (presentable);
+ g_print ("nautilus_gdu_spawn_dialog: presentable name '%s', mounted as %s, \n device %s, object_path %s, uuid %s\n",
+ gdu_presentable_get_name (presentable), gdu_device_get_mount_path (device), gdu_device_get_device_file (device),
+ gdu_device_get_object_path (device), gdu_device_id_get_uuid (device));
+ g_object_unref (device);
+
+
+
+
+
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
diff --git a/src/nautilus-gdu-window.h b/src/nautilus-gdu-window.h
new file mode 100644
index 0000000..eb308eb
--- /dev/null
+++ b/src/nautilus-gdu-window.h
@@ -0,0 +1,37 @@
+/*
+ * nautilus-gdu-window.h
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Tomas Bzatek <tbzatek@redhat.com>
+ *
+ */
+
+#ifndef NAUTILUS_GDU_WINDOW_H
+#define NAUTILUS_GDU_WINDOW_H
+
+#include <nautilus-gdu.h>
+#include <gdu/gdu.h>
+
+
+struct _NautilusGduWindowPrivate;
+typedef struct _NautilusGduWindowPrivate NautilusGduWindowPrivate;
+
+void nautilus_gdu_spawn_dialog (GduPresentable *presentable);
+
+#endif
+
diff --git a/src/nautilus-gdu.c b/src/nautilus-gdu.c
index 8b361a9..a0611d0 100644
--- a/src/nautilus-gdu.c
+++ b/src/nautilus-gdu.c
@@ -1,6 +1,6 @@
/*
* nautilus-gdu.c
- *
+ *
* Copyright (C) 2008-2009 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: Tomas Bzatek <tbzatek@redhat.com>
- *
+ *
*/
#ifdef HAVE_CONFIG_H
@@ -26,22 +26,12 @@
#endif
#include "nautilus-gdu.h"
-
-#include <libnautilus-extension/nautilus-menu-provider.h>
+#include "nautilus-gdu-window.h"
#include <glib/gi18n-lib.h>
-#include <gtk/gtkicontheme.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkmain.h>
-
+#include <gio/gio.h>
#include <gdu/gdu.h>
-#include <gdu-gtk/gdu-gtk.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h> /* for strcmp */
-#include <unistd.h> /* for chdir */
-#include <sys/stat.h>
static void nautilus_gdu_instance_init (NautilusGDU *cvs);
@@ -50,23 +40,136 @@ static void nautilus_gdu_class_init (NautilusGDUClass *class);
static GType nautilus_gdu_type = 0;
+
+
+static GduPresentable *
+find_presentable_from_mount_path (char *mount_path)
+{
+ GduPool *pool;
+ GList *presentables, *presentables_w;
+ GduPresentable *presentable = NULL;
+ GduPresentable *pres_w;
+ GduDevice *device;
+ const char *device_mount;
+ GFile *file1, *file2;
+
+ g_return_val_if_fail (mount_path != NULL, NULL);
+ g_return_val_if_fail (strlen (mount_path) > 1, NULL);
+
+ pool = gdu_pool_new ();
+ presentables = gdu_pool_get_presentables (pool);
+
+ presentables_w = presentables;
+ while (presentable == NULL && presentables_w != NULL) {
+ pres_w = presentables_w->data;
+ if (pres_w) {
+ device = gdu_presentable_get_device (pres_w);
+ if (device) {
+ device_mount = gdu_device_get_mount_path (device);
+ if (device_mount && strlen (device_mount) > 1) {
+ g_print ("find_presentable_from_path: found mount '%s', matching with '%s'\n", device_mount, mount_path);
+ /* compare via GFile routines */
+ file1 = g_file_new_for_commandline_arg (mount_path);
+ file2 = g_file_new_for_path (device_mount);
+ if (g_file_equal (file1, file2))
+ presentable = g_object_ref (pres_w);
+ g_object_unref (file1);
+ g_object_unref (file2);
+ }
+ g_object_unref (device);
+ }
+ g_object_unref (pres_w);
+ }
+ presentables_w = g_list_next (presentables_w);
+ }
+
+ if (presentables)
+ g_list_free (presentables);
+ g_object_unref (pool);
+
+ if (presentable)
+ g_print ("find_presentable_from_path: found presentable '%s'\n", gdu_presentable_get_name (presentable));
+ else
+ g_print ("find_presentable_from_path: no presentable found\n");
+
+ return presentable;
+}
+
+/* caller must unref the returned object */
+GduPresentable *
+find_presentable_from_file (NautilusFileInfo *nautilus_file)
+{
+ GduPresentable *presentable = NULL;
+ GFile *file;
+ GFileInfo *info;
+ GError *error;
+ GFileType file_type;
+ char *mount_path = NULL;
+
+ g_return_val_if_fail (nautilus_file != NULL, NULL);
+ file = nautilus_file_info_get_location (nautilus_file);
+ g_return_val_if_fail (file != NULL, NULL);
+ file_type = nautilus_file_info_get_file_type (nautilus_file);
+
+#if 0
+ /* is file native? (not local, but at least locally mounted) */
+ if (! g_file_is_native (file)) {
+ g_object_unref (file);
+ return NULL;
+ }
+#endif
+
+ /* first try to find mount target from a mountable */
+ if (file_type == G_FILE_TYPE_MOUNTABLE || file_type == G_FILE_TYPE_SHORTCUT) {
+ mount_path = nautilus_file_info_get_activation_uri (nautilus_file);
+ if (mount_path == NULL) {
+ error = NULL;
+
+ /* TODO: retrieve HAL/DeviceKit device ID for non-mounted devices */
+ info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, G_FILE_QUERY_INFO_NONE, NULL, &error);
+ if (info) {
+ mount_path = g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
+ g_object_unref (info);
+ }
+ if (error) {
+ g_warning ("unable to query info: %s\n", error->message);
+ g_clear_error (&error);
+ }
+ }
+ }
+
+ /* try to guess mount from a path (e.g. /media/disk) */
+ if (mount_path == NULL && file_type == G_FILE_TYPE_DIRECTORY) {
+ error = NULL;
+ info = g_file_query_info (file, G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT, G_FILE_QUERY_INFO_NONE, NULL, &error);
+ if (info) {
+ if (g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT))
+ mount_path = g_file_get_path (file);
+ g_object_unref (info);
+ }
+ if (error) {
+ g_warning ("unable to query info: %s\n", error->message);
+ g_clear_error (&error);
+ }
+ }
+
+ if (mount_path) {
+ presentable = find_presentable_from_mount_path (mount_path);
+ g_free (mount_path);
+ }
+ g_object_unref (file);
+
+ return presentable;
+}
+
+
static void
format_callback (NautilusMenuItem *item,
- NautilusFileInfo *file_info)
+ GduPresentable *presentable)
{
- GtkWidget *dialog;
-
- g_print ("format_callback\n");
-
- dialog = gtk_dialog_new_with_buttons (_("Format disk"), NULL, GTK_DIALOG_NO_SEPARATOR,
- GTK_STOCK_OK,
- GTK_RESPONSE_ACCEPT,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_REJECT,
- NULL);
- gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 400);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ g_return_if_fail (GDU_IS_PRESENTABLE (presentable));
+
+ nautilus_gdu_spawn_dialog (presentable);
}
static GList *
@@ -74,20 +177,9 @@ nautilus_gdu_get_background_items (NautilusMenuProvider *provider,
GtkWidget *window,
NautilusFileInfo *file_info)
{
- NautilusMenuItem *item;
-
g_print ("nautilus_gdu_get_background_items\n");
-
- item = nautilus_menu_item_new ("NautilusGDU::format", _("_Format..."), _("Open dummy dialog"), "palimpsest");
- g_object_set_data (G_OBJECT (item), "NautilusGDU::screen", gtk_widget_get_screen (window));
- g_object_set_data_full (G_OBJECT (item), "file-info",
- g_object_ref (file_info),
- (GDestroyNotify) g_object_unref);
- g_signal_connect (item, "activate",
- G_CALLBACK (format_callback),
- file_info);
-
- return g_list_append (NULL, item);
+ /* not used */
+ return NULL;
}
GList *
@@ -96,22 +188,102 @@ nautilus_gdu_get_file_items (NautilusMenuProvider *provider,
GList *files)
{
NautilusMenuItem *item;
+ GTimeVal start_time, stop_time;
- g_print ("nautilus_gdu_get_file_items\n");
+ g_get_current_time (&start_time);
- if (g_list_length (files) != 1 /* ||
- nautilus_file_info_get_file_type (files->data) != G_FILE_TYPE_MOUNTABLE */ ) {
+ if (g_list_length (files) != 1) {
return NULL;
}
+
+#if 0
+ g_print ("nautilus_gdu_get_file_items: item[0] uri '%s', type = %d, activation_uri '%s', name '%s'\n",
+ nautilus_file_info_get_uri (files->data),
+ nautilus_file_info_get_file_type (files->data),
+ nautilus_file_info_get_activation_uri (files->data),
+ nautilus_file_info_get_name (files->data));
+
+ GError *error = NULL;
+ GMount *mount;
+ mount = g_file_find_enclosing_mount (nautilus_file_info_get_location(files->data), NULL, &error);
+ g_print ("nautilus_gdu_get_file_items: mount = %p\n", mount);
+ if (error) {
+ g_print ("nautilus_gdu_get_file_items: error = %s\n", error->message);
+ }
+
+ GFileInfo *info;
+
+ error = NULL;
+ info = g_file_query_info (nautilus_file_info_get_location (files->data),
+ G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "," G_FILE_ATTRIBUTE_ID_FILE ","
+ G_FILE_ATTRIBUTE_ID_FILESYSTEM "," G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE ","
+ G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "," G_FILE_ATTRIBUTE_UNIX_DEVICE ","
+ G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT, G_FILE_QUERY_INFO_NONE, NULL, &error);
+ if (info) {
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_STANDARD_TARGET_URI = %s\n", g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_ID_FILE = %s\n", g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_ID_FILE));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_ID_FILESYSTEM = %s\n", g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_ID_FILESYSTEM));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE = %d\n", g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI = %s\n", g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_UNIX_DEVICE = %d\n", g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_DEVICE));
+ g_print ("nautilus_gdu_get_file_items: G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT = %d\n", g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT));
+ }
+ if (error) {
+ g_print ("nautilus_gdu_get_file_items: error = %s\n", error->message);
+ }
+
+
+ /* GDU stuff */
+ GduPool *pool;
+ GList *presentables;
+ GduPresentable *presentable;
+ GduDevice *device;
+
+ pool = gdu_pool_new ();
+ presentables = gdu_pool_get_presentables (pool);
+
+
+
+ while (presentables != NULL) {
+ presentable = presentables->data;
+ device = gdu_presentable_get_device (presentable);
+ g_print ("nautilus_gdu_get_file_items: found presentable name '%s', mounted as %s, \n device %s, object_path %s, uuid %s\n",
+ gdu_presentable_get_name (presentable), gdu_device_get_mount_path (device), gdu_device_get_device_file (device),
+ gdu_device_get_object_path (device), gdu_device_id_get_uuid (device));
+ g_object_unref (device);
+ g_object_unref (presentable);
+ presentables = g_list_next (presentables);
+ }
+
+
+ if (presentables)
+ g_list_free (presentables);
+ g_object_unref (pool);
+
+#else
+ GduPresentable *presentable;
+#endif
+
+
+ presentable = find_presentable_from_file (files->data);
+
+ g_get_current_time (&stop_time);
+ g_print ("I spent %ld ms searching for DK presentable\n", (stop_time.tv_sec - start_time.tv_sec) * 1000 + (stop_time.tv_usec - start_time.tv_usec) / 1000);
+
+ if (! presentable)
+ return NULL;
+
item = nautilus_menu_item_new ("NautilusGDU::format", _("_Format..."), _("Open dummy dialog"), "palimpsest");
- g_object_set_data (G_OBJECT (item), "NautilusGDU::screen", gtk_widget_get_screen (window));
+// g_object_set_data (G_OBJECT (item), "NautilusGDU::screen", gtk_widget_get_screen (window));
+/*
g_object_set_data_full (G_OBJECT (item), "file-info",
g_object_ref (files->data),
(GDestroyNotify) g_object_unref);
+*/
g_signal_connect (item, "activate",
G_CALLBACK (format_callback),
- files->data);
+ presentable);
return g_list_append (NULL, item);
}
@@ -123,6 +295,7 @@ nautilus_gdu_get_toolbar_items (NautilusMenuProvider *provider,
NautilusFileInfo *current_folder)
{
g_print ("nautilus_gdu_get_toolbar_items\n");
+ /* not used */
return NULL;
}
@@ -135,7 +308,7 @@ nautilus_gdu_menu_provider_iface_init (NautilusMenuProviderIface *iface)
iface->get_toolbar_items = nautilus_gdu_get_toolbar_items;
}
-static void
+static void
nautilus_gdu_instance_init (NautilusGDU *cvs)
{
}
@@ -146,7 +319,7 @@ nautilus_gdu_class_init (NautilusGDUClass *class)
}
GType
-nautilus_gdu_get_type (void)
+nautilus_gdu_get_type (void)
{
return nautilus_gdu_type;
}
@@ -159,7 +332,7 @@ nautilus_gdu_register_type (GTypeModule *module)
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) nautilus_gdu_class_init,
- NULL,
+ NULL,
NULL,
sizeof (NautilusGDU),
0,
diff --git a/src/nautilus-gdu.h b/src/nautilus-gdu.h
index 1f02bf8..86490dd 100644
--- a/src/nautilus-gdu.h
+++ b/src/nautilus-gdu.h
@@ -1,6 +1,6 @@
/*
* nautilus-gdu.h
- *
+ *
* Copyright (C) 2008-2009 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -18,13 +18,15 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: Tomas Bzatek <tbzatek@redhat.com>
- *
+ *
*/
#ifndef NAUTILUS_GDU_H
#define NAUTILUS_GDU_H
#include <glib-object.h>
+#include <libnautilus-extension/nautilus-menu-provider.h>
+#include <gdu/gdu.h>
G_BEGIN_DECLS
@@ -45,6 +47,12 @@ struct _NautilusGDUClass {
GType nautilus_gdu_get_type (void);
void nautilus_gdu_register_type (GTypeModule *module);
+
+/* caller must unref the returned object */
+GduPresentable* find_presentable_from_file (NautilusFileInfo *nautilus_file);
+
+
+
G_END_DECLS
#endif