summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qthelper.cpp8
-rw-r--r--core/qthelper.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 2bb2c5d72..b00201297 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1219,6 +1219,14 @@ QString get_taglist_string(struct tag_entry *tag_list)
return ret;
}
+QStringList stringToList(const QString &s)
+{
+ QStringList res = s.split(",", QString::SkipEmptyParts);
+ for (QString &str: res)
+ str = str.trimmed();
+ return res;
+}
+
weight_t string_to_weight(const char *str)
{
const char *end;
diff --git a/core/qthelper.h b/core/qthelper.h
index 6dc6c4d6f..4c3a6aa19 100644
--- a/core/qthelper.h
+++ b/core/qthelper.h
@@ -29,6 +29,7 @@ QList<int> getDivesInTrip(struct dive_trip *trip);
QString get_gas_string(struct gasmix gas);
QString get_divepoint_gas_string(struct dive *d, const struct divedatapoint &dp);
QString get_taglist_string(struct tag_entry *tag_list);
+QStringList stringToList(const QString &s);
void read_hashes();
void write_hashes();
QString thumbnailFileName(const QString &filename);