87
87
QString Item::originalDescription() const
89
return extractElementTextNS(QString(), QString::fromUtf8("description"));
89
return extractElementTextNS(QString(), QLatin1String("description"));
92
92
QString Item::originalTitle() const
94
return extractElementTextNS(QString(), QString::fromUtf8("title"));
94
return extractElementTextNS(QString(), QLatin1String("title"));
97
97
QString Item::link() const
99
return extractElementTextNS(QString(), QString::fromUtf8("link") );
99
return extractElementTextNS(QString(), QLatin1String("link") );
102
102
QString Item::description() const
135
135
QString Item::comments() const
137
return extractElementTextNS(QString(), QString::fromUtf8("comments") );
137
return extractElementTextNS(QString(), QLatin1String("comments") );
140
140
QString Item::author() const
142
QString a = extractElementTextNS(QString(), QString::fromUtf8("author") );
142
QString a = extractElementTextNS(QString(), QLatin1String("author") );
178
178
bool guidIsPermaLink = true; // true is default
180
180
QDomElement guidNode = firstElementByTagNameNS(QString(),
181
QString::fromUtf8("guid"));
181
QLatin1String("guid"));
182
182
if (!guidNode.isNull())
184
if (guidNode.attribute(QString::fromUtf8("isPermaLink"))
185
== QString::fromUtf8("false"))
184
if (guidNode.attribute(QLatin1String("isPermaLink"))
185
== QLatin1String("false"))
187
187
guidIsPermaLink = false;
203
203
// if there is no pubDate, check for dc:date
204
str = extractElementTextNS(dublinCoreNamespace(), QString::fromUtf8("date"));
204
str = extractElementTextNS(dublinCoreNamespace(), QLatin1String("date"));
205
205
return parseDate(str, ISODate);
208
208
time_t Item::expirationDate() const
210
QString str = extractElementTextNS(QString(), QString::fromUtf8("expirationDate"));
210
QString str = extractElementTextNS(QString(), QLatin1String("expirationDate"));
211
211
return parseDate(str, RFCDate);
214
214
Source Item::source() const
216
return Source(firstElementByTagNameNS(QString(), QString::fromUtf8("source")));
216
return Source(firstElementByTagNameNS(QString(), QLatin1String("source")));
219
219
QString Item::rating() const
221
return extractElementTextNS(QString(), QString::fromUtf8("rating") );
221
return extractElementTextNS(QString(), QLatin1String("rating") );
224
224
QString Item::debugInfo() const
227
info += "### Item: ###################\n";
227
info += QLatin1String("### Item: ###################\n");
228
228
if (!title().isNull())
229
info += "title: #" + title() + "#\n";
229
info += QLatin1String("title: #") + title() + QLatin1String("#\n");
230
230
if (!link().isNull())
231
info += "link: #" + link() + "#\n";
231
info += QLatin1String("link: #") + link() + QLatin1String("#\n");
232
232
if (!description().isNull())
233
info += "description: #" + description() + "#\n";
233
info += QLatin1String("description: #") + description() + QLatin1String("#\n");
234
234
if (!content().isNull())
235
info += "content: #" + content() + "#\n";
235
info += QLatin1String("content: #") + content() + QLatin1String("#\n");
236
236
if (!author().isNull())
237
info += "author: #" + author() + "#\n";
237
info += QLatin1String("author: #") + author() + QLatin1String("#\n");
238
238
if (!comments().isNull())
239
info += "comments: #" + comments() + "#\n";
239
info += QLatin1String("comments: #") + comments() + QLatin1String("#\n");
240
240
QString dpubdate = dateTimeToString(pubDate());
241
241
if (!dpubdate.isNull())
242
info += "pubDate: #" + dpubdate + "#\n";
242
info += QLatin1String("pubDate: #") + dpubdate + QLatin1String("#\n");
243
243
if (!guid().isNull())
244
info += "guid: #" + guid() + "#\n";
244
info += QLatin1String("guid: #") + guid() + QLatin1String("#\n");
245
245
if (guidIsPermaLink())
246
info += "guid is PL: #true#\n";
246
info += QLatin1String("guid is PL: #true#\n");
247
247
if (!source().isNull())
248
248
info += source().debugInfo();
263
263
// TODO: do not hardcode this list here
264
264
QList<ElementType> handled;
265
handled.append(QString::fromUtf8("title"));
266
handled.append(QString::fromUtf8("link"));
267
handled.append(QString::fromUtf8("description"));
268
handled.append(QString::fromUtf8("pubDate"));
269
handled.append(QString::fromUtf8("expirationDate"));
270
handled.append(QString::fromUtf8("rating"));
271
handled.append(QString::fromUtf8("source"));
272
handled.append(QString::fromUtf8("guid"));
273
handled.append(QString::fromUtf8("comments"));
274
handled.append(QString::fromUtf8("author"));
275
handled.append(ElementType(QString::fromUtf8("date"), dublinCoreNamespace()));
265
handled.append(ElementType(QLatin1String("title")));
266
handled.append(ElementType(QLatin1String("link")));
267
handled.append(ElementType(QLatin1String("description")));
268
handled.append(ElementType(QLatin1String("pubDate")));
269
handled.append(ElementType(QLatin1String("expirationDate")));
270
handled.append(ElementType(QLatin1String("rating")));
271
handled.append(ElementType(QLatin1String("source")));
272
handled.append(ElementType(QLatin1String("guid")));
273
handled.append(ElementType(QLatin1String("comments")));
274
handled.append(ElementType(QLatin1String("author")));
275
handled.append(ElementType(QLatin1String("date"), dublinCoreNamespace()));
277
277
QList<QDomElement> notHandled;