typedef QMap<int, QStringList> RssParams;
/* read a static rss version 1/2 file and return QMap params of link title description */
RssParams ReadRssFile
( QString fileplace ,
int limiter
){
RssParams contingent;
QFile xmlfile
( fileplace
);
int errorLine, errorColumn, position;
position = 0 -1;
return contingent;
}
if (!doc.setContent(&xmlfile,true, &errorStr, &errorLine, &errorColumn)) {
xmlfile.close();
return contingent;
}
QDomElement chanelbase
= root.
firstChildElement("channel");
QDomElement child
= chanelbase.
firstChildElement("item");
while (!child.isNull()) {
QString title
= child.
firstChildElement("title").
text();
QString desc
= child.
firstChildElement("description").
text();
QString urirss
= child.
firstChildElement("link").
text();
if (!title.isEmpty() and !desc.isEmpty() and !urirss.isEmpty()) {
position++;
if (position < limiter) {
contingent.
insert(position,
QStringList() << encodeBase64
(urirss
) << encodeBase64
(title
) << encodeBase64
(desc
));
}
}
child = child.nextSiblingElement("item");
}
xmlfile.close();
return contingent;
}