summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-03-19 11:47:10 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-03-19 11:47:10 +0000
commitfa565048f6b6d1928a216246619ad52b607ac7c2 (patch)
tree37f4e339a3736b00be63151c7efa31d361aca84c /rbutil/rbutilqt/rbutilqt.cpp
parente937a78860c302614241447b50afd997ea091f07 (diff)
downloadrockbox-fa565048f6b6d1928a216246619ad52b607ac7c2.tar.gz
rockbox-fa565048f6b6d1928a216246619ad52b607ac7c2.tar.bz2
rockbox-fa565048f6b6d1928a216246619ad52b607ac7c2.zip
Fix Rockbox Utility update detection on Linux 64bit.
Remove the "64bit" part of the filename before comparing. We're checking for that in the filename explicitly but the version number doesn't contain it, so the comparison will otherwise misinterpret it as additional version information. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29617 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 98c1024f60..328fb5d8c7 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -1280,44 +1280,49 @@ void RbUtilQt::downloadUpdateDone(bool error)
}
else {
QString toParse(update->readAll());
-
+
QRegExp searchString("<a[^>]*>([a-zA-Z]+[^<]*)</a>");
QStringList rbutilList;
int pos = 0;
- while ((pos = searchString.indexIn(toParse, pos)) != -1)
+ while ((pos = searchString.indexIn(toParse, pos)) != -1)
{
rbutilList << searchString.cap(1);
pos += searchString.matchedLength();
}
qDebug() << "[Checkupdate] " << rbutilList;
-
+
QString newVersion = "";
- //check if there is a binary with higher version in this list
+ QString foundVersion = "";
+ // check if there is a binary with higher version in this list
for(int i=0; i < rbutilList.size(); i++)
{
+ QString item = rbutilList.at(i);
#if defined(Q_OS_LINUX)
#if defined(__amd64__)
- //skip if it isnt a 64bit build
- if( !rbutilList.at(i).contains("64bit"))
+ // skip if it isn't a 64 bit build
+ if( !item.contains("64bit"))
continue;
+ // strip the "64bit" suffix for comparison
+ item = item.remove("64bit");
#else
//skip if it is a 64bit build
- if(rbutilList.at(i).contains("64bit"))
+ if(item.contains("64bit"))
continue;
-#endif
-#endif
- //check if it is newer, and remember newest
- if(Utils::compareVersionStrings(VERSION, rbutilList.at(i)) == 1)
+#endif
+#endif
+ // check if it is newer, and remember newest
+ if(Utils::compareVersionStrings(VERSION, item) == 1)
{
- if(Utils::compareVersionStrings(newVersion, rbutilList.at(i)) == 1)
+ if(Utils::compareVersionStrings(newVersion, item) == 1)
{
- newVersion = rbutilList.at(i);
+ newVersion = item;
+ foundVersion = rbutilList.at(i);
}
}
}
// if we found something newer, display info
- if(newVersion != "")
+ if(foundVersion != "")
{
QString url = SystemInfo::value(SystemInfo::RbutilUrl).toString();
#if defined(Q_OS_WIN32)
@@ -1327,11 +1332,12 @@ void RbUtilQt::downloadUpdateDone(bool error)
#elif defined(Q_OS_MACX)
url += "macosx/";
#endif
- url += newVersion;
-
+ url += foundVersion;
+
QMessageBox::information(this,tr("RockboxUtility Update available"),
tr("<b>New RockboxUtility Version available.</b> <br><br>"
- "Download it from here: <a href='%1'>%2</a>").arg(url).arg(newVersion) );
+ "Download it from here: <a href='%1'>%2</a>")
+ .arg(url).arg(foundVersion));
ui.statusbar->showMessage(tr("New version of Rockbox Utility available."));
}
else {