mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Show the number of dives with given person / location in the filter panel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5a329ff262
commit
61dc19d2e0
4 changed files with 52 additions and 3 deletions
14
qthelper.cpp
14
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue