From 6a2a0893f81e28b3872ecb52f5fecd8fc48e79e9 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 23 Oct 2017 07:00:51 +0200 Subject: [PATCH] Fixed #155. --- resources/text/CHANGELOG | 11 ++++++----- rssguard.pro | 2 +- src/gui/dialogs/formupdate.cpp | 10 ++++++---- src/miscellaneous/feedreader.cpp | 2 +- src/miscellaneous/systemfactory.cpp | 12 ++++++++++++ src/miscellaneous/systemfactory.h | 2 ++ 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 00f9ae185..34f21cd2d 100644 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -1,13 +1,14 @@ +3.5.5 +————— + +Fixed: +▪ Displaying correct update files. (#155) + 3.5.4 ————— Fixed: ▪ First item in itemviews is now selected when focus is gained. (#142) - -3.5.3 -————— - -Fixed: ▪ Some feed files do not have URLs of messages properly sanitized. Strip "\n" and "\t" from URls. (bug #154) 3.5.1 diff --git a/rssguard.pro b/rssguard.pro index 5795d7744..13311f64a 100755 --- a/rssguard.pro +++ b/rssguard.pro @@ -55,7 +55,7 @@ APP_REVERSE_NAME = "com.github.rssguard" APP_LOW_H_NAME = ".rssguard" APP_AUTHOR = "Martin Rotter" APP_COPYRIGHT = "(C) 2011-2017 $$APP_AUTHOR" -APP_VERSION = "3.5.4" +APP_VERSION = "3.5.5" APP_LONG_NAME = "$$APP_NAME $$APP_VERSION" APP_EMAIL = "rotter.martinos@gmail.com" APP_URL = "https://github.com/martinrotter/rssguard" diff --git a/src/gui/dialogs/formupdate.cpp b/src/gui/dialogs/formupdate.cpp index a80f949a1..1aedbc655 100755 --- a/src/gui/dialogs/formupdate.cpp +++ b/src/gui/dialogs/formupdate.cpp @@ -145,11 +145,13 @@ void FormUpdate::loadAvailableFiles() { m_ui.m_listFiles->clear(); foreach (const UpdateUrl& url, m_updateInfo.m_urls) { - QListWidgetItem* item = new QListWidgetItem(url.m_name + tr(" (size ") + url.m_size + QSL(")")); + if (SystemFactory::supportedUpdateFiles().match(url.m_name).hasMatch()) { + QListWidgetItem* item = new QListWidgetItem(url.m_name + tr(" (size ") + url.m_size + QSL(")")); - item->setData(Qt::UserRole, url.m_fileUrl); - item->setToolTip(url.m_fileUrl); - m_ui.m_listFiles->addItem(item); + item->setData(Qt::UserRole, url.m_fileUrl); + item->setToolTip(url.m_fileUrl); + m_ui.m_listFiles->addItem(item); + } } if (m_ui.m_listFiles->count() > 0) { diff --git a/src/miscellaneous/feedreader.cpp b/src/miscellaneous/feedreader.cpp index c4f3f3417..20648d04d 100755 --- a/src/miscellaneous/feedreader.cpp +++ b/src/miscellaneous/feedreader.cpp @@ -50,7 +50,7 @@ FeedReader::~FeedReader() { QList FeedReader::feedServices() { if (m_feedServices.isEmpty()) { // NOTE: All installed services create their entry points here. - //m_feedServices.append(new GmailEntryPoint()); + m_feedServices.append(new GmailEntryPoint()); m_feedServices.append(new InoreaderEntryPoint()); m_feedServices.append(new OwnCloudServiceEntryPoint()); m_feedServices.append(new StandardServiceEntryPoint()); diff --git a/src/miscellaneous/systemfactory.cpp b/src/miscellaneous/systemfactory.cpp index 69885d12f..e25645ebe 100755 --- a/src/miscellaneous/systemfactory.cpp +++ b/src/miscellaneous/systemfactory.cpp @@ -28,6 +28,18 @@ SystemFactory::SystemFactory(QObject* parent) : QObject(parent) {} SystemFactory::~SystemFactory() {} +QRegularExpression SystemFactory::supportedUpdateFiles() { +#if defined(Q_OS_WIN) + return QRegularExpression(QSL(".+win.+\\.(exe|7z)")); +#elif defined(Q_OS_MAC) + return QRegularExpression(QSL(".dmg")); +#elif defined(Q_OS_LINUX) + return QRegularExpression(QSL(".AppImage")); +#else + return QRegularExpression(QSL(".*")); +#endif +} + SystemFactory::AutoStartStatus SystemFactory::autoStartStatus() const { // User registry way to auto-start the application on Windows. #if defined(Q_OS_WIN) diff --git a/src/miscellaneous/systemfactory.h b/src/miscellaneous/systemfactory.h index 13cdce9ff..ac5cf69cf 100755 --- a/src/miscellaneous/systemfactory.h +++ b/src/miscellaneous/systemfactory.h @@ -72,6 +72,8 @@ class SystemFactory : public QObject { // Tries to download list with new updates. void checkForUpdates() const; + static QRegularExpression supportedUpdateFiles(); + // Checks if update is newer than current application version. static bool isVersionNewer(const QString& new_version, const QString& base_version); static bool isVersionEqualOrNewer(const QString& new_version, const QString& base_version);