diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2011-06-21 17:11:55 +0200 |
---|---|---|
committer | Christian Kellner <gicmo@gnome.org> | 2011-08-25 21:18:39 +0200 |
commit | 6ff326715eea874c3a2ff557acf3db8f44b05a53 (patch) | |
tree | 09932aaceea67ee4709584e34e5b83cf9ccfb369 /daemon/gvfsafpconnection.c | |
parent | d38d13dfd156cfe0e43eb1d03462a176298ce256 (diff) | |
download | gvfs-6ff326715eea874c3a2ff557acf3db8f44b05a53.tar.gz |
afp: get basic file browsing working
Diffstat (limited to 'daemon/gvfsafpconnection.c')
-rw-r--r-- | daemon/gvfsafpconnection.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/daemon/gvfsafpconnection.c b/daemon/gvfsafpconnection.c index 8fc623dd..cb380447 100644 --- a/daemon/gvfsafpconnection.c +++ b/daemon/gvfsafpconnection.c @@ -57,7 +57,7 @@ g_vfs_afp_name_get_string (GVfsAfpName *afp_name) } GVfsAfpName * -g_vfs_afp_name_new (guint32 text_encoding, const gchar *str, gsize len) +g_vfs_afp_name_new (guint32 text_encoding, gchar *str, gsize len) { GVfsAfpName *afp_name; @@ -65,29 +65,10 @@ g_vfs_afp_name_new (guint32 text_encoding, const gchar *str, gsize len) afp_name->ref_count = 1; afp_name->text_encoding = text_encoding; - - afp_name->str = g_malloc (len); - memcpy (afp_name->str, str, len); - - afp_name->len = len; - - return afp_name; -} - -GVfsAfpName * -g_vfs_afp_name_new_from_gstring (guint32 text_encoding, GString *string) -{ - GVfsAfpName *afp_name; - afp_name = g_slice_new (GVfsAfpName); - afp_name->ref_count = 1; - - afp_name->text_encoding = text_encoding; - afp_name->str = string->str; - afp_name->len = string->len; + afp_name->str = str; + afp_name->len = len; - g_string_free (string, FALSE); - return afp_name; } @@ -281,7 +262,7 @@ g_vfs_afp_reply_read_afp_name (GVfsAfpReply *reply, gboolean read_text_encoding, return FALSE; } else - text_encoding = kTextEncodingUnicodeDefault; + text_encoding = kTextEncodingMacRoman; if (!g_vfs_afp_reply_read_uint16 (reply, &len)) { @@ -296,7 +277,7 @@ g_vfs_afp_reply_read_afp_name (GVfsAfpReply *reply, gboolean read_text_encoding, } if (afp_name) - *afp_name = g_vfs_afp_name_new (text_encoding, str, len); + *afp_name = g_vfs_afp_name_new (text_encoding, g_strndup (str, len), len); return TRUE; @@ -415,10 +396,8 @@ g_vfs_afp_command_put_pascal (GVfsAfpCommand *command, const char *str) void g_vfs_afp_command_put_afp_name (GVfsAfpCommand *command, GVfsAfpName *afp_name) { -#if 0 g_data_output_stream_put_uint32 (G_DATA_OUTPUT_STREAM (command), afp_name->text_encoding, NULL, NULL); -#endif g_data_output_stream_put_uint16 (G_DATA_OUTPUT_STREAM (command), afp_name->len, NULL, NULL); |