diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-01-30 19:18:54 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-12 19:00:36 +0000 |
commit | ab74cf09a8f71aa939ac3de6165f9d6b45465ef8 (patch) | |
tree | 24e1a304c8435428ac9934f51aa76a932693f47d /qmake/library/proitems.cpp | |
parent | f76d14673f7b7b63041c8cab6ae454a13876b8b9 (diff) |
move some functions into ProStringList for saner OO design
Change-Id: I60f00f38f459fc9f8eebee9187158e4198fc9546
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/library/proitems.cpp')
-rw-r--r-- | qmake/library/proitems.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index 1a7a4f3dea..e780259417 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -386,6 +386,20 @@ void ProStringList::removeAll(const char *str) remove(i); } +void ProStringList::removeEach(const ProStringList &value) +{ + foreach (const ProString &str, value) + if (!str.isEmpty()) + removeAll(str); +} + +void ProStringList::removeEmpty() +{ + for (int i = size(); --i >= 0;) + if (at(i).isEmpty()) + remove(i); +} + void ProStringList::removeDuplicates() { int n = size(); @@ -405,6 +419,13 @@ void ProStringList::removeDuplicates() erase(begin() + j, end()); } +void ProStringList::insertUnique(const ProStringList &value) +{ + foreach (const ProString &str, value) + if (!str.isEmpty() && !contains(str)) + append(str); +} + ProStringList::ProStringList(const QStringList &list) { reserve(list.size()); |