nautilus r15083 - in trunk: . libnautilus-private
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r15083 - in trunk: . libnautilus-private
- Date: Wed, 11 Mar 2009 08:17:48 +0000 (UTC)
Author: alexl
Date: Wed Mar 11 08:17:48 2009
New Revision: 15083
URL: http://svn.gnome.org/viewvc/nautilus?rev=15083&view=rev
Log:
2009-03-11 Alexander Larsson <alexl redhat com>
Bug 529295 â Unable to unmount
* libnautilus-private/nautilus-directory-async.c:
(got_mount):
Set mount on NautilusFile via nautilus_file_set_mount.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
Add nautilus_file_set_mount to set GMount.
Connect to "unmounted" on GMount and invalidate mount attribute
in callback.
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-directory-async.c
trunk/libnautilus-private/nautilus-file-private.h
trunk/libnautilus-private/nautilus-file.c
Modified: trunk/libnautilus-private/nautilus-directory-async.c
==============================================================================
--- trunk/libnautilus-private/nautilus-directory-async.c (original)
+++ trunk/libnautilus-private/nautilus-directory-async.c Wed Mar 11 08:17:48 2009
@@ -4113,16 +4113,9 @@
file = nautilus_file_ref (state->file);
- if (file->details->mount) {
- g_object_unref (file->details->mount);
- file->details->mount = NULL;
- }
-
file->details->mount_is_up_to_date = TRUE;
- if (mount) {
- file->details->mount = g_object_ref (mount);
- }
-
+ nautilus_file_set_mount (file, mount);
+
nautilus_directory_async_state_changed (directory);
nautilus_file_changed (file);
Modified: trunk/libnautilus-private/nautilus-file-private.h
==============================================================================
--- trunk/libnautilus-private/nautilus-file-private.h (original)
+++ trunk/libnautilus-private/nautilus-file-private.h Wed Mar 11 08:17:48 2009
@@ -264,6 +264,8 @@
const char *display_name,
const char *edit_name,
gboolean custom);
+void nautilus_file_set_mount (NautilusFile *file,
+ GMount *mount);
/* Return true if the top lefts of files in this directory should be
* fetched, according to the preference settings.
Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c (original)
+++ trunk/libnautilus-private/nautilus-file.c Wed Mar 11 08:17:48 2009
@@ -151,6 +151,7 @@
GFileInfo *info);
static const char * nautilus_file_peek_display_name (NautilusFile *file);
static const char * nautilus_file_peek_display_name_collation_key (NautilusFile *file);
+static void file_mount_unmounted (GMount *mount, gpointer data);
G_DEFINE_TYPE_WITH_CODE (NautilusFile, nautilus_file, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_FILE_INFO,
@@ -658,6 +659,7 @@
g_object_unref (file->details->thumbnail);
}
if (file->details->mount) {
+ g_signal_handlers_disconnect_by_func (file->details->mount, file_mount_unmounted, file);
g_object_unref (file->details->mount);
}
@@ -5937,6 +5939,34 @@
return NULL;
}
+static void
+file_mount_unmounted (GMount *mount,
+ gpointer data)
+{
+ NautilusFile *file;
+
+ file = NAUTILUS_FILE (data);
+
+ nautilus_file_invalidate_attributes (file, NAUTILUS_FILE_ATTRIBUTE_MOUNT);
+}
+
+void
+nautilus_file_set_mount (NautilusFile *file,
+ GMount *mount)
+{
+ if (file->details->mount) {
+ g_signal_handlers_disconnect_by_func (file->details->mount, file_mount_unmounted, file);
+ g_object_unref (file->details->mount);
+ file->details->mount = NULL;
+ }
+
+ if (mount) {
+ file->details->mount = g_object_ref (mount);
+ g_signal_connect (mount, "unmounted",
+ G_CALLBACK (file_mount_unmounted), file);
+ }
+}
+
/**
* nautilus_file_is_broken_symbolic_link
*
@@ -6569,6 +6599,12 @@
file->details->thumbnail_is_up_to_date = FALSE;
}
+static void
+invalidate_mount (NautilusFile *file)
+{
+ file->details->mount_is_up_to_date = FALSE;
+}
+
void
nautilus_file_invalidate_extension_info_internal (NautilusFile *file)
{
@@ -6623,6 +6659,9 @@
if (REQUEST_WANTS_TYPE (request, REQUEST_THUMBNAIL)) {
invalidate_thumbnail (file);
}
+ if (REQUEST_WANTS_TYPE (request, REQUEST_MOUNT)) {
+ invalidate_mount (file);
+ }
/* FIXME bugzilla.gnome.org 45075: implement invalidating metadata */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]