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)
|
CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
guint count, i;
|
guint count, i;
|
||||||
gpointer *records;
|
gpointer *records;
|
||||||
|
|
||||||
|
@ -98,7 +98,6 @@ load_calls_fetch_cb (GomResourceGroup *group,
|
||||||
{
|
{
|
||||||
g_debug ("Error fetching call records: %s",
|
g_debug ("Error fetching call records: %s",
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free (error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_assert (ok);
|
g_assert (ok);
|
||||||
|
@ -147,7 +146,7 @@ load_calls_find_cb (GomRepository *repository,
|
||||||
CallsRecordStore *self)
|
CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
GomResourceGroup *group;
|
GomResourceGroup *group;
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
guint count;
|
guint count;
|
||||||
|
|
||||||
group = gom_repository_find_finish (repository,
|
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",
|
g_debug ("Error finding call records in database `%s': %s",
|
||||||
self->filename, error->message);
|
self->filename, error->message);
|
||||||
g_error_free (error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_assert (group != NULL);
|
g_assert (group != NULL);
|
||||||
|
@ -213,7 +211,7 @@ set_up_repo_migrate_cb (GomRepository *repo,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
CallsRecordStore *self)
|
CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
|
||||||
ok = gom_repository_automatic_migrate_finish (repo, res, &error);
|
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",
|
g_warning ("Error migrating call record database `%s': %s",
|
||||||
self->filename, error->message);
|
self->filename, error->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -277,7 +274,7 @@ set_up_repo (CallsRecordStore *self)
|
||||||
static void
|
static void
|
||||||
close_adapter (CallsRecordStore *self)
|
close_adapter (CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
|
||||||
if (!self->adapter)
|
if (!self->adapter)
|
||||||
|
@ -292,7 +289,6 @@ close_adapter (CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
g_warning ("Error closing call record database `%s': %s",
|
g_warning ("Error closing call record database `%s': %s",
|
||||||
self->filename, error->message);
|
self->filename, error->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -310,7 +306,7 @@ open_repo_adapter_open_cb (GomAdapter *adapter,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
CallsRecordStore *self)
|
CallsRecordStore *self)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
|
||||||
ok = gom_adapter_open_finish (adapter, res, &error);
|
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",
|
g_warning ("Error opening call record database `%s': %s",
|
||||||
self->filename, error->message);
|
self->filename, error->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -388,7 +383,7 @@ record_call_save_cb (GomResource *resource,
|
||||||
struct CallsRecordCallData *data)
|
struct CallsRecordCallData *data)
|
||||||
{
|
{
|
||||||
GObject * const call_obj = G_OBJECT (data->call);
|
GObject * const call_obj = G_OBJECT (data->call);
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
|
||||||
ok = gom_resource_save_finish (resource, res, &error);
|
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",
|
g_warning ("Error saving call record to database: %s",
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -463,7 +457,7 @@ update_cb (GomResource *resource,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
gpointer *unused)
|
gpointer *unused)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
|
||||||
ok = gom_resource_save_finish (resource, res, &error);
|
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",
|
g_warning ("Error updating call record in database: %s",
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue