summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ustring.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/ustring.h') (more/less context) (ignore 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)
63 while (*p != 0 && i < len) ret[i++] = *(p++); 63 while (*p != 0 && i < len) ret[i++] = *(p++);
64 return ret; 64 return ret;
65} 65}
66
67inline tchar* fromQString(const QString& qs)
68{
69 int len = qs.length();
70 tchar* ret = new tchar[len+1];
71 for (int i = 0; i < len; i++)
72 {
73 ret[i] = qs[i].unicode();
74 }
75 ret[len] = 0;
76 return ret;
77}
66#else 78#else
67 79
68inline size_t ustrlen(const tchar* _p) { return strlen(_p); } 80inline size_t ustrlen(const tchar* _p) { return strlen(_p); }