added direct support for local files as sources of feeds
This commit is contained in:
parent
6100e56985
commit
a4bf57f971
@ -40,6 +40,8 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) {
|
|||||||
QVariant::fromValue(StandardFeed::SourceType::Url));
|
QVariant::fromValue(StandardFeed::SourceType::Url));
|
||||||
m_ui.m_cmbSourceType->addItem(StandardFeed::sourceTypeToString(StandardFeed::SourceType::Script),
|
m_ui.m_cmbSourceType->addItem(StandardFeed::sourceTypeToString(StandardFeed::SourceType::Script),
|
||||||
QVariant::fromValue(StandardFeed::SourceType::Script));
|
QVariant::fromValue(StandardFeed::SourceType::Script));
|
||||||
|
m_ui.m_cmbSourceType->addItem(StandardFeed::sourceTypeToString(StandardFeed::SourceType::LocalFile),
|
||||||
|
QVariant::fromValue(StandardFeed::SourceType::LocalFile));
|
||||||
|
|
||||||
// Add standard feed types.
|
// Add standard feed types.
|
||||||
m_ui.m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Type::Atom10),
|
m_ui.m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Type::Atom10),
|
||||||
|
@ -264,6 +264,9 @@ StandardFeed* StandardFeed::guessFeed(StandardFeed::SourceType source_type,
|
|||||||
throw NetworkException(network_result.m_networkError);
|
throw NetworkException(network_result.m_networkError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (source_type == StandardFeed::SourceType::LocalFile) {
|
||||||
|
feed_contents = IOFactory::readFile(source);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
qDebugNN << LOGSEC_CORE << "Running custom script for guessing" << QUOTE_W_SPACE(source) << "to obtain feed data.";
|
qDebugNN << LOGSEC_CORE << "Running custom script for guessing" << QUOTE_W_SPACE(source) << "to obtain feed data.";
|
||||||
|
|
||||||
|
@ -199,6 +199,9 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (f->sourceType() == StandardFeed::SourceType::LocalFile) {
|
||||||
|
feed_contents = IOFactory::readFile(feed->source());
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
qDebugNN << LOGSEC_CORE << "Running custom script" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
qDebugNN << LOGSEC_CORE << "Running custom script" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user