author | zecke <zecke> | 2004-02-18 23:25:18 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-18 23:25:18 (UTC) |
commit | ab41e301eb7f06af0869844d197e38a7838f3f2d (patch) (unidiff) | |
tree | 65fb4cf5e4af1cb2c8d85ec46bc53096a97d110a | |
parent | 28b63b3270b8162fcea4449b53b75fa325d740ad (diff) | |
download | opie-ab41e301eb7f06af0869844d197e38a7838f3f2d.zip opie-ab41e301eb7f06af0869844d197e38a7838f3f2d.tar.gz opie-ab41e301eb7f06af0869844d197e38a7838f3f2d.tar.bz2 |
Gross hack to allow compilation with Qt3 more easily
Qt got a DateFormat as well so we use a define to call our QPEDateFormat
-rw-r--r-- | library/timestring.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/library/timestring.h b/library/timestring.h index f8cb3e6..0335715 100644 --- a/library/timestring.h +++ b/library/timestring.h | |||
@@ -23,11 +23,15 @@ | |||
23 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | 25 | ||
26 | #if (QT_VERSION-0 >= 0x030000) | ||
27 | #define DateFormat QPEDateFormat | ||
28 | #endif | ||
29 | |||
26 | // return a string with the time based on whether or not you want | 30 | // return a string with the time based on whether or not you want |
27 | // you want it in 12 hour form. if ampm is true, then return | 31 | // you want it in 12 hour form. if ampm is true, then return |
28 | // it in 12 hour (am/pm) form otherwise return it in 24 hour form | 32 | // it in 12 hour (am/pm) form otherwise return it in 24 hour form |
29 | // in theory Qt 3,0 handles this better (hopefully obsoleteing this) | 33 | // in theory Qt 3,0 handles this better (hopefully obsoleteing this) |
30 | class DateFormat | 34 | class DateFormat |
31 | { | 35 | { |
32 | public: | 36 | public: |
33 | // date format type 001,010,100 = day month year | 37 | // date format type 001,010,100 = day month year |
@@ -95,11 +99,11 @@ class TimeString | |||
95 | { | 99 | { |
96 | public: | 100 | public: |
97 | 101 | ||
98 | //enum DateFormat { MonthDayYear, DayMonthYear, ISO8601, | 102 | //enum DateFormat { MonthDayYear, DayMonthYear, ISO8601, |
99 | //YearMonthDay = ISO8601 }; | 103 | //YearMonthDay = ISO8601 }; |
100 | 104 | ||
101 | 105 | ||
102 | static QString shortDate( const QDate &d ) | 106 | static QString shortDate( const QDate &d ) |
103 | { return shortDate( d, currentDateFormat() ); } | 107 | { return shortDate( d, currentDateFormat() ); } |
104 | static QString dateString( const QDate &d ) | 108 | static QString dateString( const QDate &d ) |
105 | { return dateString( d, currentDateFormat() ); } | 109 | { return dateString( d, currentDateFormat() ); } |
@@ -129,7 +133,7 @@ public: | |||
129 | 133 | ||
130 | private: | 134 | private: |
131 | static QString dateString( const QDateTime &t, bool ampm, bool seconds, DateFormat ); | 135 | static QString dateString( const QDateTime &t, bool ampm, bool seconds, DateFormat ); |
132 | 136 | ||
133 | 137 | ||
134 | }; | 138 | }; |
135 | 139 | ||