From 8e1f3ac0168844b6c4e0e897e674ac80ed45483f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 4 Aug 2018 22:22:35 +0800 Subject: [PATCH] Make ProgramUpdater upgrade to 64-bit qbt when running on 64-bit Windows --- src/gui/programupdater.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/programupdater.cpp b/src/gui/programupdater.cpp index 7e5cc124a..8ce63a763 100644 --- a/src/gui/programupdater.cpp +++ b/src/gui/programupdater.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "base/net/downloadhandler.h" @@ -42,14 +43,6 @@ namespace { const QString RSS_URL {QStringLiteral("https://www.fosshub.com/software/feedqBittorent")}; -#ifdef Q_OS_MAC - const QString OS_TYPE {QStringLiteral("Mac OS X")}; -#elif defined(Q_OS_WIN) && (defined(__x86_64__) || defined(_M_X64)) - const QString OS_TYPE {QStringLiteral("Windows x64")}; -#else - const QString OS_TYPE {QStringLiteral("Windows")}; -#endif - QString getStringValue(QXmlStreamReader &xml); } @@ -73,10 +66,17 @@ void ProgramUpdater::checkForUpdates() void ProgramUpdater::rssDownloadFinished(const QString &url, const QByteArray &data) { Q_UNUSED(url); - qDebug("Finished downloading the new qBittorrent updates RSS"); - QString version; +#ifdef Q_OS_MAC + const QString OS_TYPE {"Mac OS X"}; +#elif defined(Q_OS_WIN) + const QString OS_TYPE {((QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) + && QSysInfo::currentCpuArchitecture().endsWith("64")) + ? "Windows x64" : "Windows"}; +#endif + + QString version; QXmlStreamReader xml(data); bool inItem = false; QString updateLink;