示例#1
0
			void OPMLWriter::WriteBody (QDomElement& root,
					QDomDocument& doc,
					const channels_shorts_t& channels) const
			{
				QDomElement body = doc.createElement ("body");
				for (channels_shorts_t::const_iterator i = channels.begin (),
						end = channels.end (); i != end; ++i)
				{
					QStringList tags = i->Tags_;
					tags.sort ();
			
					QDomElement inserter;
					inserter = LeechCraft::Util::GetElementForTags (tags,
							body, doc, "outline",
							boost::function<QString (const QDomElement&)> (TagGetter),
							boost::function<void (QDomElement&, const QString&)> (TagSetter));
					QDomElement item = doc.createElement ("outline");
					item.setAttribute ("title", i->Title_);
					item.setAttribute ("xmlUrl", i->ParentURL_);
					item.setAttribute ("htmlUrl", i->Link_);
					inserter.appendChild (item);
				}
			
				root.appendChild (body);
			}
示例#2
0
			void OPMLWriter::WriteBody (QDomElement& root,
					QDomDocument& doc,
					const channels_shorts_t& channels) const
			{
				QDomElement body = doc.createElement ("body");
				for (channels_shorts_t::const_iterator i = channels.begin (),
						end = channels.end (); i != end; ++i)
				{
					QStringList sourceTags = i->Tags_;
					QStringList tags;
					Q_FOREACH (QString st, sourceTags)
						tags << Core::Instance ().GetProxy ()->GetTagsManager ()->GetTag (st);
					tags.sort ();
			
					QDomElement inserter;
					inserter = LeechCraft::Util::GetElementForTags (tags,
							body, doc, "outline",
							boost::function<QString (const QDomElement&)> (TagGetter),
							boost::function<void (QDomElement&, const QString&)> (TagSetter));
					QDomElement item = doc.createElement ("outline");
					item.setAttribute ("title", i->Title_);
					Feed_ptr feed = Core::Instance ().GetStorageBackend ()->
							GetFeed (i->FeedID_);
					item.setAttribute ("xmlUrl", feed->URL_);
					item.setAttribute ("htmlUrl", i->Link_);
					inserter.appendChild (item);
				}
			
				root.appendChild (body);
			}