[gnome-photos] base-item: Rename save_async as save_to_dir_async
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Rename save_async as save_to_dir_async
- Date: Sun, 24 Sep 2017 16:26:40 +0000 (UTC)
commit b28c7df1bedc5f0e987514f8f9fc19af75cd10e1
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Sep 22 15:37:20 2017 +0200
base-item: Rename save_async as save_to_dir_async
A following patch will add a method to save a BaseItem to a specific
file, as opposed to a generated filename inside a specified directory.
Renaming this method makes its purpose more explicit and prevents any
future ambiguity.
https://bugzilla.gnome.org/show_bug.cgi?id=788042
src/photos-application.c | 6 +++---
src/photos-base-item.c | 34 +++++++++++++++++-----------------
src/photos-base-item.h | 4 ++--
src/photos-share-point-email.c | 16 ++++++++--------
4 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index e418023..6838f05 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -1252,7 +1252,7 @@ photos_application_quit (PhotosApplication *self)
static void
-photos_application_save_save (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_application_save_save_to_dir (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosApplication *self = PHOTOS_APPLICATION (user_data);
PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
@@ -1260,7 +1260,7 @@ photos_application_save_save (GObject *source_object, GAsyncResult *res, gpointe
GFile *file = NULL;
GList *items = NULL;
- file = photos_base_item_save_finish (item, res, &error);
+ file = photos_base_item_save_to_dir_finish (item, res, &error);
if (error != NULL)
{
g_warning ("Unable to save: %s", error->message);
@@ -1342,7 +1342,7 @@ photos_application_save_response (GtkDialog *dialog, gint response_id, gpointer
zoom = photos_export_dialog_get_zoom (PHOTOS_EXPORT_DIALOG (dialog));
g_application_hold (G_APPLICATION (self));
- photos_base_item_save_async (item, export, zoom, NULL, photos_application_save_save, self);
+ photos_base_item_save_to_dir_async (item, export, zoom, NULL, photos_application_save_save_to_dir, self);
out:
g_free (export_path);
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 2b1fdfc..1319d44 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -2057,7 +2057,7 @@ photos_base_item_save_buffer_finish (PhotosBaseItem *self, GAsyncResult *res, GE
static void
-photos_base_item_save_save_buffer (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_base_item_save_to_dir_save_buffer (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosBaseItem *self = PHOTOS_BASE_ITEM (source_object);
GError *error;
@@ -2081,7 +2081,7 @@ photos_base_item_save_save_buffer (GObject *source_object, GAsyncResult *res, gp
static void
-photos_base_item_save_file_create (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_base_item_save_to_dir_file_create (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosBaseItem *self;
GTask *task = G_TASK (user_data);
@@ -2112,7 +2112,7 @@ photos_base_item_save_file_create (GObject *source_object, GAsyncResult *res, gp
unique_file,
stream,
cancellable,
- photos_base_item_save_save_buffer,
+ photos_base_item_save_to_dir_save_buffer,
g_object_ref (task));
out:
@@ -2123,7 +2123,7 @@ photos_base_item_save_file_create (GObject *source_object, GAsyncResult *res, gp
static void
-photos_base_item_save_buffer_zoom (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_base_item_save_to_dir_buffer_zoom (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GTask *task = G_TASK (user_data);
PhotosBaseItem *self;
@@ -2164,7 +2164,7 @@ photos_base_item_save_buffer_zoom (GObject *source_object, GAsyncResult *res, gp
G_FILE_CREATE_NONE,
G_PRIORITY_DEFAULT,
cancellable,
- photos_base_item_save_file_create,
+ photos_base_item_save_to_dir_file_create,
g_object_ref (task));
out:
@@ -2177,7 +2177,7 @@ photos_base_item_save_buffer_zoom (GObject *source_object, GAsyncResult *res, gp
static void
-photos_base_item_save_load (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_base_item_save_to_dir_load (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosBaseItem *self = PHOTOS_BASE_ITEM (source_object);
GCancellable *cancellable;
@@ -2202,7 +2202,7 @@ photos_base_item_save_load (GObject *source_object, GAsyncResult *res, gpointer
photos_gegl_buffer_zoom_async (buffer,
data->zoom,
cancellable,
- photos_base_item_save_buffer_zoom,
+ photos_base_item_save_to_dir_buffer_zoom,
g_object_ref (task));
out:
@@ -4021,12 +4021,12 @@ photos_base_item_refresh (PhotosBaseItem *self)
void
-photos_base_item_save_async (PhotosBaseItem *self,
- GFile *dir,
- gdouble zoom,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+photos_base_item_save_to_dir_async (PhotosBaseItem *self,
+ GFile *dir,
+ gdouble zoom,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
PhotosBaseItemPrivate *priv;
GTask *task;
@@ -4042,23 +4042,23 @@ photos_base_item_save_async (PhotosBaseItem *self,
data = photos_base_item_save_data_new (dir, NULL, NULL, zoom);
task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, photos_base_item_save_async);
+ g_task_set_source_tag (task, photos_base_item_save_to_dir_async);
g_task_set_task_data (task, data, (GDestroyNotify) photos_base_item_save_data_free);
- photos_base_item_load_async (self, cancellable, photos_base_item_save_load, g_object_ref (task));
+ photos_base_item_load_async (self, cancellable, photos_base_item_save_to_dir_load, g_object_ref (task));
g_object_unref (task);
}
GFile *
-photos_base_item_save_finish (PhotosBaseItem *self, GAsyncResult *res, GError **error)
+photos_base_item_save_to_dir_finish (PhotosBaseItem *self, GAsyncResult *res, GError **error)
{
GTask *task = G_TASK (res);
g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (self), FALSE);
g_return_val_if_fail (g_task_is_valid (res, self), FALSE);
- g_return_val_if_fail (g_task_get_source_tag (task) == photos_base_item_save_async, FALSE);
+ g_return_val_if_fail (g_task_get_source_tag (task) == photos_base_item_save_to_dir_async, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return g_task_propagate_pointer (task, error);
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 44e157e..863123c 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -269,14 +269,14 @@ void photos_base_item_print (PhotosBaseItem *se
void photos_base_item_refresh (PhotosBaseItem *self);
-void photos_base_item_save_async (PhotosBaseItem *self,
+void photos_base_item_save_to_dir_async (PhotosBaseItem *self,
GFile *dir,
gdouble zoom,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-GFile *photos_base_item_save_finish (PhotosBaseItem *self,
+GFile *photos_base_item_save_to_dir_finish (PhotosBaseItem *self,
GAsyncResult *res,
GError **error) G_GNUC_WARN_UNUSED_RESULT;
diff --git a/src/photos-share-point-email.c b/src/photos-share-point-email.c
index 44ca848..66e8538 100644
--- a/src/photos-share-point-email.c
+++ b/src/photos-share-point-email.c
@@ -82,7 +82,7 @@ photos_share_point_email_get_name (PhotosSharePoint *share_point)
static void
-photos_share_point_email_share_save (GObject *source_object, GAsyncResult *res, gpointer user_data)
+photos_share_point_email_share_save_to_dir (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosSharePointEmail *self;
GError *error;
@@ -96,7 +96,7 @@ photos_share_point_email_share_save (GObject *source_object, GAsyncResult *res,
self = PHOTOS_SHARE_POINT_EMAIL (g_task_get_source_object (task));
error = NULL;
- file = photos_base_item_save_finish (item, res, &error);
+ file = photos_base_item_save_to_dir_finish (item, res, &error);
if (error != NULL)
{
g_task_return_error (task, error);
@@ -148,12 +148,12 @@ photos_share_point_email_share_async (PhotosSharePoint *share_point,
g_mkdtemp (export_dir);
export = g_file_new_for_path (export_dir);
- photos_base_item_save_async (item,
- export,
- 1.0,
- cancellable,
- photos_share_point_email_share_save,
- g_object_ref (task));
+ photos_base_item_save_to_dir_async (item,
+ export,
+ 1.0,
+ cancellable,
+ photos_share_point_email_share_save_to_dir,
+ g_object_ref (task));
g_free (export_dir);
g_free (template);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]