Interprete metadata integer value of -1 as unset also when setting
This commit is contained in:
parent
f492a28764
commit
d450e55668
1 changed files with 13 additions and 6 deletions
|
@ -574,6 +574,8 @@ katze_item_get_meta_integer (KatzeItem* item,
|
|||
* Saves the specified integer value in the meta data of
|
||||
* the item under the specified key.
|
||||
*
|
||||
* A value of -1 is intepreted as unset.
|
||||
*
|
||||
* Since: 0.1.8
|
||||
**/
|
||||
void
|
||||
|
@ -584,6 +586,10 @@ katze_item_set_meta_integer (KatzeItem* item,
|
|||
g_return_if_fail (KATZE_IS_ITEM (item));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
if (value == -1)
|
||||
katze_item_set_meta_data_value (item, key, NULL);
|
||||
else
|
||||
{
|
||||
katze_item_set_meta_data_value (item, key,
|
||||
#ifdef G_GINT64_FORMAT
|
||||
g_strdup_printf ("%" G_GINT64_FORMAT, value));
|
||||
|
@ -591,6 +597,7 @@ katze_item_set_meta_integer (KatzeItem* item,
|
|||
g_strdup_printf ("%li", value));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* katze_item_get_parent:
|
||||
|
|
Loading…
Reference in a new issue