summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ustring.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/ustring.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ustring.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/ustring.h b/noncore/apps/opie-reader/ustring.h
index a4dc048..a3ef8df 100644
--- a/noncore/apps/opie-reader/ustring.h
+++ b/noncore/apps/opie-reader/ustring.h
@@ -63,6 +63,18 @@ inline QString toQString(tchar *_p, unsigned int len)
while (*p != 0 && i < len) ret[i++] = *(p++);
return ret;
}
+
+inline tchar* fromQString(const QString& qs)
+{
+ int len = qs.length();
+ tchar* ret = new tchar[len+1];
+ for (int i = 0; i < len; i++)
+ {
+ ret[i] = qs[i].unicode();
+ }
+ ret[len] = 0;
+ return ret;
+}
#else
inline size_t ustrlen(const tchar* _p) { return strlen(_p); }