summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/utils.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2015-01-31 18:30:42 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2015-05-02 16:52:13 +0200
commit72b81c25590b972c785ff30e0e9732a756ab9e9e (patch)
tree7b28c503d92431b01a9345ecbd06d702751ceede /rbutil/rbutilqt/base/utils.cpp
parent43b1ccffcc2df42146bde053bb13e5168dfa2334 (diff)
downloadrockbox-72b81c25590b972c785ff30e0e9732a756ab9e9e.tar.gz
rockbox-72b81c25590b972c785ff30e0e9732a756ab9e9e.tar.bz2
rockbox-72b81c25590b972c785ff30e0e9732a756ab9e9e.zip
Improve update check information dialog.
Show the user both the current and updated version. Change-Id: Ief693cce020a39a0c79bf2705da4a44b7bd15928
Diffstat (limited to 'rbutil/rbutilqt/base/utils.cpp')
-rw-r--r--rbutil/rbutilqt/base/utils.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp
index d2ed49bae3..724a1553f1 100644
--- a/rbutil/rbutilqt/base/utils.cpp
+++ b/rbutil/rbutilqt/base/utils.cpp
@@ -342,6 +342,20 @@ QString Utils::checkEnvironment(bool permission)
else
return text;
}
+
+/** @brief Trim version string from filename to version part only.
+ * @param s Version string
+ * @return Version part of string if found, input string on error.
+ */
+QString Utils::trimVersionString(QString s)
+{
+ QRegExp r = QRegExp(".*([\\d\\.]+\\d+[a-z]?).*");
+ if(r.indexIn(s) != -1) {
+ return r.cap(1);
+ }
+ return s;
+}
+
/** @brief Compare two version strings.
* @param s1 first version string
* @param s2 second version string