Skip to content

Commit

Permalink
added direct support for local files as sources of feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrotter committed Oct 16, 2023
1 parent 6100e56 commit a4bf57f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librssguard/services/standard/gui/standardfeeddetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) {
QVariant::fromValue(StandardFeed::SourceType::Url));
m_ui.m_cmbSourceType->addItem(StandardFeed::sourceTypeToString(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.
m_ui.m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Type::Atom10),
Expand Down
3 changes: 3 additions & 0 deletions src/librssguard/services/standard/standardfeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ StandardFeed* StandardFeed::guessFeed(StandardFeed::SourceType source_type,
throw NetworkException(network_result.m_networkError);
}
}
else if (source_type == StandardFeed::SourceType::LocalFile) {
feed_contents = IOFactory::readFile(source);
}
else {
qDebugNN << LOGSEC_CORE << "Running custom script for guessing" << QUOTE_W_SPACE(source) << "to obtain feed data.";

Expand Down
3 changes: 3 additions & 0 deletions src/librssguard/services/standard/standardserviceroot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
#endif
}
}
else if (f->sourceType() == StandardFeed::SourceType::LocalFile) {
feed_contents = IOFactory::readFile(feed->source());
}
else {
qDebugNN << LOGSEC_CORE << "Running custom script" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";

Expand Down

0 comments on commit a4bf57f

Please sign in to comment.