summaryrefslogtreecommitdiff
path: root/src/shared/proparser/proitems.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-30 19:18:54 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-28 13:01:00 +0000
commit04fdfd8bfea13077b7b3a3e5dde3a5bfaa808ee2 (patch)
tree65623f618143242acb23eea8ef698e73d621ec4e /src/shared/proparser/proitems.cpp
parentb6fb8da6ff5093f07843948ae4b30aa0c1137441 (diff)
downloadqt-creator-04fdfd8bfea13077b7b3a3e5dde3a5bfaa808ee2.tar.gz
move some functions into ProStringList for saner OO design
Change-Id: I60f00f38f459fc9f8eebee9187158e4198fc9546 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> (cherry picked from qtbase/ab74cf09a8f71aa939ac3de6165f9d6b45465ef8)
Diffstat (limited to 'src/shared/proparser/proitems.cpp')
-rw-r--r--src/shared/proparser/proitems.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp
index ebf448516a..5ea3405fd3 100644
--- a/src/shared/proparser/proitems.cpp
+++ b/src/shared/proparser/proitems.cpp
@@ -379,6 +379,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();
@@ -398,6 +412,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());