summaryrefslogtreecommitdiff
path: root/src/analysis/db/item.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-12 18:42:20 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-12 18:42:20 (GMT)
commit57f6179e22f880bbcff031714e8576cf9bd488ac (patch)
tree399fce4b52f3d42162a91578bd3ef2e460307229 /src/analysis/db/item.c
parent607a867355b2ffe09a76f3b4ea8dbc4be1dc477f (diff)
Cleaned the DB code a little bit.
Diffstat (limited to 'src/analysis/db/item.c')
-rw-r--r--src/analysis/db/item.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/analysis/db/item.c b/src/analysis/db/item.c
index a403537..2eb31b1 100644
--- a/src/analysis/db/item.c
+++ b/src/analysis/db/item.c
@@ -157,7 +157,6 @@ static void g_db_item_dispose(GDbItem *item)
static void g_db_item_finalize(GDbItem *item)
{
exit_rle_string(&item->author);
- exit_rle_string(&item->tool);
G_OBJECT_CLASS(g_db_item_parent_class)->finalize(G_OBJECT(item));
@@ -314,9 +313,6 @@ static bool _g_db_item_unpack(GDbItem *item, packed_buffer *pbuf)
if (result)
result = unpack_rle_string(&item->author, pbuf);
- if (result)
- result = unpack_rle_string(&item->tool, pbuf);
-
return result;
}
@@ -371,9 +367,6 @@ static bool _g_db_item_pack(const GDbItem *item, packed_buffer *pbuf)
if (result)
result = pack_rle_string(&item->author, pbuf);
- if (result)
- result = pack_rle_string(&item->tool, pbuf);
-
return result;
}
@@ -662,15 +655,13 @@ static bool _g_db_item_load(GDbItem *item, const bound_value *values, size_t cou
{
bool result; /* Bilan global à retourner */
- result = true;
+ result = load_timestamp(&item->created, "created", values, count);
- result &= load_timestamp(&item->created, "created", values, count);
-
- result &= load_timestamp(&item->timestamp, "timestamp", values, count);
-
- result &= load_rle_string(&item->author, "author", values, count);
+ if (result)
+ result = load_timestamp(&item->timestamp, "timestamp", values, count);
- result &= load_rle_string(&item->tool, "tool", values, count);
+ if (result)
+ result = load_rle_string(&item->author, "author", values, count);
return result;
@@ -741,14 +732,6 @@ static bool _g_db_item_store(const GDbItem *item, bound_value **values, size_t *
result = store_rle_string(&item->author, "author", values, count);
}
- if (result)
- {
- if (item == NULL)
- result = store_rle_string(NULL, "tool", values, count);
- else
- result = store_rle_string(&item->tool, "tool", values, count);
- }
-
return result;
}