Logo Search packages:      
Sourcecode: akregator version File versions

Feed * Feed::fromOPML ( QDomElement  e  )  [static]

creates a Feed object from a description in OPML format

Definition at line 54 of file feed.cpp.

References archiveMode(), description(), Feed(), fetchInterval(), htmlUrl(), markImmediatelyAsRead(), maxArticleAge(), maxArticleNumber(), setArchiveMode(), setCustomFetchIntervalEnabled(), setDescription(), setFetchInterval(), setHtmlUrl(), Akregator::TreeNode::setId(), setMarkImmediatelyAsRead(), setMaxArticleAge(), setMaxArticleNumber(), Akregator::TreeNode::setTitle(), setUseNotification(), setXmlUrl(), stringToArchiveMode(), Akregator::TreeNode::title(), useCustomFetchInterval(), and xmlUrl().

{
    
    Feed* feed = 0;
    
    if( e.hasAttribute("xmlUrl") || e.hasAttribute("xmlurl") ) 
    {
        QString title = e.hasAttribute("text") ? e.attribute("text") : e.attribute("title");
        
        QString xmlUrl = e.hasAttribute("xmlUrl") ? e.attribute("xmlUrl") : e.attribute("xmlurl");

        bool useCustomFetchInterval = e.attribute("y") == "true";
        
        QString htmlUrl = e.attribute("htmlUrl");
        QString description = e.attribute("description");
        int fetchInterval = e.attribute("fetchInterval").toUInt();
        ArchiveMode archiveMode = stringToArchiveMode(e.attribute("archiveMode"));
        int maxArticleAge = e.attribute("maxArticleAge").toUInt();
        int maxArticleNumber = e.attribute("maxArticleNumber").toUInt();
        bool markImmediatelyAsRead = e.attribute("markImmediatelyAsRead") == "true";
        bool useNotification = e.attribute("useNotification") == "true";
        uint id = e.attribute("id").toUInt();
        
        feed = new Feed();
        feed->setTitle(title);
        feed->setXmlUrl(xmlUrl);
        feed->setCustomFetchIntervalEnabled(useCustomFetchInterval);
        feed->setHtmlUrl(htmlUrl);
        feed->setId(id);
        feed->setDescription(description);
        feed->setArchiveMode(archiveMode);
        feed->setFetchInterval(fetchInterval);
        feed->setMaxArticleAge(maxArticleAge);
        feed->setMaxArticleNumber(maxArticleNumber);
        feed->setMarkImmediatelyAsRead(markImmediatelyAsRead);
        feed->setUseNotification(useNotification);
    }   
    
    return feed;
}            


Generated by  Doxygen 1.6.0   Back to index