[gnome-photos/wip/rishi/double-buffering: 2/7] application, base-item: Rename a function for consistency
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/double-buffering: 2/7] application, base-item: Rename a function for consistency
- Date: Thu, 26 Jan 2017 16:58:23 +0000 (UTC)
commit f100dbc997232ec0687471e16f814fe9e334fee3
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Jan 19 20:27:47 2017 +0100
application, base-item: Rename a function for consistency
Methods that are not dealing with a single specific operation use the
photos_base_item_pipeline_* prefix. Since 'revert' is about reverting
the pipeline as a whole, that's what it should use.
Note that 'revert_to_original' already follows this nomenclature.
src/photos-application.c | 8 ++++----
src/photos-base-item.c | 36 ++++++++++++++++++------------------
src/photos-base-item.h | 18 +++++++++---------
3 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 43d1896..5e102f4 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -749,7 +749,7 @@ photos_application_edit_cancel_process (GObject *source_object, GAsyncResult *re
GError *error = NULL;
PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
- if (!photos_base_item_operations_revert_finish (item, res, &error))
+ if (!photos_base_item_pipeline_revert_finish (item, res, &error))
{
g_warning ("Unable to process item: %s", error->message);
g_error_free (error);
@@ -774,7 +774,7 @@ photos_application_edit_cancel (PhotosApplication *self)
g_return_if_fail (item != NULL);
g_application_hold (G_APPLICATION (self));
- photos_base_item_operations_revert_async (item, NULL, photos_application_edit_cancel_process, self);
+ photos_base_item_pipeline_revert_async (item, NULL, photos_application_edit_cancel_process, self);
}
@@ -817,7 +817,7 @@ photos_application_edit_revert_revert (GObject *source_object, GAsyncResult *res
PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
error = NULL;
- if (!photos_base_item_operations_revert_finish (item, res, &error))
+ if (!photos_base_item_pipeline_revert_finish (item, res, &error))
{
g_warning ("Unable to process item: %s", error->message);
g_error_free (error);
@@ -845,7 +845,7 @@ photos_application_edit_revert (PhotosApplication *self, GVariant *parameter)
g_return_if_fail (item != NULL);
g_application_hold (G_APPLICATION (self));
- photos_base_item_operations_revert_async (item, NULL, photos_application_edit_revert_revert, self);
+ photos_base_item_pipeline_revert_async (item, NULL, photos_application_edit_revert_revert, self);
}
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 1c5e305..f79324a 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -3508,10 +3508,10 @@ photos_base_item_operation_remove_finish (PhotosBaseItem *self, GAsyncResult *re
void
-photos_base_item_operations_revert_async (PhotosBaseItem *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+photos_base_item_pipeline_is_edited_async (PhotosBaseItem *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
PhotosBaseItemPrivate *priv;
GTask *task;
@@ -3521,25 +3521,23 @@ photos_base_item_operations_revert_async (PhotosBaseItem *self,
g_return_if_fail (!priv->collection);
- photos_pipeline_revert (priv->pipeline);
-
task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, photos_base_item_operations_revert_async);
+ g_task_set_source_tag (task, photos_base_item_pipeline_is_edited_async);
- photos_base_item_process_async (self, cancellable, photos_base_item_common_process, g_object_ref (task));
+ photos_base_item_load_async (self, cancellable, photos_base_item_pipeline_is_edited_load, g_object_ref
(task));
g_object_unref (task);
}
gboolean
-photos_base_item_operations_revert_finish (PhotosBaseItem *self, GAsyncResult *res, GError **error)
+photos_base_item_pipeline_is_edited_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_operations_revert_async, FALSE);
+ g_return_val_if_fail (g_task_get_source_tag (task) == photos_base_item_pipeline_is_edited_async, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return g_task_propagate_boolean (task, error);
@@ -3547,10 +3545,10 @@ photos_base_item_operations_revert_finish (PhotosBaseItem *self, GAsyncResult *r
void
-photos_base_item_pipeline_is_edited_async (PhotosBaseItem *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+photos_base_item_pipeline_revert_async (PhotosBaseItem *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
PhotosBaseItemPrivate *priv;
GTask *task;
@@ -3560,23 +3558,25 @@ photos_base_item_pipeline_is_edited_async (PhotosBaseItem *self,
g_return_if_fail (!priv->collection);
+ photos_pipeline_revert (priv->pipeline);
+
task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, photos_base_item_pipeline_is_edited_async);
+ g_task_set_source_tag (task, photos_base_item_pipeline_revert_async);
- photos_base_item_load_async (self, cancellable, photos_base_item_pipeline_is_edited_load, g_object_ref
(task));
+ photos_base_item_process_async (self, cancellable, photos_base_item_common_process, g_object_ref (task));
g_object_unref (task);
}
gboolean
-photos_base_item_pipeline_is_edited_finish (PhotosBaseItem *self, GAsyncResult *res, GError **error)
+photos_base_item_pipeline_revert_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_pipeline_is_edited_async, FALSE);
+ g_return_val_if_fail (g_task_get_source_tag (task) == photos_base_item_pipeline_revert_async, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return g_task_propagate_boolean (task, error);
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index cf8a1df..4b4f2b9 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -225,15 +225,6 @@ gboolean photos_base_item_operation_remove_finish (PhotosBaseItem *se
GAsyncResult *res,
GError **error);
-void photos_base_item_operations_revert_async (PhotosBaseItem *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean photos_base_item_operations_revert_finish(PhotosBaseItem *self,
- GAsyncResult *res,
- GError **error);
-
void photos_base_item_pipeline_is_edited_async (PhotosBaseItem *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -243,6 +234,15 @@ gboolean photos_base_item_pipeline_is_edited_finish (PhotosBa
GAsyncResult *res,
GError **error);
+void photos_base_item_pipeline_revert_async (PhotosBaseItem *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean photos_base_item_pipeline_revert_finish (PhotosBaseItem *self,
+ GAsyncResult *res,
+ GError **error);
+
void photos_base_item_pipeline_revert_to_original_async (PhotosBaseItem *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]