- Update to 1.5.1

- AFC: temporarily disable setting file modification times
This commit is contained in:
Tomas Bzatek 2009-11-18 14:05:08 +00:00
parent 151763b96b
commit 617d1132be
11 changed files with 75 additions and 3127 deletions

View File

@ -1 +1 @@
gvfs-1.4.0.tar.bz2
gvfs-1.5.1.tar.bz2

File diff suppressed because it is too large Load Diff

View File

@ -1,85 +0,0 @@
From 67069c464a2cb827a2afe2b7886e79707c7149e2 Mon Sep 17 00:00:00 2001
From: Christian Kellner <gicmo@gnome.org>
Date: Fri, 16 Oct 2009 10:34:02 +0000
Subject: [HTTP] Use soup's (2.26) header parsing function
Libsoup has (since 2.26) specific functions for parsing various
well-known http headers, including Content-Type and Content-Length.
Bump the soup requirement accordingly. Based on a patch rom Robert
Ancell <robert.ancell@gmail.com>
---
diff --git a/configure.ac b/configure.ac
index a2c9932..5069d73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,7 +121,7 @@ HTTP_CFLAGS=
HTTP_LIBS=
if test "x$enable_http" != "xno"; then
- PKG_CHECK_EXISTS(libsoup-gnome-2.4 >= 2.25.1, msg_http=yes)
+ PKG_CHECK_EXISTS(libsoup-gnome-2.4 >= 2.26.0, msg_http=yes)
if test "x$msg_http" = "xyes"; then
PKG_CHECK_MODULES(HTTP, libsoup-gnome-2.4 libxml-2.0)
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 23d1f97..ee531d1 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -549,40 +549,24 @@ file_info_from_message (SoupMessage *msg,
if (basename != NULL &&
g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
- {
- ed_name = gvfs_file_info_populate_names_as_local (info, basename);
- }
+ ed_name = gvfs_file_info_populate_names_as_local (info, basename);
if (ed_name != NULL &&
g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME))
- {
- g_file_info_set_edit_name (info, ed_name);
- }
+ g_file_info_set_edit_name (info, ed_name);
g_free (basename);
g_free (ed_name);
- text = soup_message_headers_get (msg->response_headers,
- "Content-Length");
- if (text)
- {
- guint64 size = g_ascii_strtoull (text, NULL, 10);
- g_file_info_set_size (info, size);
- }
-
+ if (soup_message_headers_get_encoding(msg->response_headers) == SOUP_ENCODING_CONTENT_LENGTH)
+ g_file_info_set_size (info, soup_message_headers_get_content_length (msg->response_headers));
- text = soup_message_headers_get (msg->response_headers,
- "Content-Type");
+ text = soup_message_headers_get_content_type (msg->response_headers, NULL);
if (text)
{
- char *p = strchr (text, ';');
- char *tmp = NULL;
GIcon *icon;
- if (p != NULL)
- text = tmp = g_strndup (text, p - text);
-
g_file_info_set_file_type (info, G_FILE_TYPE_REGULAR);
g_file_info_set_content_type (info, text);
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, text);
@@ -590,9 +574,6 @@ file_info_from_message (SoupMessage *msg,
icon = g_content_type_get_icon (text);
g_file_info_set_icon (info, icon);
g_object_unref (icon);
-
- g_free (tmp);
-
}
--
cgit v0.8.2

View File

@ -1,157 +0,0 @@
From 47a6cb95996df5538bab4b9b07cdd8f944c0b24b Mon Sep 17 00:00:00 2001
From: Christian Kellner <gicmo@gnome.org>
Date: Fri, 16 Oct 2009 10:18:17 +0000
Subject: [HTTP] Support g_file_input_stream_query_info()
Fixes bug 598505. Based on a patch from Robert Ancell.
---
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 97c6ce7..23d1f97 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -529,30 +529,15 @@ try_close_read (GVfsBackend *backend,
/* *** query_info () *** */
-static void
-query_info_ready (SoupSession *session,
- SoupMessage *msg,
- gpointer user_data)
+static void
+file_info_from_message (SoupMessage *msg,
+ GFileInfo *info,
+ GFileAttributeMatcher *matcher)
{
- GFileAttributeMatcher *matcher;
- GVfsJobQueryInfo *job;
- const SoupURI *uri;
- const char *text;
- GFileInfo *info;
- char *basename;
- char *ed_name;
-
- job = G_VFS_JOB_QUERY_INFO (user_data);
- info = job->file_info;
- matcher = job->attribute_matcher;
- ed_name = NULL;
-
- if (! SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
- {
- g_vfs_job_failed_from_http_status (G_VFS_JOB (job), msg->status_code,
- msg->reason_phrase);
- return;
- }
+ const SoupURI *uri;
+ const char *text;
+ char *basename;
+ char *ed_name = NULL;
uri = soup_message_get_uri (msg);
basename = http_uri_get_basename (uri->path);
@@ -636,7 +621,29 @@ query_info_ready (SoupSession *session,
G_FILE_ATTRIBUTE_ETAG_VALUE,
text);
}
+}
+
+static void
+query_info_ready (SoupSession *session,
+ SoupMessage *msg,
+ gpointer user_data)
+{
+ GFileAttributeMatcher *matcher;
+ GVfsJobQueryInfo *job;
+ GFileInfo *info;
+
+ job = G_VFS_JOB_QUERY_INFO (user_data);
+ info = job->file_info;
+ matcher = job->attribute_matcher;
+
+ if (! SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
+ {
+ g_vfs_job_failed_from_http_status (G_VFS_JOB (job), msg->status_code,
+ msg->reason_phrase);
+ return;
+ }
+ file_info_from_message (msg, info, matcher);
g_vfs_job_succeeded (G_VFS_JOB (job));
}
@@ -663,6 +670,24 @@ try_query_info (GVfsBackend *backend,
}
+static gboolean
+try_query_info_on_read (GVfsBackend *backend,
+ GVfsJobQueryInfoRead *job,
+ GVfsBackendHandle handle,
+ GFileInfo *info,
+ GFileAttributeMatcher *attribute_matcher)
+{
+ SoupMessage *msg = soup_input_stream_get_message (G_INPUT_STREAM (handle));
+
+ file_info_from_message (msg, info, attribute_matcher);
+ g_object_unref (msg);
+
+ g_vfs_job_succeeded (G_VFS_JOB (job));
+
+ return TRUE;
+}
+
+
static void
g_vfs_backend_http_class_init (GVfsBackendHttpClass *klass)
{
@@ -673,11 +698,11 @@ g_vfs_backend_http_class_init (GVfsBackendHttpClass *klass)
backend_class = G_VFS_BACKEND_CLASS (klass);
- backend_class->try_mount = try_mount;
- backend_class->try_open_for_read = try_open_for_read;
- backend_class->try_read = try_read;
- backend_class->try_seek_on_read = try_seek_on_read;
- backend_class->try_close_read = try_close_read;
- backend_class->try_query_info = try_query_info;
-
+ backend_class->try_mount = try_mount;
+ backend_class->try_open_for_read = try_open_for_read;
+ backend_class->try_read = try_read;
+ backend_class->try_seek_on_read = try_seek_on_read;
+ backend_class->try_close_read = try_close_read;
+ backend_class->try_query_info = try_query_info;
+ backend_class->try_query_info_on_read = try_query_info_on_read;
}
diff --git a/daemon/soup-input-stream.c b/daemon/soup-input-stream.c
index facce17..e1928af 100644
--- a/daemon/soup-input-stream.c
+++ b/daemon/soup-input-stream.c
@@ -912,6 +912,13 @@ soup_input_stream_truncate (GSeekable *seekable,
return FALSE;
}
+SoupMessage *
+soup_input_stream_get_message (GInputStream *stream)
+{
+ SoupInputStreamPrivate *priv = SOUP_INPUT_STREAM_GET_PRIVATE (stream);
+ return priv->msg ? g_object_ref (priv->msg) : NULL;
+}
+
GQuark
soup_http_error_quark (void)
{
diff --git a/daemon/soup-input-stream.h b/daemon/soup-input-stream.h
index dd2c540..f425291 100644
--- a/daemon/soup-input-stream.h
+++ b/daemon/soup-input-stream.h
@@ -70,6 +70,8 @@ gboolean soup_input_stream_send_finish (GInputStream *stream,
GAsyncResult *result,
GError **error);
+SoupMessage *soup_input_stream_get_message (GInputStream *stream);
+
#define SOUP_HTTP_ERROR soup_http_error_quark()
GQuark soup_http_error_quark (void);
--
cgit v0.8.2

View File

@ -1,404 +0,0 @@
From 48cf9c174f347f92c3fab7ff50b38effda0eb78a Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 30 Oct 2009 17:06:26 +0000
Subject: Gently handle NULL GduDevice objects
This patch adds bunch of tests for NULL GduDevice objects. According to
gdu docs, there's a possibility to have GduPresentable and no associated
GduDevice. It's not common but true for several special cases -
like GduLinuxMdDrive.
Signed-off-by: David Zeuthen <davidz@redhat.com>
---
diff --git a/monitor/gdu/ggduvolume.c b/monitor/gdu/ggduvolume.c
index 865a7b7..28839fd 100644
--- a/monitor/gdu/ggduvolume.c
+++ b/monitor/gdu/ggduvolume.c
@@ -172,7 +172,7 @@ static gboolean
update_volume (GGduVolume *volume)
{
GduDevice *device;
- GduPool *pool;
+ GduPool *pool = NULL;
time_t now;
gboolean changed;
gboolean old_can_mount;
@@ -217,10 +217,11 @@ update_volume (GGduVolume *volume)
/* in with the new */
device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->gdu_volume));
- pool = gdu_device_get_pool (device);
+ if (device != NULL)
+ pool = gdu_device_get_pool (device);
keep_cleartext_volume = FALSE;
- if (gdu_device_is_luks (device))
+ if (device != NULL && gdu_device_is_luks (device))
{
const gchar *holder_objpath;
@@ -287,13 +288,17 @@ update_volume (GGduVolume *volume)
volume->name = gdu_presentable_get_name (GDU_PRESENTABLE (volume->cleartext_gdu_volume));
g_free (volume->device_file);
- volume->device_file = g_strdup (gdu_device_get_device_file (luks_cleartext_volume_device));
+ if (luks_cleartext_volume_device != NULL)
+ volume->device_file = g_strdup (gdu_device_get_device_file (luks_cleartext_volume_device));
+ else
+ volume->device_file = NULL;
volume->can_mount = TRUE;
volume->should_automount = FALSE;
- g_object_unref (luks_cleartext_volume_device);
+ if (luks_cleartext_volume_device != NULL)
+ g_object_unref (luks_cleartext_volume_device);
}
else
{
@@ -321,7 +326,10 @@ update_volume (GGduVolume *volume)
}
g_free (volume->device_file);
- volume->device_file = g_strdup (gdu_device_get_device_file (device));
+ if (device != NULL)
+ volume->device_file = g_strdup (gdu_device_get_device_file (device));
+ else
+ volume->device_file = NULL;
volume->can_mount = TRUE;
@@ -341,14 +349,16 @@ update_volume (GGduVolume *volume)
* nopolicy is only FALSE for "physical" devices - e.g. only "physical" devices will
* be set to be automounted.
*/
- if (gdu_device_get_presentation_nopolicy (device))
+ if (device != NULL && gdu_device_get_presentation_nopolicy (device))
volume->should_automount = FALSE;
g_free (activation_uri);
}
- g_object_unref (pool);
- g_object_unref (device);
+ if (pool != NULL)
+ g_object_unref (pool);
+ if (device != NULL)
+ g_object_unref (device);
/* ---------------------------------------------------------------------------------------------------- */
@@ -1082,6 +1092,20 @@ g_gdu_volume_mount (GVolume *_volume,
}
device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->gdu_volume));
+
+ if (device == NULL)
+ {
+ simple = g_simple_async_result_new_error (G_OBJECT (volume),
+ callback,
+ user_data,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Underlying device missing");
+ g_simple_async_result_complete (simple);
+ g_object_unref (simple);
+ goto out;
+ }
+
pool = gdu_device_get_pool (device);
/* Makes no sense to mount
@@ -1129,11 +1153,14 @@ g_gdu_volume_mount (GVolume *_volume,
luks_cleartext_volume_device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->cleartext_gdu_volume));
- object_path_of_cleartext_device = gdu_device_get_object_path (luks_cleartext_volume_device);
+ if (luks_cleartext_volume_device != NULL)
+ {
+ object_path_of_cleartext_device = gdu_device_get_object_path (luks_cleartext_volume_device);
- mount_cleartext_device (data, object_path_of_cleartext_device);
+ mount_cleartext_device (data, object_path_of_cleartext_device);
- g_object_unref (luks_cleartext_volume_device);
+ g_object_unref (luks_cleartext_volume_device);
+ }
goto out;
}
@@ -1551,17 +1578,20 @@ g_gdu_volume_get_identifier (GVolume *_volume,
{
device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->gdu_volume));
- label = gdu_device_id_get_label (device);
- uuid = gdu_device_id_get_uuid (device);
+ if (device != NULL)
+ {
+ label = gdu_device_id_get_label (device);
+ uuid = gdu_device_id_get_uuid (device);
- g_object_unref (device);
+ g_object_unref (device);
- if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) == 0)
- id = g_strdup (volume->device_file);
- else if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_LABEL) == 0)
- id = strlen (label) > 0 ? g_strdup (label) : NULL;
- else if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_UUID) == 0)
- id = strlen (uuid) > 0 ? g_strdup (uuid) : NULL;
+ if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) == 0)
+ id = g_strdup (volume->device_file);
+ else if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_LABEL) == 0)
+ id = strlen (label) > 0 ? g_strdup (label) : NULL;
+ else if (strcmp (kind, G_VOLUME_IDENTIFIER_KIND_UUID) == 0)
+ id = strlen (uuid) > 0 ? g_strdup (uuid) : NULL;
+ }
}
return id;
@@ -1577,19 +1607,24 @@ g_gdu_volume_enumerate_identifiers (GVolume *_volume)
const gchar *uuid;
p = g_ptr_array_new ();
+ label = NULL;
if (volume->gdu_volume != NULL)
{
device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->gdu_volume));
- label = gdu_device_id_get_label (device);
- uuid = gdu_device_id_get_uuid (device);
- g_object_unref (device);
-
- g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE));
- if (strlen (label) > 0)
- g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_LABEL));
- if (strlen (uuid) > 0)
- g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_UUID));
+
+ if (device != NULL)
+ {
+ label = gdu_device_id_get_label (device);
+ uuid = gdu_device_id_get_uuid (device);
+ g_object_unref (device);
+
+ g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE));
+ if (strlen (label) > 0)
+ g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_LABEL));
+ if (strlen (uuid) > 0)
+ g_ptr_array_add (p, g_strdup (G_VOLUME_IDENTIFIER_KIND_UUID));
+ }
}
g_ptr_array_add (p, NULL);
@@ -1638,8 +1673,11 @@ g_gdu_volume_has_device_file (GGduVolume *volume,
{
GduDevice *luks_cleartext_volume_device;
luks_cleartext_volume_device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->cleartext_gdu_volume));
- _device_file = gdu_device_get_device_file (luks_cleartext_volume_device);
- g_object_unref (luks_cleartext_volume_device);
+ if (luks_cleartext_volume_device != NULL)
+ {
+ _device_file = gdu_device_get_device_file (luks_cleartext_volume_device);
+ g_object_unref (luks_cleartext_volume_device);
+ }
}
return g_strcmp0 (_device_file, device_file) == 0;
@@ -1682,8 +1720,11 @@ g_gdu_volume_has_uuid (GGduVolume *volume,
{
GduDevice *luks_cleartext_volume_device;
luks_cleartext_volume_device = gdu_presentable_get_device (GDU_PRESENTABLE (volume->cleartext_gdu_volume));
- _uuid = gdu_device_id_get_uuid (luks_cleartext_volume_device);
- g_object_unref (luks_cleartext_volume_device);
+ if (luks_cleartext_volume_device != NULL)
+ {
+ _uuid = gdu_device_id_get_uuid (luks_cleartext_volume_device);
+ g_object_unref (luks_cleartext_volume_device);
+ }
}
return g_strcmp0 (_uuid, uuid) == 0;
diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index e81dce2..398fed4 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -779,9 +779,10 @@ should_volume_be_ignored (GduPool *pool, GduVolume *volume, GList *fstab_mount_p
const gchar *type;
ret = TRUE;
- device = NULL;
device = gdu_presentable_get_device (GDU_PRESENTABLE (volume));
+ if (device == NULL)
+ goto out;
if (gdu_device_get_presentation_hide (device))
goto out;
@@ -827,7 +828,8 @@ should_volume_be_ignored (GduPool *pool, GduVolume *volume, GList *fstab_mount_p
out:
- g_object_unref (device);
+ if (device != NULL)
+ g_object_unref (device);
return ret;
}
@@ -1269,15 +1271,18 @@ update_volumes (GGduVolumeMonitor *monitor,
d = gdu_presentable_get_device (p);
- volume = find_volume_for_device_file (monitor, gdu_device_get_device_file (d));
- if (volume != NULL)
+ if (d != NULL)
{
- /*g_debug ("removing volume %s", gdu_device_get_device_file (d));*/
- g_gdu_volume_removed (volume);
- monitor->volumes = g_list_remove (monitor->volumes, volume);
- *removed_volumes = g_list_prepend (*removed_volumes, volume);
+ volume = find_volume_for_device_file (monitor, gdu_device_get_device_file (d));
+ if (volume != NULL)
+ {
+ /*g_debug ("removing volume %s", gdu_device_get_device_file (d));*/
+ g_gdu_volume_removed (volume);
+ monitor->volumes = g_list_remove (monitor->volumes, volume);
+ *removed_volumes = g_list_prepend (*removed_volumes, volume);
+ }
+ g_object_unref (d);
}
- g_object_unref (d);
}
for (l = added; l != NULL; l = l->next)
@@ -1285,9 +1290,12 @@ update_volumes (GGduVolumeMonitor *monitor,
GduPresentable *p = GDU_PRESENTABLE (l->data);
GduDevice *d;
+ volume = NULL;
d = gdu_presentable_get_device (p);
- volume = find_volume_for_device_file (monitor, gdu_device_get_device_file (d));
+ if (d != NULL)
+ volume = find_volume_for_device_file (monitor, gdu_device_get_device_file (d));
+
if (volume == NULL)
{
GduPresentable *toplevel_presentable;
@@ -1297,12 +1305,16 @@ update_volumes (GGduVolumeMonitor *monitor,
{
GduDevice *toplevel_device;
+ drive = NULL;
toplevel_device = gdu_presentable_get_device (toplevel_presentable);
- drive = find_drive_by_device_file (monitor, gdu_device_get_device_file (toplevel_device));
- /*g_debug ("adding volume %s (drive %s)",
- gdu_device_get_device_file (d),
- gdu_device_get_device_file (toplevel_device));*/
- g_object_unref (toplevel_device);
+ if (toplevel_device != NULL)
+ {
+ drive = find_drive_by_device_file (monitor, gdu_device_get_device_file (toplevel_device));
+ /*g_debug ("adding volume %s (drive %s)",
+ gdu_device_get_device_file (d),
+ gdu_device_get_device_file (toplevel_device));*/
+ g_object_unref (toplevel_device);
+ }
g_object_unref (toplevel_presentable);
}
else
@@ -1320,9 +1332,10 @@ update_volumes (GGduVolumeMonitor *monitor,
monitor->volumes = g_list_prepend (monitor->volumes, volume);
*added_volumes = g_list_prepend (*added_volumes, g_object_ref (volume));
}
- }
+ }
- g_object_unref (d);
+ if (d != NULL)
+ g_object_unref (d);
}
g_list_free (added);
@@ -1579,10 +1592,15 @@ update_discs (GGduVolumeMonitor *monitor,
GduPresentable *p = GDU_PRESENTABLE (l->data);
GduDevice *d;
+ volume = NULL;
+ mount = NULL;
d = gdu_presentable_get_device (p);
- volume = find_disc_volume_for_device_file (monitor, gdu_device_get_device_file (d));
- mount = find_disc_mount_for_volume (monitor, volume);
+ if (d != NULL)
+ {
+ volume = find_disc_volume_for_device_file (monitor, gdu_device_get_device_file (d));
+ mount = find_disc_mount_for_volume (monitor, volume);
+ }
if (mount != NULL)
{
@@ -1600,7 +1618,8 @@ update_discs (GGduVolumeMonitor *monitor,
*removed_volumes = g_list_prepend (*removed_volumes, volume);
}
- g_object_unref (d);
+ if (d != NULL)
+ g_object_unref (d);
}
for (l = added; l != NULL; l = l->next)
@@ -1609,11 +1628,16 @@ update_discs (GGduVolumeMonitor *monitor,
GduDevice *d;
gboolean is_blank;
+ volume = NULL;
+ is_blank = TRUE;
d = gdu_presentable_get_device (p);
- is_blank = gdu_device_optical_disc_get_is_blank (d);
+ if (d != NULL)
+ {
+ is_blank = gdu_device_optical_disc_get_is_blank (d);
+ volume = find_disc_volume_for_device_file (monitor, gdu_device_get_device_file (d));
+ }
- volume = find_disc_volume_for_device_file (monitor, gdu_device_get_device_file (d));
if (volume == NULL)
{
GduPresentable *toplevel_presentable;
@@ -1623,12 +1647,16 @@ update_discs (GGduVolumeMonitor *monitor,
{
GduDevice *toplevel_device;
+ drive = NULL;
toplevel_device = gdu_presentable_get_device (toplevel_presentable);
- drive = find_drive_by_device_file (monitor, gdu_device_get_device_file (toplevel_device));
- /*g_debug ("adding volume %s (drive %s)",
- gdu_device_get_device_file (d),
- gdu_device_get_device_file (toplevel_device));*/
- g_object_unref (toplevel_device);
+ if (toplevel_device != NULL)
+ {
+ drive = find_drive_by_device_file (monitor, gdu_device_get_device_file (toplevel_device));
+ /*g_debug ("adding volume %s (drive %s)",
+ gdu_device_get_device_file (d),
+ gdu_device_get_device_file (toplevel_device));*/
+ g_object_unref (toplevel_device);
+ }
g_object_unref (toplevel_presentable);
}
else
@@ -1682,7 +1710,8 @@ update_discs (GGduVolumeMonitor *monitor,
}
}
- g_object_unref (d);
+ if (d != NULL)
+ g_object_unref (d);
}
g_list_free (added);
--
cgit v0.8.2

View File

@ -1,66 +0,0 @@
From cd2afbd07bbcf4e7caee1dd0ca1c65d74974884d Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 30 Oct 2009 17:03:35 +0000
Subject: Remove dead code
Signed-off-by: David Zeuthen <davidz@redhat.com>
---
diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 83d8fc2..e81dce2 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -842,7 +842,6 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
GList *l;
ignored = FALSE;
- device = NULL;
enclosed = NULL;
device = gdu_presentable_get_device (GDU_PRESENTABLE (d));
@@ -1074,7 +1073,7 @@ find_disc_volume_for_device_file (GGduVolumeMonitor *monitor,
static GGduVolume *
find_volume_for_device_file (GGduVolumeMonitor *monitor,
- const gchar *device_file)
+ const gchar *device_file)
{
GList *l;
GGduVolume *ret;
@@ -1183,9 +1182,6 @@ update_drives (GGduVolumeMonitor *monitor,
for (l = removed; l != NULL; l = l->next)
{
GduPresentable *p = GDU_PRESENTABLE (l->data);
- GduDevice *d;
-
- d = gdu_presentable_get_device (p);
drive = find_drive_by_presentable (monitor, p);
if (drive != NULL)
@@ -1195,16 +1191,11 @@ update_drives (GGduVolumeMonitor *monitor,
monitor->drives = g_list_remove (monitor->drives, drive);
*removed_drives = g_list_prepend (*removed_drives, drive);
}
- if (d != NULL)
- g_object_unref (d);
}
for (l = added; l != NULL; l = l->next)
{
GduPresentable *p = GDU_PRESENTABLE (l->data);
- GduDevice *d;
-
- d = gdu_presentable_get_device (p);
drive = find_drive_by_presentable (monitor, p);
if (drive == NULL)
@@ -1217,8 +1208,6 @@ update_drives (GGduVolumeMonitor *monitor,
*added_drives = g_list_prepend (*added_drives, g_object_ref (drive));
}
}
- if (d != NULL)
- g_object_unref (d);
}
g_list_free (added);
--
cgit v0.8.2

View File

@ -1,57 +0,0 @@
From 62f7058bec6f96c2dcc8a12431a1114e24eac6e8 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 10 Nov 2009 17:53:50 +0100
Subject: [PATCH] [SMB] Support querying filesystem size and free space
Requires libsmbclient >= 3.2.0
Fixes rfe bug 565337
---
daemon/gvfsbackendsmb.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index bc8c415..2106a43 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1591,8 +1591,36 @@ do_query_fs_info (GVfsBackend *backend,
GFileInfo *info,
GFileAttributeMatcher *attribute_matcher)
{
+ GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend);
+ smbc_statvfs_fn smbc_statvfs;
+ struct statvfs st = {0};
+ char *uri;
+ int res;
+
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs");
-
+
+#ifdef DEPRECATED_SMBC_INTERFACE
+ if (g_file_attribute_matcher_matches (attribute_matcher,
+ G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
+ g_file_attribute_matcher_matches (attribute_matcher,
+ G_FILE_ATTRIBUTE_FILESYSTEM_FREE) ||
+ g_file_attribute_matcher_matches (attribute_matcher,
+ G_FILE_ATTRIBUTE_FILESYSTEM_READONLY))
+ {
+ uri = create_smb_uri (op_backend->server, op_backend->share, filename);
+ smbc_statvfs = smbc_getFunctionStatVFS (op_backend->smb_context);
+ res = smbc_statvfs (op_backend->smb_context, uri, &st);
+ g_free (uri);
+
+ if (res == 0)
+ {
+ g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, st.f_bsize * st.f_blocks);
+ g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE, st.f_bsize * st.f_bavail);
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, st.f_flag & SMBC_VFS_FEATURE_RDONLY);
+ }
+ }
+#endif
+
g_vfs_job_succeeded (G_VFS_JOB (job));
}
--
1.6.5.2

