aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Qt/helper.cpp')
-rw-r--r--src/Qt/helper.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Qt/helper.cpp b/src/Qt/helper.cpp
new file mode 100644
index 0000000..93a00fe
--- /dev/null
+++ b/src/Qt/helper.cpp
@@ -0,0 +1,28 @@
+#include "helper.h"
+#include <stringlist.h>
+
+QStringList CListToQStringList(StringList *clist)
+{
+ QStringList list;
+
+ for (int i=0; i<stringListCount(clist); i++) {
+ list << stringListGetAt(clist, i);
+ }
+
+ return list;
+}
+
+StringList* QStringListToCList(const QStringList &list)
+{
+ StringList *clist;
+
+ clist = stringListCreate(list.count());
+
+ if (clist) { // Not null
+ for (int i=0; i<list.count(); i++) {
+ stringListInsertAt(clist, i, list.at(i).toUtf8().data());
+ }
+ }
+
+ return clist;
+}