summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 82ea319bb..1c3e1210e 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1337,3 +1337,54 @@ void QMLManager::quit()
saveChangesCloud(false);
QApplication::quit();
}
+
+QStringList QMLManager::suitInit() const
+{
+ QStringList suits;
+ struct dive *d;
+ int i = 0;
+ for_each_dive (i, d) {
+ QString temp = d->suit;
+ if (!temp.isEmpty())
+ suits << d->suit;
+ }
+ suits.removeDuplicates();
+ suits.sort();
+ return suits;
+}
+
+QStringList QMLManager::buddyInit() const
+{
+ QStringList buddies;
+ struct dive *d;
+ int i = 0;
+ for_each_dive (i, d) {
+ QString temp = d->buddy;
+ if (!temp.isEmpty() && !temp.contains(",")){
+ buddies << d->buddy;
+ }
+ else if (!temp.isEmpty()){
+ QRegExp sep("(,\\s)");
+ QStringList tempList = temp.split(sep);
+ buddies << tempList;
+ }
+ }
+ buddies.removeDuplicates();
+ buddies.sort();
+ return buddies;
+}
+
+QStringList QMLManager::divemasterInit() const
+{
+ QStringList divemasters;
+ struct dive *d;
+ int i = 0;
+ for_each_dive (i, d) {
+ QString temp = d->divemaster;
+ if (!temp.isEmpty())
+ divemasters << d->divemaster;
+ }
+ divemasters.removeDuplicates();
+ divemasters.sort();
+ return divemasters;
+}