favorite-vfs-file.c: Remove some methods that can't be supported.
Michael Webster
3 years ago
974 | 974 | return NULL; |
975 | 975 | } |
976 | 976 | |
977 | GFileOutputStream * | |
978 | file_create (GFile *file, | |
979 | GFileCreateFlags flags, | |
980 | GCancellable *cancellable, | |
981 | GError **error) | |
982 | { | |
983 | FavoriteVfsFilePrivate *priv = favorite_vfs_file_get_instance_private (FAVORITE_VFS_FILE (file)); | |
984 | ||
985 | if (priv->info != NULL && priv->info->uri != NULL) | |
986 | { | |
987 | GFile *real_file = g_file_new_for_uri (priv->info->uri); | |
988 | ||
989 | GFileOutputStream *stream; | |
990 | ||
991 | stream = g_file_create (real_file, | |
992 | flags, | |
993 | cancellable, | |
994 | error); | |
995 | ||
996 | g_object_unref (real_file); | |
997 | return stream; | |
998 | } | |
999 | ||
1000 | g_set_error_literal (error, G_IO_ERROR, | |
1001 | G_IO_ERROR_NOT_SUPPORTED, | |
1002 | _("Operation not supported")); | |
1003 | ||
1004 | return NULL; | |
1005 | } | |
1006 | ||
1007 | 977 | static GFileOutputStream * |
1008 | 978 | file_replace (GFile *file, |
1009 | 979 | const char *etag, |
1053 | 1023 | res = g_file_open_readwrite (real_file, |
1054 | 1024 | cancellable, |
1055 | 1025 | error); |
1056 | ||
1057 | g_object_unref (real_file); | |
1058 | return res; | |
1059 | } | |
1060 | ||
1061 | g_set_error_literal (error, G_IO_ERROR, | |
1062 | G_IO_ERROR_NOT_SUPPORTED, | |
1063 | _("Operation not supported")); | |
1064 | ||
1065 | return NULL; | |
1066 | } | |
1067 | ||
1068 | static GFileIOStream * | |
1069 | file_create_readwrite (GFile *file, | |
1070 | GFileCreateFlags flags, | |
1071 | GCancellable *cancellable, | |
1072 | GError **error) | |
1073 | { | |
1074 | FavoriteVfsFilePrivate *priv = favorite_vfs_file_get_instance_private (FAVORITE_VFS_FILE (file)); | |
1075 | ||
1076 | if (priv->info != NULL && priv->info->uri != NULL) | |
1077 | { | |
1078 | GFileIOStream *res; | |
1079 | GFile *real_file = g_file_new_for_uri (priv->info->uri); | |
1080 | ||
1081 | res = g_file_create_readwrite (real_file, | |
1082 | flags, | |
1083 | cancellable, | |
1084 | error); | |
1085 | 1026 | |
1086 | 1027 | g_object_unref (real_file); |
1087 | 1028 | return res; |
1330 | 1271 | iface->set_attributes_from_info = file_set_attributes_from_info; |
1331 | 1272 | iface->read_fn = file_read_fn; |
1332 | 1273 | iface->append_to = file_append_to; |
1333 | iface->create = file_create; | |
1274 | // iface->create = file_create; ### Don't support | |
1334 | 1275 | iface->replace = file_replace; |
1335 | 1276 | iface->open_readwrite = file_open_readwrite; |
1336 | iface->create_readwrite = file_create_readwrite; | |
1277 | // iface->create_readwrite = file_create_readwrite; ### Don't support | |
1337 | 1278 | iface->replace_readwrite = file_replace_readwrite; |
1338 | 1279 | iface->delete_file = file_delete; |
1339 | 1280 | iface->trash = file_trash; |