X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgdummyfile.c;h=4ac3bd9b36ef7382a04cd9a81e45e1e8e1167a9f;hb=0f9acd9d9be0d6efe3110d20eeee9a8b57b558bd;hp=2287674db4d2cb4f52518512d47f77a61b631b51;hpb=6dc9b7ee0050c03e069d026c2c83136547a7d343;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gdummyfile.c b/gio/gdummyfile.c index 2287674..4ac3bd9 100644 --- a/gio/gdummyfile.c +++ b/gio/gdummyfile.c @@ -13,28 +13,23 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Public License along with this library; if not, see . * * Author: Alexander Larsson */ -#include +#include "config.h" #include #include #include #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include "gdummyfile.h" +#include "gfile.h" -#include "gioalias.h" static void g_dummy_file_file_iface_init (GFileIface *iface); @@ -87,9 +82,8 @@ g_dummy_file_finalize (GObject *object) _g_decoded_uri_free (dummy->decoded_uri); g_free (dummy->text_uri); - - if (G_OBJECT_CLASS (g_dummy_file_parent_class)->finalize) - (*G_OBJECT_CLASS (g_dummy_file_parent_class)->finalize) (object); + + G_OBJECT_CLASS (g_dummy_file_parent_class)->finalize (object); } static void @@ -105,12 +99,6 @@ g_dummy_file_init (GDummyFile *dummy) { } -/** - * g_dummy_file_new: - * @uri: Universal Resource Identifier for the dummy file object. - * - * Returns: a new #GFile. - **/ GFile * _g_dummy_file_new (const char *uri) { @@ -144,10 +132,6 @@ g_dummy_file_get_basename (GFile *file) static char * g_dummy_file_get_path (GFile *file) { - GDummyFile *dummy = G_DUMMY_FILE (file); - - if (dummy->decoded_uri) - return g_strdup (dummy->decoded_uri->path); return NULL; } @@ -172,7 +156,8 @@ g_dummy_file_get_parent (GFile *file) char *uri; GDecodedUri new_decoded_uri; - if (dummy->decoded_uri == NULL) + if (dummy->decoded_uri == NULL || + g_strcmp0 (dummy->decoded_uri->path, "/") == 0) return NULL; dirname = g_path_get_dirname (dummy->decoded_uri->path); @@ -428,6 +413,8 @@ g_dummy_file_file_iface_init (GFileIface *iface) iface->get_relative_path = g_dummy_file_get_relative_path; iface->resolve_relative_path = g_dummy_file_resolve_relative_path; iface->get_child_for_display_name = g_dummy_file_get_child_for_display_name; + + iface->supports_thread_contexts = TRUE; } /* Uri handling helper functions: */ @@ -691,16 +678,13 @@ is_valid (char c, const char *reserved_chars_allowed) } static void -g_string_append_encoded (GString *string, +g_string_append_encoded (GString *string, const char *encoded, const char *reserved_chars_allowed) { unsigned char c; - const char *end; static const gchar hex[16] = "0123456789ABCDEF"; - end = encoded + strlen (encoded); - while ((c = *encoded) != 0) { if (is_valid (c, reserved_chars_allowed))