Exemplo n.º 1
0
KatzeItem*
feed_item_exists (KatzeArray* array,
                  KatzeItem*  item)
{
    const gchar* guid;
    gchar* hstr;
    guint hash;

    guid = katze_item_get_token (item);
    if (!guid)
    {
        hstr = g_strjoin (NULL,
                          katze_item_get_name (item),
                          katze_item_get_uri (item),
                          katze_item_get_text (item),
                          NULL);
        hash = g_str_hash (hstr);
        g_free (hstr);

        hstr = g_strdup_printf ("%u", hash);
        katze_item_set_token (item, hstr);
        g_free (hstr);

        guid = katze_item_get_token (item);
    }

    return (katze_array_find_token (array, guid));
}
Exemplo n.º 2
0
static void
_katze_array_update (KatzeArray* array)
{
    g_object_set_data (G_OBJECT (array), "last-update",
                       GINT_TO_POINTER (time (NULL)));
    if (!g_strcmp0 (g_getenv ("MIDORI_DEBUG"), "bookmarks") && KATZE_IS_ITEM (array))
    {
        const gchar *name = katze_item_get_name (KATZE_ITEM (array));
        if (name && *name)
        {
            g_print ("_katze_array_update: %s\n", name);
        }
    }
}
Exemplo n.º 3
0
static void
_katze_array_update (KatzeArray* array)
{
/* FIXME: remove this declaration when midory_debug is made accessible */
    extern gboolean midori_debug (const gchar* token);

    g_object_set_data (G_OBJECT (array), "last-update",
                       GINT_TO_POINTER (time (NULL)));
    if (midori_debug ("bookmarks") && KATZE_IS_ITEM (array))
    {
        const gchar *name = katze_item_get_name (KATZE_ITEM (array));
        if (name && *name)
        {
            g_print ("_katze_array_update: %s\n", name);
        }
    }
}