mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-03 18:57:37 +01:00
fix icalendar regression
This commit is contained in:
parent
25c70b363c
commit
c74d24a4ed
@ -58,7 +58,7 @@ QList<StandardFeed*> IcalParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
||||
|
||||
QPair<StandardFeed*, QList<IconLocation>> IcalParser::guessFeed(const QByteArray& content,
|
||||
const QString& content_type) const {
|
||||
if (content_type.contains(QSL("text/calendar")) || content.contains("\r\n")) {
|
||||
if (content_type.contains(QSL("text/calendar")) || content.startsWith(QSL("BEGIN").toLocal8Bit())) {
|
||||
Icalendar calendar;
|
||||
|
||||
try {
|
||||
@ -174,7 +174,9 @@ QString IcalParser::objMessageRawContents(const QVariant& msg_element) const {
|
||||
}
|
||||
|
||||
Icalendar::Icalendar(const QByteArray& data) : FeedParser(QString::fromUtf8(data), FeedParser::DataType::Other) {
|
||||
if (!data.isEmpty()) {
|
||||
processLines(m_data);
|
||||
}
|
||||
}
|
||||
|
||||
QString Icalendar::title() const {
|
||||
@ -192,6 +194,10 @@ void Icalendar::processLines(const QString& data) {
|
||||
|
||||
auto all_matches = regex.globalMatch(data);
|
||||
|
||||
if (!all_matches.hasNext()) {
|
||||
throw ApplicationException(QObject::tr("required iCal data are missing"));
|
||||
}
|
||||
|
||||
while (all_matches.hasNext()) {
|
||||
auto match = all_matches.next();
|
||||
QString component = match.captured(1);
|
||||
@ -355,7 +361,7 @@ QDateTime EventComponent::startsOn(const QMap<QString, QTimeZone>& time_zones, b
|
||||
return dat;
|
||||
}
|
||||
|
||||
QDateTime EventComponent::endsOn(const QMap<QString, QTimeZone>& time_zones, bool *had_dt) const {
|
||||
QDateTime EventComponent::endsOn(const QMap<QString, QTimeZone>& time_zones, bool* had_dt) const {
|
||||
QString modifiers;
|
||||
QString dt_format;
|
||||
bool has_dt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user