summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-12 16:01:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-12 16:02:37 -0800
commit61dc19d2e0bc69004b03a990993eda547f4e0093 (patch)
tree0cb4af2322199c5ef65bf1083d8a3f4c2e7ac083 /qthelper.cpp
parent5a329ff26295717181dd99b22dab5b6b1e80d821 (diff)
downloadsubsurface-61dc19d2e0bc69004b03a990993eda547f4e0093.tar.gz
Show the number of dives with given person / location in the filter panel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index e481bc9e9..6769e8abe 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -301,6 +301,20 @@ extern "C" void copy_image_and_overwrite(const char *cfileName, const char *cnew
QFile::copy(fileName, newName);
}
+extern "C" bool string_sequence_contains(const char *string_sequence, const char *text)
+{
+ if (same_string(text, "") || same_string(string_sequence, ""))
+ return false;
+
+ QString stringSequence(string_sequence);
+ QStringList strings = stringSequence.split(",", QString::SkipEmptyParts);
+ Q_FOREACH (QString string, strings) {
+ if (string.trimmed().compare(QString(text).trimmed(), Qt::CaseInsensitive) == 0)
+ return true;
+ }
+ return false;
+}
+
static bool lessThan(const QPair<QString, int> &a, const QPair<QString, int> &b)
{
return a.second < b.second;