mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-12 15:47:35 +00:00
record-store: Use g_autoptr(GError) to avoid having to g_error_free
This commit is contained in:
parent
1d00c4bada
commit
b15c2876da
1 changed files with 7 additions and 14 deletions
|
@ -87,7 +87,7 @@ load_calls_fetch_cb (GomResourceGroup *group,
|
|||
CallsRecordStore *self)
|
||||
{
|
||||
gboolean ok;
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
guint count, i;
|
||||
gpointer *records;
|
||||
|
||||
|
@ -98,7 +98,6 @@ load_calls_fetch_cb (GomResourceGroup *group,
|
|||
{
|
||||
g_debug ("Error fetching call records: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
g_assert (ok);
|
||||
|
@ -147,7 +146,7 @@ load_calls_find_cb (GomRepository *repository,
|
|||
CallsRecordStore *self)
|
||||
{
|
||||
GomResourceGroup *group;
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
guint count;
|
||||
|
||||
group = gom_repository_find_finish (repository,
|
||||
|
@ -157,7 +156,6 @@ load_calls_find_cb (GomRepository *repository,
|
|||
{
|
||||
g_debug ("Error finding call records in database `%s': %s",
|
||||
self->filename, error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
g_assert (group != NULL);
|
||||
|
@ -213,7 +211,7 @@ set_up_repo_migrate_cb (GomRepository *repo,
|
|||
GAsyncResult *res,
|
||||
CallsRecordStore *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
ok = gom_repository_automatic_migrate_finish (repo, res, &error);
|
||||
|
@ -223,7 +221,6 @@ set_up_repo_migrate_cb (GomRepository *repo,
|
|||
{
|
||||
g_warning ("Error migrating call record database `%s': %s",
|
||||
self->filename, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -277,7 +274,7 @@ set_up_repo (CallsRecordStore *self)
|
|||
static void
|
||||
close_adapter (CallsRecordStore *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
if (!self->adapter)
|
||||
|
@ -292,7 +289,6 @@ close_adapter (CallsRecordStore *self)
|
|||
{
|
||||
g_warning ("Error closing call record database `%s': %s",
|
||||
self->filename, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -310,7 +306,7 @@ open_repo_adapter_open_cb (GomAdapter *adapter,
|
|||
GAsyncResult *res,
|
||||
CallsRecordStore *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
ok = gom_adapter_open_finish (adapter, res, &error);
|
||||
|
@ -320,7 +316,6 @@ open_repo_adapter_open_cb (GomAdapter *adapter,
|
|||
{
|
||||
g_warning ("Error opening call record database `%s': %s",
|
||||
self->filename, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -388,7 +383,7 @@ record_call_save_cb (GomResource *resource,
|
|||
struct CallsRecordCallData *data)
|
||||
{
|
||||
GObject * const call_obj = G_OBJECT (data->call);
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
ok = gom_resource_save_finish (resource, res, &error);
|
||||
|
@ -398,7 +393,6 @@ record_call_save_cb (GomResource *resource,
|
|||
{
|
||||
g_warning ("Error saving call record to database: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -463,7 +457,7 @@ update_cb (GomResource *resource,
|
|||
GAsyncResult *res,
|
||||
gpointer *unused)
|
||||
{
|
||||
GError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
ok = gom_resource_save_finish (resource, res, &error);
|
||||
|
@ -473,7 +467,6 @@ update_cb (GomResource *resource,
|
|||
{
|
||||
g_warning ("Error updating call record in database: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue