#include "feed-atom.h"
-#define atom_get_link_attribute(item, attribute) \
- (gchar*)g_object_get_data (G_OBJECT (item), attribute)
-
-#define atom_set_link_attribute(item, attribute, value) \
- g_object_set_data (G_OBJECT (item), attribute, value)
-
static gboolean
atom_is_valid (FeedParser* fparser)
{
gboolean newlink;
newlink = FALSE;
- oldtype = atom_get_link_attribute (item, "linktype");
- oldrel = atom_get_link_attribute (item, "linkrel");
+ oldtype = (gchar*)katze_item_get_meta_string (item, "feedpanel:linktype");
+ oldrel = (gchar*)katze_item_get_meta_string (item, "feedpanel:linkrel");
newtype = (gchar*)xmlGetProp (node, BAD_CAST "type");
newrel = (gchar*)xmlGetProp (node, BAD_CAST "rel");
if (newlink)
{
katze_item_set_uri (item, href);
- atom_set_link_attribute (item, "linkrel", newrel);
- atom_set_link_attribute (item, "linktype", newrel);
- }
- else
- {
- xmlFree (href);
- xmlFree (newrel);
- xmlFree (newtype);
+ katze_item_set_meta_string (item, "feedpanel:linkrel", newrel);
+ katze_item_set_meta_string (item, "feedpanel:linktype", newtype);
}
+
+ xmlFree (href);
+ xmlFree (newrel);
+ xmlFree (newtype);
}
static gchar*
atom_get_title (FeedParser* fparser)
{
- if (!katze_item_get_name (fparser->item))
+ const gchar* name;
+
+ if (!(name = katze_item_get_name (fparser->item)))
{
gchar* type;
if (content)
return content;
}
+ return feed_get_element_string (fparser);
}
- return feed_get_element_string (fparser);
+ return g_strdup (name);
}
static void
if (KATZE_IS_ITEM (fparser->item))
{
- atom_set_link_attribute (fparser->item, "linkrel", NULL);
- atom_set_link_attribute (fparser->item, "linktype", NULL);
+ katze_item_set_meta_string (fparser->item, "feedpanel:linkrel", NULL);
+ katze_item_set_meta_string (fparser->item, "feedpanel:linktype", NULL);
if (*fparser->error)
{
{
if (KATZE_IS_ARRAY (fparser->item))
{
- atom_set_link_attribute (fparser->item, "linkrel", NULL);
- atom_set_link_attribute (fparser->item, "linktype", NULL);
+ katze_item_set_meta_string (fparser->item, "feedpanel:linkrel", NULL);
+ katze_item_set_meta_string (fparser->item, "feedpanel:linktype", NULL);
}
if (!*fparser->error)
#define UPDATE_FREQ 10
#define feed_get_flags(feed) \
- GPOINTER_TO_INT (g_object_get_data (G_OBJECT ((feed)), "flags"))
+ katze_item_get_meta_integer (KATZE_ITEM ((feed)), "feedpanel:flags")
#define feed_set_flags(feed, flags) \
- g_object_set_data (G_OBJECT ((feed)), "flags", \
- GINT_TO_POINTER ((flags)))
+ katze_item_set_meta_integer (KATZE_ITEM ((feed)), "feedpanel:flags", (flags))
#define feed_has_flags(feed, flags) \
((flags) & feed_get_flags ((feed)))