diff options
Diffstat (limited to 'src/analysis/db')
| -rw-r--r-- | src/analysis/db/item.c | 14 | ||||
| -rw-r--r-- | src/analysis/db/item.h | 2 | 
2 files changed, 9 insertions, 7 deletions
| diff --git a/src/analysis/db/item.c b/src/analysis/db/item.c index 62e8ce9..243e97b 100644 --- a/src/analysis/db/item.c +++ b/src/analysis/db/item.c @@ -241,7 +241,7 @@ gint g_db_item_cmp(GDbItem *a, GDbItem *b, bool with)          result = cmp_timestamp(&a->created, &b->created);      if (result == 0) -        result = strcmp(a->label, b->label); +        result = strcmp(g_db_item_get_label(a), g_db_item_get_label(b));      return result; @@ -343,8 +343,6 @@ bool g_db_item_recv(GDbItem *item, int fd, int flags)      result = G_DB_ITEM_GET_CLASS(item)->recv(item, fd, flags); -    G_DB_ITEM_GET_CLASS(item)->build_label(item); -      return result;  } @@ -470,8 +468,14 @@ bool g_db_item_cancel(GDbItem *item, GLoadedBinary *binary)  *                                                                             *  ******************************************************************************/ -const char *g_db_item_get_label(const GDbItem *item) +const char *g_db_item_get_label(GDbItem *item)  { +    if (item->label == NULL) +    { +        G_DB_ITEM_GET_CLASS(item)->build_label(item); +        assert(item->label != NULL); +    } +      return item->label;  } @@ -721,8 +725,6 @@ bool g_db_item_load(GDbItem *item, const bound_value *values, size_t count)      result = G_DB_ITEM_GET_CLASS(item)->load(item, values, count); -    G_DB_ITEM_GET_CLASS(item)->build_label(item); -      return result;  } diff --git a/src/analysis/db/item.h b/src/analysis/db/item.h index f8bb707..afeaed3 100644 --- a/src/analysis/db/item.h +++ b/src/analysis/db/item.h @@ -85,7 +85,7 @@ bool g_db_item_apply(GDbItem *, GLoadedBinary *);  bool g_db_item_cancel(GDbItem *, GLoadedBinary *);  /* Décrit l'élément de collection en place. */ -const char *g_db_item_get_label(const GDbItem *); +const char *g_db_item_get_label(GDbItem *);  /* Fournit l'horodatage associé à l'élément de collection. */  timestamp_t g_db_item_get_timestamp(const GDbItem *); | 
