Mercurial > projects > qtd
comparison qt/d2/qt/qtd/Str.d @ 248:7664de4a55e5
Fixed #23.
QtD_QObjectEntity is not created dynamically for shell classes any more.
Class initialization is now performed by static constructors.
When wrapping QObjects returned from functions, their run-time types are now taken into account.
QObjects are allocated on GC heap, a doubly-linked list is used to prevent them from been collected (arguably a better solution than allocating on C heap and adding GC ranges)
Minor changes (including unnecessary).
author | maxter |
---|---|
date | Thu, 20 Aug 2009 14:47:17 +0000 |
parents | 27497bbe62a1 |
children | 37eed70de029 |
comparison
equal
deleted
inserted
replaced
247:27497bbe62a1 | 248:7664de4a55e5 |
---|---|
34 foreach (string p; args) | 34 foreach (string p; args) |
35 { | 35 { |
36 argv[argc++] = cast(char*)(p.dup~'\0'); | 36 argv[argc++] = cast(char*)(p.dup~'\0'); |
37 } | 37 } |
38 argv[argc] = null; | 38 argv[argc] = null; |
39 | 39 |
40 return argv; | 40 return argv; |
41 } | 41 } |
42 | 42 |
43 public string fromStringz(const (char) *s) | 43 public string fromStringz(const (char) *s) |
44 { | 44 { |
45 return s ? s[0 .. strlen(s)].idup : cast(string)null; | 45 return s ? s[0 .. strlen(s)].idup : cast(string)null; |
46 } | 46 } |
47 | 47 |
48 version(Windows) | 48 |
49 extern(C) void qtd_toUtf8(wchar* arr, uint size, string* str) | |
49 { | 50 { |
50 export extern(C) void _d_toUtf8(wchar* arr, uint size, string* str) | 51 *str = toUTF8(arr[0..size]); |
51 { | |
52 *str = toUTF8(arr[0..size]); | |
53 } | |
54 } | |
55 else | |
56 { | |
57 extern(C) void _d_toUtf8(wchar* arr, uint size, string* str) | |
58 { | |
59 *str = toUTF8(arr[0..size]); | |
60 } | |
61 } | 52 } |
62 | 53 |
63 | 54 |
55 |