[libgdata] core: Remove _gdata_download_stream_find_destination()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] core: Remove _gdata_download_stream_find_destination()
- Date: Sat, 11 Dec 2010 18:33:29 +0000 (UTC)
commit ef956e38771209b1dc815e95382f006ceea04c57
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Dec 11 18:27:30 2010 +0000
core: Remove _gdata_download_stream_find_destination()
It was unused and private.
gdata/gdata-download-stream.c | 70 -----------------------------------------
gdata/gdata-private.h | 4 --
2 files changed, 0 insertions(+), 74 deletions(-)
---
diff --git a/gdata/gdata-download-stream.c b/gdata/gdata-download-stream.c
index b5091f4..f0dc9ca 100644
--- a/gdata/gdata-download-stream.c
+++ b/gdata/gdata-download-stream.c
@@ -567,73 +567,3 @@ gdata_download_stream_get_content_length (GDataDownloadStream *self)
g_return_val_if_fail (GDATA_IS_DOWNLOAD_STREAM (self), -1);
return self->priv->content_length;
}
-
-/**
- * _gdata_download_stream_find_destination:
- * @default_filename: a default filename used if the user selects a directory as the destination
- * @target_dest_file: the destination file or directory to download to
- * @actual_dest_file: will be set to reference the actual destination, which might be different from @target_dest_file
- * @replace_file_if_exists: whether to replace pre-existing files at the download location
- * @cancellable: optional #GCancellable object, or %NULL
- * @error: a #GError, or %NULL
- *
- * Sets up a download stream for a given destination.
- *
- * If @target_dest_file is a directory, then the file will be
- * downloaded into the directory with the filename specified by
- * @default_filename. Otherwise, the file will be downloaded as the
- * file specified by @target_dest_file.
- *
- * @actual_dest_file usually only differs from @target_dest_file when
- * the latter is set to a directory, and @default_filename must be
- * used. The @actual_dest_file argument should be a pointer to a %NULL
- * #GFile. Regardless, unref the #GFile returned in @actual_dest_file
- * with g_object_unref(), as it increases the ref count of
- * @target_dest_file even when they are the same.
- *
- * Return value: a #GFileOutputStream, or %NULL; unref with g_object_unref()
- *
- * Since: 0.6.0
- **/
-GFileOutputStream *
-_gdata_download_stream_find_destination (const gchar *default_filename, GFile *target_dest_file, GFile **actual_dest_file,
- gboolean replace_file_if_exists, GCancellable *cancellable, GError **error)
-{
- GFileInfo *target_dest_info;
- GFileOutputStream *dest_stream;
-
- g_return_val_if_fail (default_filename != NULL, NULL);
- g_return_val_if_fail (G_IS_FILE (target_dest_file), NULL);
- g_return_val_if_fail (actual_dest_file != NULL && *actual_dest_file == NULL, NULL);
- g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- /* handle the case where it exists as a directory, so we want to insert it in there */
- if (g_file_query_exists (target_dest_file, cancellable)) {
- target_dest_info = g_file_query_info (target_dest_file, "standard::type", G_FILE_QUERY_INFO_NONE, cancellable, error);
- if (target_dest_info == NULL)
- return NULL;
-
- if (g_file_info_get_file_type (target_dest_info) == G_FILE_TYPE_DIRECTORY)
- *actual_dest_file = g_file_get_child (target_dest_file, default_filename);
-
- g_object_unref (target_dest_info);
- }
-
- /* handle the general case (where it doesn't exist or it does but isn't a directory) */
- if (*actual_dest_file == NULL)
- *actual_dest_file = g_object_ref (target_dest_file);
-
- /* replace or create, leaving it up to the APIs to get the relevant error message */
- if (replace_file_if_exists)
- dest_stream = g_file_replace (*actual_dest_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, cancellable, error);
- else
- dest_stream = g_file_create (*actual_dest_file, G_FILE_CREATE_NONE, cancellable, error);
-
- if (dest_stream == NULL) {
- g_object_unref (*actual_dest_file);
- return NULL;
- }
-
- return dest_stream;
-}
diff --git a/gdata/gdata-private.h b/gdata/gdata-private.h
index e3f4adf..f999960 100644
--- a/gdata/gdata-private.h
+++ b/gdata/gdata-private.h
@@ -90,10 +90,6 @@ G_GNUC_INTERNAL GDataService *_gdata_documents_service_get_spreadsheet_service (
#include "gdata-parser.h"
-G_GNUC_INTERNAL GFileOutputStream *_gdata_download_stream_find_destination (const gchar *default_filename, GFile *target_dest_file, GFile **actual_dest_file,
- gboolean replace_file_if_exists,
- GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-
G_END_DECLS
#endif /* !GDATA_PRIVATE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]