Browse Source

Don't limit max RSS feed file size

PR #19576.
adaptive-webui-19844
Vladimir Golovnev 1 year ago committed by GitHub
parent
commit
2deb7eb3d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/base/rss/feed_serializer.cpp
  2. 9
      src/gui/aboutdialog.cpp

3
src/base/rss/feed_serializer.cpp

@ -45,8 +45,7 @@ const int ARTICLEDATALIST_TYPEID = qRegisterMetaType<QVector<QVariantHash>>();
void RSS::Private::FeedSerializer::load(const Path &dataFileName, const QString &url) void RSS::Private::FeedSerializer::load(const Path &dataFileName, const QString &url)
{ {
const int fileMaxSize = 10 * 1024 * 1024; const auto readResult = Utils::IO::readFile(dataFileName, -1);
const auto readResult = Utils::IO::readFile(dataFileName, fileMaxSize);
if (!readResult) if (!readResult)
{ {
if (readResult.error().status == Utils::IO::ReadError::NotExist) if (readResult.error().status == Utils::IO::ReadError::NotExist)

9
src/gui/aboutdialog.cpp

@ -76,22 +76,19 @@ AboutDialog::AboutDialog(QWidget *parent)
m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_s))); m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_s)));
// Thanks // Thanks
if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_s), -1, QIODevice::Text) if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_s), -1, QIODevice::Text))
; readResult)
{ {
m_ui->textBrowserThanks->setHtml(QString::fromUtf8(readResult.value())); m_ui->textBrowserThanks->setHtml(QString::fromUtf8(readResult.value()));
} }
// Translation // Translation
if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_s), -1, QIODevice::Text) if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_s), -1, QIODevice::Text))
; readResult)
{ {
m_ui->textBrowserTranslation->setHtml(QString::fromUtf8(readResult.value())); m_ui->textBrowserTranslation->setHtml(QString::fromUtf8(readResult.value()));
} }
// License // License
if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_s), -1, QIODevice::Text) if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_s), -1, QIODevice::Text))
; readResult)
{ {
m_ui->textBrowserLicense->setHtml(QString::fromUtf8(readResult.value())); m_ui->textBrowserLicense->setHtml(QString::fromUtf8(readResult.value()));
} }

Loading…
Cancel
Save