[gom] gom: Mark resources as from table after it is inserted
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] gom: Mark resources as from table after it is inserted
- Date: Tue, 5 Aug 2014 11:03:21 +0000 (UTC)
commit 0b104be3d580c7596452a70afe669d12baccc53e
Author: Jonathon Jongsma <jjongsma redhat com>
Date: Thu Jul 31 11:06:14 2014 +0200
gom: Mark resources as from table after it is inserted
Previously, if you create a new resource, then call
gom_resource_save_*(), then change some properties and call _save()
again, it will insert another item into the repository. With this
change, it will mark the resource as being from the table, so that the
next time save() is called, it was UPDATE, rather than INSERT.
https://bugzilla.gnome.org/show_bug.cgi?id=734029
gom/gom-resource.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gom/gom-resource.c b/gom/gom-resource.c
index 54c2b95..a8cfcf2 100644
--- a/gom/gom-resource.c
+++ b/gom/gom-resource.c
@@ -604,6 +604,7 @@ gom_resource_do_save (GomResource *resource,
g_value_init(&value, G_TYPE_INT64);
g_value_set_int64(&value, row_id);
set_pkey(resource, &value);
+ gom_resource_set_is_from_table(resource, TRUE);
g_value_unset(&value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]