g_return_val_if_fail (GTK_IS_FILE_SYSTEM (file_system), FALSE);
g_return_val_if_fail (base_path != NULL, FALSE);
+ g_return_val_if_fail (str != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
result = GTK_FILE_SYSTEM_GET_IFACE (file_system)->parse (file_system, base_path, str,
&tmp_folder, &tmp_file_part,
error);
return GTK_FILE_SYSTEM_GET_IFACE (file_system)->filename_to_path (file_system, filename);
}
+/**
+ * gtk_file_system_path_is_local:
+ * @filesystem: a #GtkFileSystem
+ * @path: A #GtkFilePath from that filesystem
+ *
+ * Checks whether a #GtkFilePath is local; that is whether
+ * gtk_file_system_path_to_filename would return non-%NULL.
+ *
+ * Return value: %TRUE if the path is loca
+ **/
+gboolean
+gtk_file_system_path_is_local (GtkFileSystem *file_system,
+ const GtkFilePath *path)
+{
+ gchar *filename;
+ gboolean result;
+
+ g_return_val_if_fail (GTK_IS_FILE_SYSTEM (file_system), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+
+ filename = gtk_file_system_path_to_filename (file_system, path);
+ result = filename != NULL;
+ g_free (filename);
+
+ return result;
+}
+
GdkPixbuf *
gtk_file_system_render_icon (GtkFileSystem *file_system,
const GtkFilePath *path,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
+ g_signal_new ("finished-loading",
+ iface_type,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkFileFolderIface, finished_loading),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
initialized = TRUE;
}
return GTK_FILE_FOLDER_GET_IFACE (folder)->get_info (folder, path, error);
}
+gboolean
+gtk_file_folder_is_finished_loading (GtkFileFolder *folder)
+{
+ g_return_val_if_fail (GTK_IS_FILE_FOLDER (folder), TRUE);
+
+ if (!GTK_FILE_FOLDER_GET_IFACE (folder)->is_finished_loading)
+ return TRUE;
+ else
+ return GTK_FILE_FOLDER_GET_IFACE (folder)->is_finished_loading (folder);
+}
+
+
+/*****************************************
+ * GtkFilePath modules *
+ *****************************************/
+
+/* We make these real functions in case either copy or free are implemented as macros
+ */
+static gpointer
+gtk_file_path_real_copy (gpointer boxed)
+{
+ return gtk_file_path_copy ((GtkFilePath *) boxed);
+}
+
+static void
+gtk_file_path_real_free (gpointer boxed)
+{
+ gtk_file_path_free (boxed);
+}
+
+GType
+gtk_file_path_get_type (void)
+{
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ our_type = g_boxed_type_register_static ("GtkFilePath",
+ (GBoxedCopyFunc) gtk_file_path_real_copy,
+ (GBoxedFreeFunc) gtk_file_path_real_free);
+
+ return our_type;
+}
+
+
GSList *
gtk_file_paths_sort (GSList *paths)
{