View File

@ -0,0 +1,59 @@
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index 8722ca7..8b87141 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -1150,46 +1150,6 @@ g_vfs_backend_afc_set_display_name (GVfsBackend *backend,
}
static void
-g_vfs_backend_afc_set_attribute (GVfsBackend *backend,
- GVfsJobSetAttribute *job,
- const char *filename,
- const char *attribute,
- GFileAttributeType type,
- gpointer value_p,
- GFileQueryInfoFlags flags)
-{
- GVfsBackendAfc *self;
- uint64_t mtime = 0;
- afc_error_t err;
-
- self = G_VFS_BACKEND_AFC(backend);
- g_return_if_fail(self->connected);
-
- if (g_str_equal (attribute, G_FILE_ATTRIBUTE_TIME_MODIFIED) == FALSE)
- {
- g_vfs_job_failed (G_VFS_JOB (job),
- G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- _("Operation unsupported"));
- return;
- }
-
- mtime = *(guint64*)(value_p) * (guint64)1000000000;
-
- err = afc_set_file_time (self->afc_cli, filename, mtime);
- if (err == AFC_E_UNKNOWN_PACKET_TYPE)
- {
- /* ignore error for pre-3.1 devices as the do not support setting file modification times */
- return g_vfs_job_succeeded (G_VFS_JOB(job));
- }
- if (G_UNLIKELY(g_vfs_backend_afc_check (err, G_VFS_JOB(job))))
- {
- return;
- }
-
- g_vfs_job_succeeded (G_VFS_JOB(job));
-}
-
-static void
g_vfs_backend_afc_make_directory (GVfsBackend *backend,
GVfsJobMakeDirectory *job,
const char *path)
@@ -1336,7 +1296,6 @@ g_vfs_backend_afc_class_init (GVfsBackendAfcClass *klass)
backend_class->make_symlink = g_vfs_backend_afc_make_symlink;
backend_class->move = g_vfs_backend_afc_move;
backend_class->set_display_name = g_vfs_backend_afc_set_display_name;
- backend_class->set_attribute = g_vfs_backend_afc_set_attribute;
}
/*

View File

@ -1,11 +1,11 @@
Summary: Backends for the gio framework in GLib
Name: gvfs
Version: 1.4.1
Release: 6%{?dist}
Version: 1.5.1
Release: 1%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gvfs/1.4/gvfs-%{version}.tar.bz2
Source: http://download.gnome.org/sources/gvfs/1.5/gvfs-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig
BuildRequires: glib2-devel >= 2.21.2
@ -14,7 +14,7 @@ BuildRequires: /usr/bin/ssh
BuildRequires: libcdio-devel >= 0.78.2
BuildRequires: hal-devel >= 0.5.10
BuildRequires: libgudev-devel
BuildRequires: libsoup-devel >= 2.25.2
BuildRequires: libsoup-devel >= 2.26.0
BuildRequires: avahi-glib-devel >= 0.6
BuildRequires: gnome-keyring-devel
BuildRequires: intltool
@ -22,9 +22,7 @@ BuildRequires: gettext-devel
BuildRequires: GConf2-devel
BuildRequires: gnome-disk-utility-devel >= 2.28.1-1
BuildRequires: PolicyKit-devel
# This is a hack until the xfce4-notifyd dependency issue is fixed
# https://fedorahosted.org/rel-eng/ticket/1788
#BuildRequires: notification-daemon
BuildRequires: expat-devel
Requires(post): desktop-file-utils
@ -35,17 +33,9 @@ BuildRequires: automake autoconf
BuildRequires: libtool
# http://bugzilla.gnome.org/show_bug.cgi?id=567235
Patch0: gvfs-archive-integration.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=591005
Patch1: 0001-Add-AFC-backend.patch
# from upstream
Patch2: http-icons.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=565337
Patch3: gvfs-1.4.2-smb-queryfs.patch
# from upstream
Patch12: gvfs-1.4.1-http-suport-stream-query-info.patch
Patch13: gvfs-1.4.1-http-soup-header-parsing.patch
Patch14: gvfs-1.4.2-remove-dead-code.patch
Patch15: gvfs-1.4.2-handle-null-gdudevices.patch
# some AFC code depends on unreleased libiphone additions
Patch1: gvfs-1.5.1-afc-remove-unreleased.patch
Obsoletes: gnome-mount <= 0.8
Obsoletes: gnome-mount-nautilus-properties <= 0.8
@ -106,7 +96,6 @@ Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: obex-data-server >= 0.3.4-6
BuildRequires: bluez-libs-devel >= 3.12
BuildRequires: expat-devel
Obsoletes: gnome-vfs2-obexftp <= 0.4
%description obexftp
@ -132,7 +121,7 @@ Summary: AFC support for gvfs
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: usbmuxd
BuildRequires: libiphone-devel >= 0.9.2
BuildRequires: libiphone-devel >= 0.9.4
%description afc
This package provides support for reading files on Apple iPhones and
@ -142,13 +131,7 @@ and iPod Touches to applications using gvfs.
%prep
%setup -q
%patch0 -p1 -b .archive-integration
%patch1 -p1 -b .afc
%patch2 -p1 -b .http-icons
%patch3 -p1 -b .smb-queryfs
%patch12 -p1 -b .http-query-info
%patch13 -p1 -b .http-headers
%patch14 -p1 -b .dead-code
%patch15 -p1 -b .gdu-null-devices
%patch1 -p1 -b .afc-unreleased
%build
@ -314,6 +297,10 @@ killall -USR1 gvfsd >&/dev/null || :
%{_datadir}/gvfs/remote-volume-monitors/afc.monitor
%changelog
* Wed Nov 18 2009 Tomas Bzatek <tbzatek@redhat.com> - 1.5.1-1
- Update to 1.5.1
- AFC: temporarily disable setting file modification times
* Thu Nov 12 2009 Matthias Clasen <mclasen@redhat.com> 1.4.1-6
- Add obsoletes for gnome-mount

View File

@ -1,91 +0,0 @@
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 45ea54d..97c6ce7 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -47,6 +47,7 @@
#include "gvfsjobqueryattributes.h"
#include "gvfsjobenumerate.h"
#include "gvfsdaemonprotocol.h"
+#include "gvfsdaemonutils.h"
#include "soup-input-stream.h"
@@ -539,10 +540,12 @@ query_info_ready (SoupSession *session,
const char *text;
GFileInfo *info;
char *basename;
+ char *ed_name;
job = G_VFS_JOB_QUERY_INFO (user_data);
info = job->file_info;
matcher = job->attribute_matcher;
+ ed_name = NULL;
if (! SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
@@ -562,30 +565,18 @@ query_info_ready (SoupSession *session,
g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
{
- char *display_name = g_filename_display_name (basename);
-
- if (strstr (display_name, "\357\277\275") != NULL)
- {
- char *p = display_name;
- display_name = g_strconcat (display_name, _(" (invalid encoding)"), NULL);
- g_free (p);
- }
-
- g_file_info_set_display_name (info, display_name);
- g_free (display_name);
+ ed_name = gvfs_file_info_populate_names_as_local (info, basename);
}
- if (basename != NULL &&
+ if (ed_name != NULL &&
g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME))
{
- char *edit_name = g_filename_display_name (basename);
- g_file_info_set_edit_name (info, edit_name);
- g_free (edit_name);
- }
+ g_file_info_set_edit_name (info, ed_name);
+ }
g_free (basename);
-
+ g_free (ed_name);
text = soup_message_headers_get (msg->response_headers,
"Content-Length");
@@ -601,15 +592,22 @@ query_info_ready (SoupSession *session,
if (text)
{
char *p = strchr (text, ';');
+ char *tmp = NULL;
+ GIcon *icon;
if (p != NULL)
- {
- char *tmp = g_strndup (text, p - text);
- g_file_info_set_content_type (info, tmp);
- g_free (tmp);
- }
- else
- g_file_info_set_content_type (info, text);
+ text = tmp = g_strndup (text, p - text);
+
+ g_file_info_set_file_type (info, G_FILE_TYPE_REGULAR);
+ g_file_info_set_content_type (info, text);
+ g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, text);
+
+ icon = g_content_type_get_icon (text);
+ g_file_info_set_icon (info, icon);
+ g_object_unref (icon);
+
+ g_free (tmp);
+
}

View File

@ -1 +1 @@
6eff809d50e618f289d5192724a049de gvfs-1.4.1.tar.bz2
46a7efa529d2fb8a0beee213da650b4d gvfs-1.5.1.tar.bz2