diff options
author | Topi Reinio <topi.reinio@digia.com> | 2014-02-20 16:03:28 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@digia.com> | 2014-02-21 10:26:40 +0200 |
commit | cf9b6d177939a292cff29578b4bfdb8cd4b69f14 (patch) | |
tree | 7b24989ba83b42796bf06a91343bcd80f7fc08a5 | |
parent | 1b491954469af47835423625319eed8f174da6b0 (diff) |
Remove any leading digits from application titles
Removes leading digits followed by '.' from the application
titles, once they are sorted. This is to allow placing the
applications in the launcher as we desire, by using titles
like '00. WelcomeApp', '01. SecondApp', etc.
Change-Id: I59a2fec17358eff9ff5c979191ec09b46e835525
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r-- | src/applicationsmodel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/applicationsmodel.cpp b/src/applicationsmodel.cpp index 5233f92..1a9cf10 100644 --- a/src/applicationsmodel.cpp +++ b/src/applicationsmodel.cpp @@ -102,6 +102,12 @@ public: } std::sort(results.begin(), results.end(), appOrder); + + // Remove any leading digits followed by '.' from the name + for (int i = 0; i < results.count(); ++i) { + results[i].name.remove(QRegExp("^\\d+\\.\\s*")); + } + return results; } |