summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/db
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-11 22:08:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-11 22:08:42 (GMT)
commit1c2949f6828b995c7b9f8feba8fd7214f52f8f4d (patch)
tree0bdff13f6ac8d87725d6783a2f1ecc7511426cd1 /plugins/pychrysalide/analysis/db
parent83faef9c8f78b20cb031af686f763cfb215cf9d7 (diff)
Built suitable dynamic labels for bookmarks.
Diffstat (limited to 'plugins/pychrysalide/analysis/db')
-rw-r--r--plugins/pychrysalide/analysis/db/item.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/pychrysalide/analysis/db/item.c b/plugins/pychrysalide/analysis/db/item.c
index bbaa21b..7bb96c2 100644
--- a/plugins/pychrysalide/analysis/db/item.c
+++ b/plugins/pychrysalide/analysis/db/item.c
@@ -25,6 +25,7 @@
#include "item.h"
+#include <malloc.h>
#include <pygobject.h>
@@ -44,6 +45,9 @@ static PyObject *py_db_item_add_flag(PyObject *, PyObject *);
/* Retire une propriété à un élément de base de données. */
static PyObject *py_db_item_remove_flag(PyObject *, PyObject *);
+/* Décrit l'élément de collection en place. */
+static PyObject *py_db_item_get_label(PyObject *, void *);
+
/* Indique si l'élément contient des données à oublier ou non. */
static PyObject *py_db_item_get_volatile(PyObject *, void *);
@@ -142,6 +146,44 @@ static PyObject *py_db_item_remove_flag(PyObject *self, PyObject *args)
* Paramètres : self = objet Python concerné par l'appel. *
* closure = non utilisé ici. *
* *
+* Description : Décrit l'élément de collection en place. *
+* *
+* Retour : Chaîne de caractère correspondante. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_db_item_get_label(PyObject *self, void *closure)
+{
+ PyObject *result; /* Valeur à retourner */
+ GDbItem *item; /* Elément à consulter */
+ char *label; /* Etiquette de représentation */
+
+#define DB_ITEM_LABEL_ATTRIB PYTHON_GET_DEF_FULL \
+( \
+ label, py_db_item, \
+ "String describing the effect of the database item." \
+)
+
+ item = G_DB_ITEM(pygobject_get(self));
+
+ label = g_db_item_get_label(item);
+
+ result = PyUnicode_FromString(label);
+
+ free(label);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : self = objet Python concerné par l'appel. *
+* closure = non utilisé ici. *
+* *
* Description : Indique si l'élément contient des données à oublier ou non. *
* *
* Retour : Etat de la sauegarde de l'élément consulté. *
@@ -259,6 +301,7 @@ PyTypeObject *get_python_db_item_type(void)
"volatile", py_db_item_get_volatile, py_db_item_set_volatile,
"Define if a Database item can be forgotten.", NULL
},
+ DB_ITEM_LABEL_ATTRIB,
DB_ITEM_FLAGS_ATTRIB,
{ NULL }
};