-rw-r--r-- | library/alarmserver.cpp | 4 | ||||
-rw-r--r-- | library/backend/vcc.y | 2 | ||||
-rw-r--r-- | library/backend/vcc_yacc.cpp | 2 | ||||
-rw-r--r-- | library/backend/vobject.cpp | 116 | ||||
-rw-r--r-- | library/datebookmonth.cpp | 14 | ||||
-rw-r--r-- | library/fileselector.cpp | 6 | ||||
-rw-r--r-- | library/fontdatabase.cpp | 2 | ||||
-rw-r--r-- | library/fontdatabase.h | 1 | ||||
-rw-r--r-- | library/mimetype.cpp | 2 | ||||
-rw-r--r-- | library/qpedialog.cpp | 4 | ||||
-rw-r--r-- | library/qpestyle.cpp | 14 | ||||
-rw-r--r-- | library/resource.cpp | 2 | ||||
-rw-r--r-- | library/timestring.cpp | 34 |
13 files changed, 102 insertions, 101 deletions
diff --git a/library/alarmserver.cpp b/library/alarmserver.cpp index 1ee05c6..177a0cb 100644 --- a/library/alarmserver.cpp +++ b/library/alarmserver.cpp | |||
@@ -15,30 +15,30 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qdir.h> | 21 | #include <qdir.h> |
22 | #include <qfile.h> | 22 | #include <qfile.h> |
23 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
24 | #include <qtextstream.h> | 24 | #include <qtextstream.h> |
25 | 25 | ||
26 | 26 | ||
27 | #include "qpeapplication.h" | 27 | #include <qpe/qpeapplication.h> |
28 | #include "global.h" | 28 | #include "global.h" |
29 | #include "resource.h" | 29 | #include "resource.h" |
30 | 30 | ||
31 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 31 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
32 | #include "qcopenvelope_qws.h" | 32 | #include <qpe/qcopenvelope_qws.h> |
33 | #endif | 33 | #endif |
34 | #include "alarmserver.h" | 34 | #include "alarmserver.h" |
35 | #include <qpe/timeconversion.h> | 35 | #include <qpe/timeconversion.h> |
36 | 36 | ||
37 | #include <sys/types.h> | 37 | #include <sys/types.h> |
38 | #include <sys/stat.h> | 38 | #include <sys/stat.h> |
39 | 39 | ||
40 | #include <stdlib.h> | 40 | #include <stdlib.h> |
41 | #include <unistd.h> | 41 | #include <unistd.h> |
42 | 42 | ||
43 | struct timerEventItem { | 43 | struct timerEventItem { |
44 | time_t UTCtime; | 44 | time_t UTCtime; |
diff --git a/library/backend/vcc.y b/library/backend/vcc.y index 5bcf0cb..6781312 100644 --- a/library/backend/vcc.y +++ b/library/backend/vcc.y | |||
@@ -113,25 +113,25 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
113 | 113 | ||
114 | #include <string.h> | 114 | #include <string.h> |
115 | #ifndef __MWERKS__ | 115 | #ifndef __MWERKS__ |
116 | #include <stdlib.h> | 116 | #include <stdlib.h> |
117 | #endif | 117 | #endif |
118 | #include <stdio.h> | 118 | #include <stdio.h> |
119 | #include <stdlib.h> | 119 | #include <stdlib.h> |
120 | #include <ctype.h> | 120 | #include <ctype.h> |
121 | 121 | ||
122 | //#ifdef PALMTOPCENTER | 122 | //#ifdef PALMTOPCENTER |
123 | //#include <qpe/vobject_p.h> | 123 | //#include <qpe/vobject_p.h> |
124 | //#else | 124 | //#else |
125 | #include "vobject_p.h" | 125 | #include <qtopia/private/vobject_p.h> |
126 | //#endif | 126 | //#endif |
127 | 127 | ||
128 | /**** Types, Constants ****/ | 128 | /**** Types, Constants ****/ |
129 | 129 | ||
130 | #define YYDEBUG 0/* 1 to compile in some debugging code */ | 130 | #define YYDEBUG 0/* 1 to compile in some debugging code */ |
131 | #define MAXTOKEN 256/* maximum token (line) length */ | 131 | #define MAXTOKEN 256/* maximum token (line) length */ |
132 | #define YYSTACKSIZE 100// ~unref ? | 132 | #define YYSTACKSIZE 100// ~unref ? |
133 | #define MAXLEVEL 10/* max # of nested objects parseable */ | 133 | #define MAXLEVEL 10/* max # of nested objects parseable */ |
134 | /* (includes outermost) */ | 134 | /* (includes outermost) */ |
135 | 135 | ||
136 | 136 | ||
137 | /**** Global Variables ****/ | 137 | /**** Global Variables ****/ |
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp index 19a108f..b2b0c14 100644 --- a/library/backend/vcc_yacc.cpp +++ b/library/backend/vcc_yacc.cpp | |||
@@ -149,25 +149,25 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
149 | 149 | ||
150 | #include <string.h> | 150 | #include <string.h> |
151 | #ifndef __MWERKS__ | 151 | #ifndef __MWERKS__ |
152 | #include <stdlib.h> | 152 | #include <stdlib.h> |
153 | #endif | 153 | #endif |
154 | #include <stdio.h> | 154 | #include <stdio.h> |
155 | #include <stdlib.h> | 155 | #include <stdlib.h> |
156 | #include <ctype.h> | 156 | #include <ctype.h> |
157 | 157 | ||
158 | /*#ifdef PALMTOPCENTER */ | 158 | /*#ifdef PALMTOPCENTER */ |
159 | /*#include <qpe/vobject_p.h> */ | 159 | /*#include <qpe/vobject_p.h> */ |
160 | /*#else */ | 160 | /*#else */ |
161 | #include "vobject_p.h" | 161 | #include <qtopia/private/vobject_p.h> |
162 | /*#endif */ | 162 | /*#endif */ |
163 | 163 | ||
164 | /**** Types, Constants ****/ | 164 | /**** Types, Constants ****/ |
165 | 165 | ||
166 | #define YYDEBUG 0/* 1 to compile in some debugging code */ | 166 | #define YYDEBUG 0/* 1 to compile in some debugging code */ |
167 | #define MAXTOKEN 256/* maximum token (line) length */ | 167 | #define MAXTOKEN 256/* maximum token (line) length */ |
168 | #define YYSTACKSIZE 100/* ~unref ? */ | 168 | #define YYSTACKSIZE 100/* ~unref ? */ |
169 | #define MAXLEVEL 10/* max # of nested objects parseable */ | 169 | #define MAXLEVEL 10/* max # of nested objects parseable */ |
170 | /* (includes outermost) */ | 170 | /* (includes outermost) */ |
171 | 171 | ||
172 | 172 | ||
173 | /**** Global Variables ****/ | 173 | /**** Global Variables ****/ |
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp index e6f6b78..dab128e 100644 --- a/library/backend/vobject.cpp +++ b/library/backend/vobject.cpp | |||
@@ -1,62 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | (C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International | 2 | (C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International |
3 | Business Machines Corporation and Siemens Rolm Communications Inc. | 3 | Business Machines Corporation and Siemens Rolm Communications Inc. |
4 | 4 | ||
5 | For purposes of this license notice, the term Licensors shall mean, | 5 | For purposes of this license notice, the term Licensors shall mean, |
6 | collectively, Apple Computer, Inc., AT&T Corp., International | 6 | collectively, Apple Computer, Inc., AT&T Corp., International |
7 | Business Machines Corporation and Siemens Rolm Communications Inc. | 7 | Business Machines Corporation and Siemens Rolm Communications Inc. |
8 | The term Licensor shall mean any of the Licensors. | 8 | The term Licensor shall mean any of the Licensors. |
9 | 9 | ||
10 | Subject to acceptance of the following conditions, permission is hereby | 10 | Subject to acceptance of the following conditions, permission is hereby |
11 | granted by Licensors without the need for written agreement and without | 11 | granted by Licensors without the need for written agreement and without |
12 | license or royalty fees, to use, copy, modify and distribute this | 12 | license or royalty fees, to use, copy, modify and distribute this |
13 | software for any purpose. | 13 | software for any purpose. |
14 | 14 | ||
15 | The above copyright notice and the following four paragraphs must be | 15 | The above copyright notice and the following four paragraphs must be |
16 | reproduced in all copies of this software and any software including | 16 | reproduced in all copies of this software and any software including |
17 | this software. | 17 | this software. |
18 | 18 | ||
19 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE | 19 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE |
20 | ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR | 20 | ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR |
21 | MODIFICATIONS. | 21 | MODIFICATIONS. |
22 | 22 | ||
23 | IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, | 23 | IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, |
24 | INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT | 24 | INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT |
25 | OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | 25 | OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
26 | DAMAGE. | 26 | DAMAGE. |
27 | 27 | ||
28 | EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, | 28 | EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, |
29 | INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE | 29 | INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE |
30 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 30 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
31 | PURPOSE. | 31 | PURPOSE. |
32 | 32 | ||
33 | The software is provided with RESTRICTED RIGHTS. Use, duplication, or | 33 | The software is provided with RESTRICTED RIGHTS. Use, duplication, or |
34 | disclosure by the government are subject to restrictions set forth in | 34 | disclosure by the government are subject to restrictions set forth in |
35 | DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | 35 | DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. |
36 | 36 | ||
37 | ***************************************************************************/ | 37 | ***************************************************************************/ |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * src: vobject.c | 40 | * src: vobject.c |
41 | * doc: vobject and APIs to construct vobject, APIs pretty print | 41 | * doc: vobject and APIs to construct vobject, APIs pretty print |
42 | * vobject, and convert a vobject into its textual representation. | 42 | * vobject, and convert a vobject into its textual representation. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | #ifndef MWERKS | 45 | #ifndef MWERKS |
46 | #include <malloc.h> | 46 | #include <malloc.h> |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #include "vobject_p.h" | 49 | #include <qtopia/private/vobject_p.h> |
50 | #include "qfiledirect_p.h" | 50 | #include <qtopia/private/qfiledirect_p.h> |
51 | #include <string.h> | 51 | #include <string.h> |
52 | #include <stdio.h> | 52 | #include <stdio.h> |
53 | #include <fcntl.h> | 53 | #include <fcntl.h> |
54 | //#include <io.h> | 54 | //#include <io.h> |
55 | 55 | ||
56 | 56 | ||
57 | #define NAME_OF(o) o->id | 57 | #define NAME_OF(o) o->id |
58 | #define VALUE_TYPE(o) o->valType | 58 | #define VALUE_TYPE(o) o->valType |
59 | #define STRINGZ_VALUE_OF(o) o->val.strs | 59 | #define STRINGZ_VALUE_OF(o) o->val.strs |
60 | #define INTEGER_VALUE_OF(o) o->val.i | 60 | #define INTEGER_VALUE_OF(o) o->val.i |
61 | #define LONG_VALUE_OF(o) o->val.l | 61 | #define LONG_VALUE_OF(o) o->val.l |
62 | #define ANY_VALUE_OF(o) o->val.any | 62 | #define ANY_VALUE_OF(o) o->val.any |
@@ -318,36 +318,36 @@ DLLEXPORT(VObject*) setValueWithSize_(VObject *prop, void *val, unsigned int siz | |||
318 | setVObjectLongValue(sizeProp, size); | 318 | setVObjectLongValue(sizeProp, size); |
319 | return prop; | 319 | return prop; |
320 | } | 320 | } |
321 | 321 | ||
322 | DLLEXPORT(VObject*) setValueWithSize(VObject *prop, void *val, unsigned int size) | 322 | DLLEXPORT(VObject*) setValueWithSize(VObject *prop, void *val, unsigned int size) |
323 | { | 323 | { |
324 | void *p = dupStr((const char *)val,size); | 324 | void *p = dupStr((const char *)val,size); |
325 | return setValueWithSize_(prop,p,p?size:0); | 325 | return setValueWithSize_(prop,p,p?size:0); |
326 | } | 326 | } |
327 | 327 | ||
328 | DLLEXPORT(void) initPropIterator(VObjectIterator *i, VObject *o) | 328 | DLLEXPORT(void) initPropIterator(VObjectIterator *i, VObject *o) |
329 | { | 329 | { |
330 | i->start = o->prop; | 330 | i->start = o->prop; |
331 | i->next = 0; | 331 | i->next = 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | DLLEXPORT(void) initVObjectIterator(VObjectIterator *i, VObject *o) | 334 | DLLEXPORT(void) initVObjectIterator(VObjectIterator *i, VObject *o) |
335 | { | 335 | { |
336 | i->start = o->next; | 336 | i->start = o->next; |
337 | i->next = 0; | 337 | i->next = 0; |
338 | } | 338 | } |
339 | 339 | ||
340 | DLLEXPORT(int) moreIteration(VObjectIterator *i) | 340 | DLLEXPORT(int) moreIteration(VObjectIterator *i) |
341 | { | 341 | { |
342 | return (i->start && (i->next==0 || i->next!=i->start)); | 342 | return (i->start && (i->next==0 || i->next!=i->start)); |
343 | } | 343 | } |
344 | 344 | ||
345 | DLLEXPORT(VObject*) nextVObject(VObjectIterator *i) | 345 | DLLEXPORT(VObject*) nextVObject(VObjectIterator *i) |
346 | { | 346 | { |
347 | if (i->start && i->next != i->start) { | 347 | if (i->start && i->next != i->start) { |
348 | if (i->next == 0) { | 348 | if (i->next == 0) { |
349 | i->next = i->start->next; | 349 | i->next = i->start->next; |
350 | return i->next; | 350 | return i->next; |
351 | } | 351 | } |
352 | else { | 352 | else { |
353 | i->next = i->next->next; | 353 | i->next = i->next->next; |
@@ -394,25 +394,25 @@ DLLEXPORT(VObject*) addGroup(VObject *o, const char *g) | |||
394 | if (dot) { | 394 | if (dot) { |
395 | n = dot+1; | 395 | n = dot+1; |
396 | *dot=0; | 396 | *dot=0; |
397 | } | 397 | } |
398 | else | 398 | else |
399 | n = gs; | 399 | n = gs; |
400 | /* property(VCGroupingProp=n); | 400 | /* property(VCGroupingProp=n); |
401 | *and the value may have VCGrouping property | 401 | *and the value may have VCGrouping property |
402 | */ | 402 | */ |
403 | t = addProp(t,VCGroupingProp); | 403 | t = addProp(t,VCGroupingProp); |
404 | setVObjectStringZValue(t,lookupProp_(n)); | 404 | setVObjectStringZValue(t,lookupProp_(n)); |
405 | } while (n != gs); | 405 | } while (n != gs); |
406 | deleteStr(gs); | 406 | deleteStr(gs); |
407 | return p; | 407 | return p; |
408 | } | 408 | } |
409 | else | 409 | else |
410 | return addProp_(o,lookupProp(g)); | 410 | return addProp_(o,lookupProp(g)); |
411 | } | 411 | } |
412 | 412 | ||
413 | DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v) | 413 | DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v) |
414 | { | 414 | { |
415 | VObject *prop; | 415 | VObject *prop; |
416 | prop = addProp(o,p); | 416 | prop = addProp(o,p); |
417 | setVObjectStringZValue_(prop, strdup( v ) ); | 417 | setVObjectStringZValue_(prop, strdup( v ) ); |
418 | return prop; | 418 | return prop; |
@@ -790,52 +790,52 @@ static struct PreDefProp propNames[] = { | |||
790 | { VCWorkProp, 0, 0, 0 }, | 790 | { VCWorkProp, 0, 0, 0 }, |
791 | { VCX400Prop, 0, 0, 0 }, | 791 | { VCX400Prop, 0, 0, 0 }, |
792 | { VCX509Prop, 0, 0, 0 }, | 792 | { VCX509Prop, 0, 0, 0 }, |
793 | { VCXRuleProp, 0, 0, 0 }, | 793 | { VCXRuleProp, 0, 0, 0 }, |
794 | { 0,0,0,0 } | 794 | { 0,0,0,0 } |
795 | }; | 795 | }; |
796 | 796 | ||
797 | 797 | ||
798 | static struct PreDefProp* lookupPropInfo(const char* str) | 798 | static struct PreDefProp* lookupPropInfo(const char* str) |
799 | { | 799 | { |
800 | /* brute force for now, could use a hash table here. */ | 800 | /* brute force for now, could use a hash table here. */ |
801 | int i; | 801 | int i; |
802 | 802 | ||
803 | for (i = 0; propNames[i].name; i++) | 803 | for (i = 0; propNames[i].name; i++) |
804 | if (qstricmp(str, propNames[i].name) == 0) { | 804 | if (qstricmp(str, propNames[i].name) == 0) { |
805 | return &propNames[i]; | 805 | return &propNames[i]; |
806 | } | 806 | } |
807 | 807 | ||
808 | return 0; | 808 | return 0; |
809 | } | 809 | } |
810 | 810 | ||
811 | 811 | ||
812 | DLLEXPORT(const char*) lookupProp_(const char* str) | 812 | DLLEXPORT(const char*) lookupProp_(const char* str) |
813 | { | 813 | { |
814 | int i; | 814 | int i; |
815 | 815 | ||
816 | for (i = 0; propNames[i].name; i++) | 816 | for (i = 0; propNames[i].name; i++) |
817 | if (qstricmp(str, propNames[i].name) == 0) { | 817 | if (qstricmp(str, propNames[i].name) == 0) { |
818 | const char* s; | 818 | const char* s; |
819 | s = propNames[i].alias?propNames[i].alias:propNames[i].name; | 819 | s = propNames[i].alias?propNames[i].alias:propNames[i].name; |
820 | return lookupStr(s); | 820 | return lookupStr(s); |
821 | } | 821 | } |
822 | return lookupStr(str); | 822 | return lookupStr(str); |
823 | } | 823 | } |
824 | 824 | ||
825 | 825 | ||
826 | DLLEXPORT(const char*) lookupProp(const char* str) | 826 | DLLEXPORT(const char*) lookupProp(const char* str) |
827 | { | 827 | { |
828 | int i; | 828 | int i; |
829 | 829 | ||
830 | for (i = 0; propNames[i].name; i++) | 830 | for (i = 0; propNames[i].name; i++) |
831 | if (qstricmp(str, propNames[i].name) == 0) { | 831 | if (qstricmp(str, propNames[i].name) == 0) { |
832 | const char *s; | 832 | const char *s; |
833 | fieldedProp = propNames[i].fields; | 833 | fieldedProp = propNames[i].fields; |
834 | s = propNames[i].alias?propNames[i].alias:propNames[i].name; | 834 | s = propNames[i].alias?propNames[i].alias:propNames[i].name; |
835 | return lookupStr(s); | 835 | return lookupStr(s); |
836 | } | 836 | } |
837 | fieldedProp = 0; | 837 | fieldedProp = 0; |
838 | return lookupStr(str); | 838 | return lookupStr(str); |
839 | } | 839 | } |
840 | 840 | ||
841 | 841 | ||
@@ -996,45 +996,45 @@ static int writeBase64(OFile *fp, unsigned char *s, long len) | |||
996 | } | 996 | } |
997 | // now output 'quad' with appropriate whitespace and line ending | 997 | // now output 'quad' with appropriate whitespace and line ending |
998 | appendsOFile(fp, (numQuads == 0 ? " " : "")); | 998 | appendsOFile(fp, (numQuads == 0 ? " " : "")); |
999 | appendsOFile(fp, quad); | 999 | appendsOFile(fp, quad); |
1000 | appendsOFile(fp, ((cur >= len)?"\n" :(numQuads==MAXQUADS-1?"\n" : ""))); | 1000 | appendsOFile(fp, ((cur >= len)?"\n" :(numQuads==MAXQUADS-1?"\n" : ""))); |
1001 | numQuads = (numQuads + 1) % MAXQUADS; | 1001 | numQuads = (numQuads + 1) % MAXQUADS; |
1002 | } | 1002 | } |
1003 | appendcOFile(fp,'\n'); | 1003 | appendcOFile(fp,'\n'); |
1004 | 1004 | ||
1005 | return 1; | 1005 | return 1; |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | static const char *replaceChar(unsigned char c) | 1008 | static const char *replaceChar(unsigned char c) |
1009 | { | 1009 | { |
1010 | if (c == '\n') { | 1010 | if (c == '\n') { |
1011 | return "=0A=\n"; | 1011 | return "=0A=\n"; |
1012 | } else if ( | 1012 | } else if ( |
1013 | (c >= 'A' && c <= 'Z') | 1013 | (c >= 'A' && c <= 'Z') |
1014 | || | 1014 | || |
1015 | (c >= 'a' && c <= 'z') | 1015 | (c >= 'a' && c <= 'z') |
1016 | || | 1016 | || |
1017 | (c >= '0' && c <= '9') | 1017 | (c >= '0' && c <= '9') |
1018 | || | 1018 | || |
1019 | (c >= '\'' && c <= ')') | 1019 | (c >= '\'' && c <= ')') |
1020 | || | 1020 | || |
1021 | (c >= '+' && c <= '-') | 1021 | (c >= '+' && c <= '-') |
1022 | || | 1022 | || |
1023 | (c == '/') | 1023 | (c == '/') |
1024 | || | 1024 | || |
1025 | (c == '?') | 1025 | (c == '?') |
1026 | || | 1026 | || |
1027 | (c == ' ')) | 1027 | (c == ' ')) |
1028 | { | 1028 | { |
1029 | return 0; | 1029 | return 0; |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static char trans[4]; | 1032 | static char trans[4]; |
1033 | trans[0] = '='; | 1033 | trans[0] = '='; |
1034 | trans[3] = '\0'; | 1034 | trans[3] = '\0'; |
1035 | int rem = c % 16; | 1035 | int rem = c % 16; |
1036 | int div = c / 16; | 1036 | int div = c / 16; |
1037 | 1037 | ||
1038 | if (div < 10) | 1038 | if (div < 10) |
1039 | trans[1] = '0' + div; | 1039 | trans[1] = '0' + div; |
1040 | else | 1040 | else |
@@ -1042,34 +1042,34 @@ static const char *replaceChar(unsigned char c) | |||
1042 | 1042 | ||
1043 | if (rem < 10) | 1043 | if (rem < 10) |
1044 | trans[2] = '0' + rem; | 1044 | trans[2] = '0' + rem; |
1045 | else | 1045 | else |
1046 | trans[2] = 'A' + (rem - 10); | 1046 | trans[2] = 'A' + (rem - 10); |
1047 | 1047 | ||
1048 | return trans; | 1048 | return trans; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | static void writeQPString(OFile *fp, const char *s) | 1051 | static void writeQPString(OFile *fp, const char *s) |
1052 | { | 1052 | { |
1053 | /* | 1053 | /* |
1054 | only A-Z, 0-9 and | 1054 | only A-Z, 0-9 and |
1055 | "'" (ASCII code 39) | 1055 | "'" (ASCII code 39) |
1056 | "(" (ASCII code 40) | 1056 | "(" (ASCII code 40) |
1057 | ")" (ASCII code 41) | 1057 | ")" (ASCII code 41) |
1058 | "+" (ASCII code 43) | 1058 | "+" (ASCII code 43) |
1059 | "," (ASCII code 44) | 1059 | "," (ASCII code 44) |
1060 | "-" (ASCII code 45) | 1060 | "-" (ASCII code 45) |
1061 | "/" (ASCII code 47) | 1061 | "/" (ASCII code 47) |
1062 | "?" (ASCII code 63) | 1062 | "?" (ASCII code 63) |
1063 | 1063 | ||
1064 | should remain un-encoded. | 1064 | should remain un-encoded. |
1065 | '=' needs to be encoded as it is the escape character. | 1065 | '=' needs to be encoded as it is the escape character. |
1066 | ';' needs to be as it is a field separator. | 1066 | ';' needs to be as it is a field separator. |
1067 | 1067 | ||
1068 | */ | 1068 | */ |
1069 | const char *p = s; | 1069 | const char *p = s; |
1070 | while (*p) { | 1070 | while (*p) { |
1071 | const char *rep = replaceChar(*p); | 1071 | const char *rep = replaceChar(*p); |
1072 | if (rep) | 1072 | if (rep) |
1073 | appendsOFile(fp, rep); | 1073 | appendsOFile(fp, rep); |
1074 | else | 1074 | else |
1075 | appendcOFile(fp, *p); | 1075 | appendcOFile(fp, *p); |
@@ -1084,25 +1084,25 @@ static bool includesUnprintable(VObject *o) | |||
1084 | const char *p = STRINGZ_VALUE_OF(o); | 1084 | const char *p = STRINGZ_VALUE_OF(o); |
1085 | if (p) { | 1085 | if (p) { |
1086 | while (*p) { | 1086 | while (*p) { |
1087 | if (replaceChar(*p)) | 1087 | if (replaceChar(*p)) |
1088 | return TRUE; | 1088 | return TRUE; |
1089 | p++; | 1089 | p++; |
1090 | } | 1090 | } |
1091 | } | 1091 | } |
1092 | } | 1092 | } |
1093 | } | 1093 | } |
1094 | return FALSE; | 1094 | return FALSE; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static void writeVObject_(OFile *fp, VObject *o); | 1097 | static void writeVObject_(OFile *fp, VObject *o); |
1098 | 1098 | ||
1099 | static void writeValue(OFile *fp, VObject *o, unsigned long size) | 1099 | static void writeValue(OFile *fp, VObject *o, unsigned long size) |
1100 | { | 1100 | { |
1101 | if (o == 0) return; | 1101 | if (o == 0) return; |
1102 | switch (VALUE_TYPE(o)) { | 1102 | switch (VALUE_TYPE(o)) { |
1103 | case VCVT_STRINGZ: { | 1103 | case VCVT_STRINGZ: { |
1104 | writeQPString(fp, STRINGZ_VALUE_OF(o)); | 1104 | writeQPString(fp, STRINGZ_VALUE_OF(o)); |
1105 | break; | 1105 | break; |
1106 | } | 1106 | } |
1107 | case VCVT_UINT: { | 1107 | case VCVT_UINT: { |
1108 | char buf[16]; | 1108 | char buf[16]; |
@@ -1220,25 +1220,25 @@ static void writeProp(OFile *fp, VObject *o) | |||
1220 | if (t) n = i; | 1220 | if (t) n = i; |
1221 | fields++; | 1221 | fields++; |
1222 | } | 1222 | } |
1223 | fields = fields_; | 1223 | fields = fields_; |
1224 | for (i=0;i<n;i++) { | 1224 | for (i=0;i<n;i++) { |
1225 | writeValue(fp,isAPropertyOf(o,*fields),0); | 1225 | writeValue(fp,isAPropertyOf(o,*fields),0); |
1226 | fields++; | 1226 | fields++; |
1227 | if (i<(n-1)) appendcOFile(fp,';'); | 1227 | if (i<(n-1)) appendcOFile(fp,';'); |
1228 | } | 1228 | } |
1229 | } | 1229 | } |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | 1232 | ||
1233 | if (VALUE_TYPE(o)) { | 1233 | if (VALUE_TYPE(o)) { |
1234 | if ( includesUnprintable(o) ) { | 1234 | if ( includesUnprintable(o) ) { |
1235 | appendsOFile(fp, ";" VCEncodingProp "=" VCQuotedPrintableProp); | 1235 | appendsOFile(fp, ";" VCEncodingProp "=" VCQuotedPrintableProp); |
1236 | appendsOFile(fp, ";" VCCharSetProp "=" "UTF-8"); | 1236 | appendsOFile(fp, ";" VCCharSetProp "=" "UTF-8"); |
1237 | } | 1237 | } |
1238 | unsigned long size = 0; | 1238 | unsigned long size = 0; |
1239 | VObject *p = isAPropertyOf(o,VCDataSizeProp); | 1239 | VObject *p = isAPropertyOf(o,VCDataSizeProp); |
1240 | if (p) size = LONG_VALUE_OF(p); | 1240 | if (p) size = LONG_VALUE_OF(p); |
1241 | appendcOFile(fp,':'); | 1241 | appendcOFile(fp,':'); |
1242 | writeValue(fp,o,size); | 1242 | writeValue(fp,o,size); |
1243 | } | 1243 | } |
1244 | 1244 | ||
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp index 272c223..4a9dcbd 100644 --- a/library/datebookmonth.cpp +++ b/library/datebookmonth.cpp | |||
@@ -13,25 +13,25 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "config.h" | 20 | #include "config.h" |
21 | #include "datebookmonth.h" | 21 | #include "datebookmonth.h" |
22 | #include "datebookdb.h" | 22 | #include "datebookdb.h" |
23 | #include <qtopia/private/event.h> | 23 | #include <qtopia/private/event.h> |
24 | #include "resource.h" | 24 | #include "resource.h" |
25 | #include "qpeapplication.h" | 25 | #include <qpe/qpeapplication.h> |
26 | #include "timestring.h" | 26 | #include "timestring.h" |
27 | 27 | ||
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qspinbox.h> | 29 | #include <qspinbox.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qpainter.h> | 32 | #include <qpainter.h> |
33 | #include <qpopupmenu.h> | 33 | #include <qpopupmenu.h> |
34 | #include <qvaluestack.h> | 34 | #include <qvaluestack.h> |
35 | #include <qwhatsthis.h> | 35 | #include <qwhatsthis.h> |
36 | 36 | ||
37 | 37 | ||
@@ -545,28 +545,28 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg, | |||
545 | QValueStack<int> travelLine; | 545 | QValueStack<int> travelLine; |
546 | 546 | ||
547 | bool normalAllDay = FALSE; | 547 | bool normalAllDay = FALSE; |
548 | bool repeatAllDay = FALSE; | 548 | bool repeatAllDay = FALSE; |
549 | bool travelAllDay = FALSE; | 549 | bool travelAllDay = FALSE; |
550 | 550 | ||
551 | QValueListIterator<EffectiveEvent> itDays = d->mDayEvents.begin(); | 551 | QValueListIterator<EffectiveEvent> itDays = d->mDayEvents.begin(); |
552 | 552 | ||
553 | for ( ; itDays != d->mDayEvents.end(); ++itDays ) { | 553 | for ( ; itDays != d->mDayEvents.end(); ++itDays ) { |
554 | int w = cr.width(); | 554 | int w = cr.width(); |
555 | Event ev = (*itDays).event(); | 555 | Event ev = (*itDays).event(); |
556 | 556 | ||
557 | int f = (*itDays).start().hour(); // assume Effective event | 557 | int f = (*itDays).start().hour(); // assume Effective event |
558 | int t = (*itDays).end().hour(); // is truncated. | 558 | int t = (*itDays).end().hour(); // is truncated. |
559 | 559 | ||
560 | if (ev.isAllDay()) { | 560 | if (ev.isAllDay()) { |
561 | if (!ev.hasRepeat()) | 561 | if (!ev.hasRepeat()) |
562 | normalAllDay = TRUE; | 562 | normalAllDay = TRUE; |
563 | else | 563 | else |
564 | repeatAllDay = TRUE; | 564 | repeatAllDay = TRUE; |
565 | } else { | 565 | } else { |
566 | int sLine, eLine; | 566 | int sLine, eLine; |
567 | if (f == 0) | 567 | if (f == 0) |
568 | sLine = 0; | 568 | sLine = 0; |
569 | else if (f < 8 ) | 569 | else if (f < 8 ) |
570 | sLine = 1; | 570 | sLine = 1; |
571 | else if (f >= 17) | 571 | else if (f >= 17) |
572 | sLine = w - 4; | 572 | sLine = w - 4; |
@@ -606,27 +606,27 @@ void DayItemMonth::paint( QPainter *p, const QColorGroup &cg, | |||
606 | if (repeatAllDay) { | 606 | if (repeatAllDay) { |
607 | p->fillRect( 0, 0, cr.width(), cr.height() / 2, | 607 | p->fillRect( 0, 0, cr.width(), cr.height() / 2, |
608 | colorNormalLight ); | 608 | colorNormalLight ); |
609 | p->fillRect( 0, cr.height() / 2, cr.width(), cr.height() / 2, | 609 | p->fillRect( 0, cr.height() / 2, cr.width(), cr.height() / 2, |
610 | colorRepeatLight ); | 610 | colorRepeatLight ); |
611 | } else | 611 | } else |
612 | p->fillRect( 0, 0, cr.width(), cr.height(), | 612 | p->fillRect( 0, 0, cr.width(), cr.height(), |
613 | colorNormalLight ); | 613 | colorNormalLight ); |
614 | else if (repeatAllDay) | 614 | else if (repeatAllDay) |
615 | p->fillRect( 0, 0, cr.width(), cr.height(), | 615 | p->fillRect( 0, 0, cr.width(), cr.height(), |
616 | colorRepeatLight ); | 616 | colorRepeatLight ); |
617 | } else { | 617 | } else { |
618 | p->fillRect( 0, 0, cr.width(), | 618 | p->fillRect( 0, 0, cr.width(), |
619 | cr.height(), selected | 619 | cr.height(), selected |
620 | ? g.brush( QColorGroup::Highlight ) | 620 | ? g.brush( QColorGroup::Highlight ) |
621 | : g.brush( QColorGroup::Base ) ); | 621 | : g.brush( QColorGroup::Base ) ); |
622 | } | 622 | } |
623 | 623 | ||
624 | // The lines | 624 | // The lines |
625 | // now for the lines. | 625 | // now for the lines. |
626 | int h = 5; | 626 | int h = 5; |
627 | int y = cr.height() / 2 - h; | 627 | int y = cr.height() / 2 - h; |
628 | 628 | ||
629 | while(normalLine.count() >= 2) { | 629 | while(normalLine.count() >= 2) { |
630 | int x2 = normalLine.pop(); | 630 | int x2 = normalLine.pop(); |
631 | int x1 = normalLine.pop(); | 631 | int x1 = normalLine.pop(); |
632 | if (x2 < x1 + 2) | 632 | if (x2 < x1 + 2) |
@@ -724,25 +724,25 @@ void DateButton::setWeekStartsMonday( int b ) | |||
724 | weekStartsMonday = b; | 724 | weekStartsMonday = b; |
725 | } | 725 | } |
726 | 726 | ||
727 | void DateButton::setDate( int y, int m, int d ) | 727 | void DateButton::setDate( int y, int m, int d ) |
728 | { | 728 | { |
729 | setDate( QDate( y,m,d) ); | 729 | setDate( QDate( y,m,d) ); |
730 | } | 730 | } |
731 | 731 | ||
732 | void DateButton::setDate( QDate d ) | 732 | void DateButton::setDate( QDate d ) |
733 | { | 733 | { |
734 | currDate = d; | 734 | currDate = d; |
735 | setText( longFormat ? TimeString::longDateString( d, df ) : | 735 | setText( longFormat ? TimeString::longDateString( d, df ) : |
736 | TimeString::shortDate( d, df ) ); | 736 | TimeString::shortDate( d, df ) ); |
737 | 737 | ||
738 | } | 738 | } |
739 | 739 | ||
740 | void DateButton::setDateFormat( DateFormat f ) | 740 | void DateButton::setDateFormat( DateFormat f ) |
741 | { | 741 | { |
742 | df = f; | 742 | df = f; |
743 | setDate( currDate ); | 743 | setDate( currDate ); |
744 | } | 744 | } |
745 | 745 | ||
746 | bool DateButton::customWhatsThis() const | 746 | bool DateButton::customWhatsThis() const |
747 | { | 747 | { |
748 | return TRUE; | 748 | return TRUE; |
diff --git a/library/fileselector.cpp b/library/fileselector.cpp index 7ff09b4..052a29e 100644 --- a/library/fileselector.cpp +++ b/library/fileselector.cpp | |||
@@ -22,33 +22,33 @@ | |||
22 | // have this class. | 22 | // have this class. |
23 | #define QTOPIA_INTERNAL_FSLP | 23 | #define QTOPIA_INTERNAL_FSLP |
24 | 24 | ||
25 | #include "fileselector.h" | 25 | #include "fileselector.h" |
26 | #include "fileselector_p.h" | 26 | #include "fileselector_p.h" |
27 | #include "global.h" | 27 | #include "global.h" |
28 | #include "resource.h" | 28 | #include "resource.h" |
29 | #include "config.h" | 29 | #include "config.h" |
30 | #include "applnk.h" | 30 | #include "applnk.h" |
31 | #include "storage.h" | 31 | #include "storage.h" |
32 | #include "qpemenubar.h" | 32 | #include "qpemenubar.h" |
33 | #ifdef QWS | 33 | #ifdef QWS |
34 | #include "qcopchannel_qws.h" | 34 | #include <qcopchannel_qws.h> |
35 | #endif | 35 | #endif |
36 | #include "lnkproperties.h" | 36 | #include "lnkproperties.h" |
37 | #include "applnk.h" | 37 | #include "applnk.h" |
38 | #include "qpeapplication.h" | 38 | #include <qpe/qpeapplication.h> |
39 | #include "categorymenu.h" | 39 | #include "categorymenu.h" |
40 | #include "categoryselect.h" | 40 | #include "categoryselect.h" |
41 | #include "mimetype.h" | 41 | #include "mimetype.h" |
42 | #include "categories.h" | 42 | #include <qpe/categories.h> |
43 | 43 | ||
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | 45 | ||
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qwidget.h> | 47 | #include <qwidget.h> |
48 | #include <qpopupmenu.h> | 48 | #include <qpopupmenu.h> |
49 | #include <qtoolbutton.h> | 49 | #include <qtoolbutton.h> |
50 | #include <qpushbutton.h> | 50 | #include <qpushbutton.h> |
51 | #include <qheader.h> | 51 | #include <qheader.h> |
52 | #include <qtooltip.h> | 52 | #include <qtooltip.h> |
53 | #include <qwhatsthis.h> | 53 | #include <qwhatsthis.h> |
54 | 54 | ||
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp index c64e645..2b5e0d2 100644 --- a/library/fontdatabase.cpp +++ b/library/fontdatabase.cpp | |||
@@ -9,25 +9,25 @@ | |||
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qpeapplication.h" | 21 | #include <qpe/qpeapplication.h> |
22 | #include "fontfactoryinterface.h" | 22 | #include "fontfactoryinterface.h" |
23 | #include "fontdatabase.h" | 23 | #include "fontdatabase.h" |
24 | 24 | ||
25 | #include <qpe/qlibrary.h> | 25 | #include <qpe/qlibrary.h> |
26 | 26 | ||
27 | #ifdef QWS | 27 | #ifdef QWS |
28 | #include <qfontmanager_qws.h> | 28 | #include <qfontmanager_qws.h> |
29 | #endif | 29 | #endif |
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qdict.h> | 31 | #include <qdict.h> |
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
diff --git a/library/fontdatabase.h b/library/fontdatabase.h index 10aec91..991847b 100644 --- a/library/fontdatabase.h +++ b/library/fontdatabase.h | |||
@@ -27,24 +27,25 @@ | |||
27 | 27 | ||
28 | class QLibrary; | 28 | class QLibrary; |
29 | 29 | ||
30 | struct FontFactory | 30 | struct FontFactory |
31 | { | 31 | { |
32 | #ifndef QT_NO_COMPONENT | 32 | #ifndef QT_NO_COMPONENT |
33 | QLibrary *library; | 33 | QLibrary *library; |
34 | #endif | 34 | #endif |
35 | FontFactoryInterface *interface; | 35 | FontFactoryInterface *interface; |
36 | QFontFactory *factory; | 36 | QFontFactory *factory; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #undef QT_NO_FONTDATABASE | ||
39 | class FontDatabase | 40 | class FontDatabase |
40 | #ifndef QT_NO_FONTDATABASE | 41 | #ifndef QT_NO_FONTDATABASE |
41 | : public QFontDatabase | 42 | : public QFontDatabase |
42 | #endif | 43 | #endif |
43 | { | 44 | { |
44 | public: | 45 | public: |
45 | FontDatabase(); | 46 | FontDatabase(); |
46 | 47 | ||
47 | // minimal functionality | 48 | // minimal functionality |
48 | QStringList families () const; | 49 | QStringList families () const; |
49 | #ifdef QT_NO_FONTDATABASE | 50 | #ifdef QT_NO_FONTDATABASE |
50 | static QValueList<int> standardSizes (); | 51 | static QValueList<int> standardSizes (); |
diff --git a/library/mimetype.cpp b/library/mimetype.cpp index 92fe5e6..ef5d619 100644 --- a/library/mimetype.cpp +++ b/library/mimetype.cpp | |||
@@ -13,25 +13,25 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_MIMEEXT | 21 | #define QTOPIA_INTERNAL_MIMEEXT |
22 | #include "mimetype.h" | 22 | #include "mimetype.h" |
23 | #include "applnk.h" | 23 | #include "applnk.h" |
24 | #include "resource.h" | 24 | #include "resource.h" |
25 | #include "qpeapplication.h" | 25 | #include <qpe/qpeapplication.h> |
26 | #include "config.h" | 26 | #include "config.h" |
27 | 27 | ||
28 | #include <qfile.h> | 28 | #include <qfile.h> |
29 | #include <qdict.h> | 29 | #include <qdict.h> |
30 | #include <qregexp.h> | 30 | #include <qregexp.h> |
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qmap.h> | 33 | #include <qmap.h> |
34 | 34 | ||
35 | 35 | ||
36 | static void cleanupMime() | 36 | static void cleanupMime() |
37 | { | 37 | { |
diff --git a/library/qpedialog.cpp b/library/qpedialog.cpp index 0db161b..b98e42e 100644 --- a/library/qpedialog.cpp +++ b/library/qpedialog.cpp | |||
@@ -14,33 +14,33 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define protected public | 21 | #define protected public |
22 | #include <qdialog.h> | 22 | #include <qdialog.h> |
23 | #undef protected | 23 | #undef protected |
24 | 24 | ||
25 | #include "qpedialog.h" | 25 | #include "qpedialog.h" |
26 | #include "qpeapplication.h" | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | ||
28 | QPEDialogListener::QPEDialogListener(QDialog *di ) : QObject(di) | 28 | QPEDialogListener::QPEDialogListener(QDialog *di ) : QObject(di) |
29 | { | 29 | { |
30 | dialog = di; | 30 | dialog = di; |
31 | connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | 31 | connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), |
32 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); | 32 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); |
33 | } | 33 | } |
34 | 34 | ||
35 | QPEDialogListener::~QPEDialogListener() {} | 35 | QPEDialogListener::~QPEDialogListener() {} |
36 | 36 | ||
37 | void QPEDialogListener::appMessage( const QCString &msg, const QByteArray & ) | 37 | void QPEDialogListener::appMessage( const QCString &msg, const QByteArray & ) |
38 | { | 38 | { |
39 | if (!dialog) | 39 | if (!dialog) |
40 | return; | 40 | return; |
41 | if (msg == "accept()") { | 41 | if (msg == "accept()") { |
42 | dialog->accept(); | 42 | dialog->accept(); |
43 | } else if (msg == "reject()") { | 43 | } else if (msg == "reject()") { |
44 | dialog->reject(); | 44 | dialog->reject(); |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp index dfd300f..665910c 100644 --- a/library/qpestyle.cpp +++ b/library/qpestyle.cpp | |||
@@ -10,25 +10,25 @@ | |||
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qpestyle.h" | 21 | #include "qpestyle.h" |
22 | #include "qpeapplication.h" | 22 | #include <qpe/qpeapplication.h> |
23 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | 24 | ||
25 | #include <qpainter.h> | 25 | #include <qpainter.h> |
26 | 26 | ||
27 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) | 27 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) |
28 | 28 | ||
29 | #if QT_VERSION >= 300 | 29 | #if QT_VERSION >= 300 |
30 | 30 | ||
31 | #include <qdrawutil.h> | 31 | #include <qdrawutil.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qtabbar.h> | 33 | #include <qtabbar.h> |
34 | 34 | ||
@@ -215,25 +215,25 @@ void QPEStyle::drawControl( ControlElement ce, QPainter *p, | |||
215 | p->drawLine( r2.left()+2, r2.top()+1, r2.right()-2, r2.top()+1 ); | 215 | p->drawLine( r2.left()+2, r2.top()+1, r2.right()-2, r2.top()+1 ); |
216 | p->fillRect( QRect( r2.left()+1, r2.top()+2, r2.width()-2, r2.height()-2), | 216 | p->fillRect( QRect( r2.left()+1, r2.top()+2, r2.width()-2, r2.height()-2), |
217 | cg.brush( QColorGroup::Background )); | 217 | cg.brush( QColorGroup::Background )); |
218 | } else { | 218 | } else { |
219 | r2.setRect( r2.left() + 2, r2.top() + 2, | 219 | r2.setRect( r2.left() + 2, r2.top() + 2, |
220 | r2.width() - 4, r2.height() - 2 ); | 220 | r2.width() - 4, r2.height() - 2 ); |
221 | p->setPen( cg.button() ); | 221 | p->setPen( cg.button() ); |
222 | p->drawLine( r2.left()+2, r2.top()+1, r2.right()-2, r2.top()+1 ); | 222 | p->drawLine( r2.left()+2, r2.top()+1, r2.right()-2, r2.top()+1 ); |
223 | p->fillRect( QRect( r2.left()+1, r2.top()+2, r2.width()-2, r2.height()-3), | 223 | p->fillRect( QRect( r2.left()+1, r2.top()+2, r2.width()-2, r2.height()-3), |
224 | cg.brush( QColorGroup::Button )); | 224 | cg.brush( QColorGroup::Button )); |
225 | 225 | ||
226 | //do shading; will not work for pixmap brushes | 226 | //do shading; will not work for pixmap brushes |
227 | QColor bg = cg.button(); | 227 | QColor bg = cg.button(); |
228 | // int h,s,v; | 228 | // int h,s,v; |
229 | // bg.hsv( &h, &s, &v ); | 229 | // bg.hsv( &h, &s, &v ); |
230 | int n = r2.height()/2; | 230 | int n = r2.height()/2; |
231 | int dark = 100; | 231 | int dark = 100; |
232 | for ( int i = 1; i < n; i++ ) { | 232 | for ( int i = 1; i < n; i++ ) { |
233 | dark = (dark * (100+(i*15)/n) )/100; | 233 | dark = (dark * (100+(i*15)/n) )/100; |
234 | p->setPen( bg.dark( dark ) ); | 234 | p->setPen( bg.dark( dark ) ); |
235 | int y = r2.bottom()-n+i; | 235 | int y = r2.bottom()-n+i; |
236 | int x1 = r2.left()+1; | 236 | int x1 = r2.left()+1; |
237 | int x2 = r2.right()-1; | 237 | int x2 = r2.right()-1; |
238 | p->drawLine( x1, y, x2, y ); | 238 | p->drawLine( x1, y, x2, y ); |
239 | } | 239 | } |
@@ -524,26 +524,26 @@ void QPEStyle::drawButtonMask ( QPainter * p, int x, int y, int w, int h ) | |||
524 | } | 524 | } |
525 | 525 | ||
526 | void QPEStyle::drawBevelButton( QPainter *p, int x, int y, int w, int h, | 526 | void QPEStyle::drawBevelButton( QPainter *p, int x, int y, int w, int h, |
527 | const QColorGroup &g, bool sunken, const QBrush* fill ) | 527 | const QColorGroup &g, bool sunken, const QBrush* fill ) |
528 | { | 528 | { |
529 | drawButton( p, x, y, w, h, g, sunken, fill ); | 529 | drawButton( p, x, y, w, h, g, sunken, fill ); |
530 | } | 530 | } |
531 | 531 | ||
532 | QRect QPEStyle::comboButtonRect( int x, int y, int w, int h) | 532 | QRect QPEStyle::comboButtonRect( int x, int y, int w, int h) |
533 | { | 533 | { |
534 | return QRect(x+1, y+1, w-2-14, h-2); | 534 | return QRect(x+1, y+1, w-2-14, h-2); |
535 | } | 535 | } |
536 | 536 | ||
537 | 537 | ||
538 | QRect QPEStyle::comboButtonFocusRect( int x, int y, int w, int h) | 538 | QRect QPEStyle::comboButtonFocusRect( int x, int y, int w, int h) |
539 | { | 539 | { |
540 | return QRect(x+2, y+2, w-4-14, h-4); | 540 | return QRect(x+2, y+2, w-4-14, h-4); |
541 | } | 541 | } |
542 | 542 | ||
543 | void QPEStyle::drawComboButton( QPainter *p, int x, int y, int w, int h, | 543 | void QPEStyle::drawComboButton( QPainter *p, int x, int y, int w, int h, |
544 | const QColorGroup &g, bool sunken, | 544 | const QColorGroup &g, bool sunken, |
545 | bool /*editable*/, | 545 | bool /*editable*/, |
546 | bool enabled, | 546 | bool enabled, |
547 | const QBrush *fill ) | 547 | const QBrush *fill ) |
548 | { | 548 | { |
549 | drawBevelButton( p, x, y, w, h, g, FALSE, fill ); | 549 | drawBevelButton( p, x, y, w, h, g, FALSE, fill ); |
@@ -909,25 +909,25 @@ void QPEStyle::drawTab( QPainter *p, const QTabBar *tb, QTab *t, bool selected ) | |||
909 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); | 909 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); |
910 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-2), | 910 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-2), |
911 | tb->colorGroup().brush( QColorGroup::Background )); | 911 | tb->colorGroup().brush( QColorGroup::Background )); |
912 | } else { | 912 | } else { |
913 | r.setRect( r.left() + 2, r.top() + 2, | 913 | r.setRect( r.left() + 2, r.top() + 2, |
914 | r.width() - 4, r.height() - 2 ); | 914 | r.width() - 4, r.height() - 2 ); |
915 | p->setPen( tb->colorGroup().button() ); | 915 | p->setPen( tb->colorGroup().button() ); |
916 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); | 916 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); |
917 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-3), | 917 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-3), |
918 | tb->colorGroup().brush( QColorGroup::Button )); | 918 | tb->colorGroup().brush( QColorGroup::Button )); |
919 | 919 | ||
920 | //do shading; will not work for pixmap brushes | 920 | //do shading; will not work for pixmap brushes |
921 | QColor bg = tb->colorGroup().button(); | 921 | QColor bg = tb->colorGroup().button(); |
922 | // int h,s,v; | 922 | // int h,s,v; |
923 | // bg.hsv( &h, &s, &v ); | 923 | // bg.hsv( &h, &s, &v ); |
924 | int n = r.height()/2; | 924 | int n = r.height()/2; |
925 | int dark = 100; | 925 | int dark = 100; |
926 | for ( int i = 1; i < n; i++ ) { | 926 | for ( int i = 1; i < n; i++ ) { |
927 | dark = (dark * (100+(i*15)/n) )/100; | 927 | dark = (dark * (100+(i*15)/n) )/100; |
928 | p->setPen( bg.dark( dark ) ); | 928 | p->setPen( bg.dark( dark ) ); |
929 | int y = r.bottom()-n+i; | 929 | int y = r.bottom()-n+i; |
930 | int x1 = r.left()+1; | 930 | int x1 = r.left()+1; |
931 | int x2 = r.right()-1; | 931 | int x2 = r.right()-1; |
932 | p->drawLine( x1, y, x2, y ); | 932 | p->drawLine( x1, y, x2, y ); |
933 | } | 933 | } |
@@ -1019,47 +1019,47 @@ int QPEStyle::extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem* mi | |||
1019 | w += motifCheckMarkHMargin; // add space to separate the columns | 1019 | w += motifCheckMarkHMargin; // add space to separate the columns |
1020 | 1020 | ||
1021 | w += windowsRightBorder; // windows has a strange wide border on the right side | 1021 | w += windowsRightBorder; // windows has a strange wide border on the right side |
1022 | 1022 | ||
1023 | return w; | 1023 | return w; |
1024 | #endif | 1024 | #endif |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | /*! \reimp | 1027 | /*! \reimp |
1028 | */ | 1028 | */ |
1029 | int QPEStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) | 1029 | int QPEStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) |
1030 | { | 1030 | { |
1031 | #ifndef QT_NO_MENUDATA | 1031 | #ifndef QT_NO_MENUDATA |
1032 | int h = 0; | 1032 | int h = 0; |
1033 | if ( mi->isSeparator() ) // separator height | 1033 | if ( mi->isSeparator() ) // separator height |
1034 | h = motifSepHeight; | 1034 | h = motifSepHeight; |
1035 | else if ( mi->pixmap() ) // pixmap height | 1035 | else if ( mi->pixmap() ) // pixmap height |
1036 | h = mi->pixmap()->height() + 2*motifItemFrame; | 1036 | h = mi->pixmap()->height() + 2*motifItemFrame; |
1037 | else // text height | 1037 | else // text height |
1038 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; | 1038 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; |
1039 | 1039 | ||
1040 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { | 1040 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { |
1041 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); | 1041 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); |
1042 | } | 1042 | } |
1043 | if ( mi->custom() ) | 1043 | if ( mi->custom() ) |
1044 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; | 1044 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; |
1045 | return h; | 1045 | return h; |
1046 | #endif | 1046 | #endif |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | void QPEStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, | 1049 | void QPEStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, |
1050 | const QPalette& pal, | 1050 | const QPalette& pal, |
1051 | bool act, bool enabled, int x, int y, int w, int h) | 1051 | bool act, bool enabled, int x, int y, int w, int h) |
1052 | { | 1052 | { |
1053 | #ifndef QT_NO_MENUDATA | 1053 | #ifndef QT_NO_MENUDATA |
1054 | const QColorGroup & g = pal.active(); | 1054 | const QColorGroup & g = pal.active(); |
1055 | bool dis = !enabled; | 1055 | bool dis = !enabled; |
1056 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 1056 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
1057 | 1057 | ||
1058 | if ( checkable ) | 1058 | if ( checkable ) |
1059 | maxpmw = QMAX( maxpmw, 8 ); // space for the checkmarks | 1059 | maxpmw = QMAX( maxpmw, 8 ); // space for the checkmarks |
1060 | 1060 | ||
1061 | int checkcol = maxpmw; | 1061 | int checkcol = maxpmw; |
1062 | 1062 | ||
1063 | if ( mi && mi->isSeparator() ) { // draw separator | 1063 | if ( mi && mi->isSeparator() ) { // draw separator |
1064 | p->setPen( g.dark() ); | 1064 | p->setPen( g.dark() ); |
1065 | p->drawLine( x, y, x+w, y ); | 1065 | p->drawLine( x, y, x+w, y ); |
diff --git a/library/resource.cpp b/library/resource.cpp index bdcd603..0920b67 100644 --- a/library/resource.cpp +++ b/library/resource.cpp | |||
@@ -10,25 +10,25 @@ | |||
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_MIMEEXT | 21 | #define QTOPIA_INTERNAL_MIMEEXT |
22 | #include "qpeapplication.h" | 22 | #include <qpe/qpeapplication.h> |
23 | #include "resource.h" | 23 | #include "resource.h" |
24 | #include "mimetype.h" | 24 | #include "mimetype.h" |
25 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include <qfile.h> | 26 | #include <qfile.h> |
27 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | #include <qpixmapcache.h> | 28 | #include <qpixmapcache.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | 30 | ||
31 | // this namespace is just a workaround for a gcc bug | 31 | // this namespace is just a workaround for a gcc bug |
32 | // gcc exports inline functions in the generated file | 32 | // gcc exports inline functions in the generated file |
33 | // inlinepics_p.h | 33 | // inlinepics_p.h |
34 | 34 | ||
diff --git a/library/timestring.cpp b/library/timestring.cpp index 4c6fa72..6443b6b 100644 --- a/library/timestring.cpp +++ b/library/timestring.cpp | |||
@@ -11,25 +11,25 @@ | |||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "timestring.h" | 21 | #include "timestring.h" |
22 | #include <qobject.h> | 22 | #include <qobject.h> |
23 | #include "qpeapplication.h" //for qApp | 23 | #include <qpe/qpeapplication.h> //for qApp |
24 | #include "config.h" | 24 | #include "config.h" |
25 | 25 | ||
26 | 26 | ||
27 | class TimeStringFormatKeeper : public QObject | 27 | class TimeStringFormatKeeper : public QObject |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | public: | 30 | public: |
31 | static DateFormat currentFormat() | 31 | static DateFormat currentFormat() |
32 | { | 32 | { |
33 | if ( !self ) | 33 | if ( !self ) |
34 | self = new TimeStringFormatKeeper; | 34 | self = new TimeStringFormatKeeper; |
35 | return self->format; | 35 | return self->format; |
@@ -40,98 +40,98 @@ private slots: | |||
40 | format = f; | 40 | format = f; |
41 | } | 41 | } |
42 | private: | 42 | private: |
43 | static TimeStringFormatKeeper *self; | 43 | static TimeStringFormatKeeper *self; |
44 | DateFormat format; | 44 | DateFormat format; |
45 | 45 | ||
46 | TimeStringFormatKeeper() | 46 | TimeStringFormatKeeper() |
47 | : QObject( qApp ) | 47 | : QObject( qApp ) |
48 | { | 48 | { |
49 | Config config("qpe"); | 49 | Config config("qpe"); |
50 | config.setGroup( "Date" ); | 50 | config.setGroup( "Date" ); |
51 | format = DateFormat(QChar(config.readEntry("Separator", "/")[0]), | 51 | format = DateFormat(QChar(config.readEntry("Separator", "/")[0]), |
52 | (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear), | 52 | (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear), |
53 | (DateFormat::Order)config.readNumEntry("LongOrder", DateFormat::DayMonthYear)); | 53 | (DateFormat::Order)config.readNumEntry("LongOrder", DateFormat::DayMonthYear)); |
54 | 54 | ||
55 | connect( qApp, SIGNAL( dateFormatChanged(DateFormat) ), | 55 | connect( qApp, SIGNAL( dateFormatChanged(DateFormat) ), |
56 | this, SLOT( formatChanged( DateFormat ) ) ); | 56 | this, SLOT( formatChanged( DateFormat ) ) ); |
57 | } | 57 | } |
58 | }; | 58 | }; |
59 | 59 | ||
60 | TimeStringFormatKeeper *TimeStringFormatKeeper::self = 0; | 60 | TimeStringFormatKeeper *TimeStringFormatKeeper::self = 0; |
61 | 61 | ||
62 | QString DateFormat::toNumberString() const | 62 | QString DateFormat::toNumberString() const |
63 | { | 63 | { |
64 | QString buf = ""; | 64 | QString buf = ""; |
65 | // for each part of the order | 65 | // for each part of the order |
66 | for (int i = 0; i < 3; i++) { | 66 | for (int i = 0; i < 3; i++) { |
67 | // switch on the relavent 3 bits. | 67 | // switch on the relavent 3 bits. |
68 | switch((_shortOrder >> (i * 3)) & 0x0007) { | 68 | switch((_shortOrder >> (i * 3)) & 0x0007) { |
69 | case 0x0001: | 69 | case 0x0001: |
70 | buf += QObject::tr( "D" ); | 70 | buf += QObject::tr( "D" ); |
71 | break; | 71 | break; |
72 | case 0x0002: | 72 | case 0x0002: |
73 | buf += QObject::tr( "M" ); | 73 | buf += QObject::tr( "M" ); |
74 | break; | 74 | break; |
75 | case 0x0004: | 75 | case 0x0004: |
76 | buf += QObject::tr( "Y" ); | 76 | buf += QObject::tr( "Y" ); |
77 | break; | 77 | break; |
78 | } | 78 | } |
79 | if (i < 2) | 79 | if (i < 2) |
80 | buf += _shortSeparator; | 80 | buf += _shortSeparator; |
81 | } | 81 | } |
82 | return buf; | 82 | return buf; |
83 | } | 83 | } |
84 | 84 | ||
85 | QString DateFormat::toWordString() const | 85 | QString DateFormat::toWordString() const |
86 | { | 86 | { |
87 | QString buf = ""; | 87 | QString buf = ""; |
88 | // for each part of the order | 88 | // for each part of the order |
89 | for (int i = 0; i < 3; i++) { | 89 | for (int i = 0; i < 3; i++) { |
90 | // switch on the relavent 3 bits. | 90 | // switch on the relavent 3 bits. |
91 | switch((_longOrder >> (i * 3)) & 0x0007) { | 91 | switch((_longOrder >> (i * 3)) & 0x0007) { |
92 | case 0x0001: | 92 | case 0x0001: |
93 | buf += QObject::tr( "day" ); | 93 | buf += QObject::tr( "day" ); |
94 | if (i < 2) { | 94 | if (i < 2) { |
95 | if ((_shortOrder << ((i+1) * 3)) & 0x0007) | 95 | if ((_shortOrder << ((i+1) * 3)) & 0x0007) |
96 | buf += ", "; | 96 | buf += ", "; |
97 | else | 97 | else |
98 | buf += " "; | 98 | buf += " "; |
99 | } | 99 | } |
100 | break; | 100 | break; |
101 | case 0x0002: | 101 | case 0x0002: |
102 | buf += QObject::tr( "month" ); | 102 | buf += QObject::tr( "month" ); |
103 | if (i < 2) | 103 | if (i < 2) |
104 | buf += " "; | 104 | buf += " "; |
105 | break; | 105 | break; |
106 | case 0x0004: | 106 | case 0x0004: |
107 | buf += QObject::tr( "year" ); | 107 | buf += QObject::tr( "year" ); |
108 | if (i < 2) | 108 | if (i < 2) |
109 | buf += ", "; | 109 | buf += ", "; |
110 | break; | 110 | break; |
111 | } | 111 | } |
112 | } | 112 | } |
113 | return buf; | 113 | return buf; |
114 | } | 114 | } |
115 | 115 | ||
116 | QString DateFormat::numberDate(const QDate &d, int v) const | 116 | QString DateFormat::numberDate(const QDate &d, int v) const |
117 | { | 117 | { |
118 | QString buf = ""; | 118 | QString buf = ""; |
119 | 119 | ||
120 | int pad = 2; | 120 | int pad = 2; |
121 | 121 | ||
122 | // for each part of the order | 122 | // for each part of the order |
123 | for (int i = 0; i < 3; i++) { | 123 | for (int i = 0; i < 3; i++) { |
124 | // switch on the relavent 3 bits. | 124 | // switch on the relavent 3 bits. |
125 | switch((_shortOrder >> (i * 3)) & 0x0007) { | 125 | switch((_shortOrder >> (i * 3)) & 0x0007) { |
126 | case 0x0001: | 126 | case 0x0001: |
127 | if (pad==2) buf += QString().sprintf("%02d",d.day()); | 127 | if (pad==2) buf += QString().sprintf("%02d",d.day()); |
128 | else buf += QString().sprintf("%d",d.day()); | 128 | else buf += QString().sprintf("%d",d.day()); |
129 | break; | 129 | break; |
130 | case 0x0002: | 130 | case 0x0002: |
131 | if (i==0) { // no padding with only MM/DD/YY format | 131 | if (i==0) { // no padding with only MM/DD/YY format |
132 | pad=0; | 132 | pad=0; |
133 | } | 133 | } |
134 | if (pad==2) buf += QString().sprintf("%02d",d.month()); | 134 | if (pad==2) buf += QString().sprintf("%02d",d.month()); |
135 | else buf += QString().sprintf("%d",d.month()); | 135 | else buf += QString().sprintf("%d",d.month()); |
136 | break; | 136 | break; |
137 | case 0x0004: | 137 | case 0x0004: |
@@ -152,83 +152,83 @@ QString DateFormat::numberDate(const QDate &d, int v) const | |||
152 | QString DateFormat::wordDate(const QDate &d, int v) const | 152 | QString DateFormat::wordDate(const QDate &d, int v) const |
153 | { | 153 | { |
154 | QString buf = ""; | 154 | QString buf = ""; |
155 | // for each part of the order | 155 | // for each part of the order |
156 | if (v & showWeekDay) { | 156 | if (v & showWeekDay) { |
157 | QString weekDay = d.dayName(d.dayOfWeek()); | 157 | QString weekDay = d.dayName(d.dayOfWeek()); |
158 | if (!(v & longWord)) { | 158 | if (!(v & longWord)) { |
159 | weekDay = weekDay.left(3); | 159 | weekDay = weekDay.left(3); |
160 | } | 160 | } |
161 | buf += weekDay; | 161 | buf += weekDay; |
162 | if ((_longOrder & 0x0007) == 0x0002) | 162 | if ((_longOrder & 0x0007) == 0x0002) |
163 | buf += ' '; | 163 | buf += ' '; |
164 | else | 164 | else |
165 | buf += ", "; | 165 | buf += ", "; |
166 | } | 166 | } |
167 | 167 | ||
168 | for (int i = 0; i < 3; i++) { | 168 | for (int i = 0; i < 3; i++) { |
169 | // switch on the relavent 3 bits. | 169 | // switch on the relavent 3 bits. |
170 | switch((_longOrder >> (i * 3)) & 0x0007) { | 170 | switch((_longOrder >> (i * 3)) & 0x0007) { |
171 | case 0x0001: | 171 | case 0x0001: |
172 | if (i==1) { | 172 | if (i==1) { |
173 | buf += QString().sprintf("%02d, ",d.day()); | 173 | buf += QString().sprintf("%02d, ",d.day()); |
174 | } else { | 174 | } else { |
175 | buf += QString().sprintf("%2d",d.day()); | 175 | buf += QString().sprintf("%2d",d.day()); |
176 | if (separator()=='.') // 2002/1/11 | 176 | if (separator()=='.') // 2002/1/11 |
177 | buf += ". "; | 177 | buf += ". "; |
178 | else | 178 | else |
179 | buf += " "; | 179 | buf += " "; |
180 | } | 180 | } |
181 | break; | 181 | break; |
182 | case 0x0002: | 182 | case 0x0002: |
183 | { | 183 | { |
184 | QString monthName = d.monthName(d.month()); | 184 | QString monthName = d.monthName(d.month()); |
185 | if (!(v & longWord)) { | 185 | if (!(v & longWord)) { |
186 | monthName = monthName.left(3); | 186 | monthName = monthName.left(3); |
187 | } | 187 | } |
188 | buf += monthName; | 188 | buf += monthName; |
189 | } | 189 | } |
190 | if (i < 2) | 190 | if (i < 2) |
191 | buf += " "; | 191 | buf += " "; |
192 | break; | 192 | break; |
193 | case 0x0004: | 193 | case 0x0004: |
194 | { | 194 | { |
195 | int year = d.year(); | 195 | int year = d.year(); |
196 | if (!(v & longNumber)) | 196 | if (!(v & longNumber)) |
197 | year = year % 100; | 197 | year = year % 100; |
198 | 198 | ||
199 | if (year < 10) | 199 | if (year < 10) |
200 | buf += "0"; | 200 | buf += "0"; |
201 | 201 | ||
202 | buf += QString::number(year); | 202 | buf += QString::number(year); |
203 | } | 203 | } |
204 | if (i < 2) | 204 | if (i < 2) |
205 | buf += ", "; | 205 | buf += ", "; |
206 | break; | 206 | break; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | return buf; | 209 | return buf; |
210 | } | 210 | } |
211 | 211 | ||
212 | #ifndef QT_NO_DATASTREAM | 212 | #ifndef QT_NO_DATASTREAM |
213 | void DateFormat::save(QDataStream &d) const | 213 | void DateFormat::save(QDataStream &d) const |
214 | { | 214 | { |
215 | d << _shortSeparator.unicode(); | 215 | d << _shortSeparator.unicode(); |
216 | uint v= _shortOrder; | 216 | uint v= _shortOrder; |
217 | d << v; | 217 | d << v; |
218 | v = _longOrder; | 218 | v = _longOrder; |
219 | d << v; | 219 | d << v; |
220 | } | 220 | } |
221 | 221 | ||
222 | void DateFormat::load(QDataStream &d) | 222 | void DateFormat::load(QDataStream &d) |
223 | { | 223 | { |
224 | ushort value; | 224 | ushort value; |
225 | d >> value; | 225 | d >> value; |
226 | _shortSeparator = QChar(value); | 226 | _shortSeparator = QChar(value); |
227 | uint v = 0; | 227 | uint v = 0; |
228 | d >> v; | 228 | d >> v; |
229 | _shortOrder = (Order)v; | 229 | _shortOrder = (Order)v; |
230 | v = 0; | 230 | v = 0; |
231 | d >> v; | 231 | d >> v; |
232 | _longOrder = (Order)v; | 232 | _longOrder = (Order)v; |
233 | } | 233 | } |
234 | 234 | ||
@@ -248,25 +248,25 @@ QString TimeString::shortDate( const QDate &d, DateFormat dtf ) | |||
248 | { | 248 | { |
249 | return dtf.wordDate(d); | 249 | return dtf.wordDate(d); |
250 | } | 250 | } |
251 | 251 | ||
252 | QString TimeString::dateString( const QDate &d, DateFormat dtf ) | 252 | QString TimeString::dateString( const QDate &d, DateFormat dtf ) |
253 | { | 253 | { |
254 | return dtf.wordDate(d, DateFormat::longNumber | DateFormat::longWord); | 254 | return dtf.wordDate(d, DateFormat::longNumber | DateFormat::longWord); |
255 | } | 255 | } |
256 | 256 | ||
257 | 257 | ||
258 | QString TimeString::longDateString( const QDate &d, DateFormat dtf ) | 258 | QString TimeString::longDateString( const QDate &d, DateFormat dtf ) |
259 | { | 259 | { |
260 | return dtf.wordDate(d, DateFormat::showWeekDay | DateFormat::longNumber | 260 | return dtf.wordDate(d, DateFormat::showWeekDay | DateFormat::longNumber |
261 | | DateFormat::longWord); | 261 | | DateFormat::longWord); |
262 | } | 262 | } |
263 | 263 | ||
264 | DateFormat TimeString::currentDateFormat() | 264 | DateFormat TimeString::currentDateFormat() |
265 | { | 265 | { |
266 | return TimeStringFormatKeeper::currentFormat(); | 266 | return TimeStringFormatKeeper::currentFormat(); |
267 | } | 267 | } |
268 | 268 | ||
269 | 269 | ||
270 | QString TimeString::dateString( const QDateTime &dt, bool ampm, bool seconds, DateFormat dtf ) | 270 | QString TimeString::dateString( const QDateTime &dt, bool ampm, bool seconds, DateFormat dtf ) |
271 | { | 271 | { |
272 | const QDate& d = dt.date(); | 272 | const QDate& d = dt.date(); |