-rw-r--r-- | library/qt_override.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/library/qt_override.cpp b/library/qt_override.cpp index 56f82d7..a0d753b 100644 --- a/library/qt_override.cpp +++ b/library/qt_override.cpp | |||
@@ -5,12 +5,13 @@ | |||
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <limits.h> | 8 | #include <limits.h> |
9 | #include <sys/param.h> // for toolchains with old libc headers | 9 | #include <sys/param.h> // for toolchains with old libc headers |
10 | 10 | ||
11 | #include <qtopia/qpeglobal.h> | ||
11 | #include "qt_override_p.h" | 12 | #include "qt_override_p.h" |
12 | 13 | ||
13 | #if QT_VERSION > 233 | 14 | #if QT_VERSION > 233 |
14 | 15 | ||
15 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | 16 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX |
16 | struct color_fix_t { | 17 | struct color_fix_t { |
@@ -82,14 +83,13 @@ int Opie::force_appearance = 0; | |||
82 | 83 | ||
83 | // Fix for a toolchain incompatibility (binaries compiled with | 84 | // Fix for a toolchain incompatibility (binaries compiled with |
84 | // old tcs using shared libs compiled with newer tcs) | 85 | // old tcs using shared libs compiled with newer tcs) |
85 | 86 | ||
86 | extern "C" { | 87 | extern "C" { |
87 | 88 | ||
88 | extern void __gmon_start__ ( ) __attribute__(( weak )); | 89 | extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL; |
89 | |||
90 | extern void __gmon_start__ ( ) | 90 | extern void __gmon_start__ ( ) |
91 | { | 91 | { |
92 | } | 92 | } |
93 | 93 | ||
94 | } | 94 | } |
95 | 95 | ||
@@ -99,14 +99,12 @@ extern void __gmon_start__ ( ) | |||
99 | // that set a background pixmap (it would be easier to fix eraseRect(), but | 99 | // that set a background pixmap (it would be easier to fix eraseRect(), but |
100 | // TT made it an inline ...) | 100 | // TT made it an inline ...) |
101 | 101 | ||
102 | void QPEApplication::polish ( QWidget *w ) | 102 | void QPEApplication::polish ( QWidget *w ) |
103 | { | 103 | { |
104 | #ifndef OPIE_NO_OVERRIDE_QT | 104 | #ifndef OPIE_NO_OVERRIDE_QT |
105 | //qDebug ( "QPEApplication::polish()" ); | ||
106 | |||
107 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { | 105 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { |
108 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && | 106 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && |
109 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && | 107 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && |
110 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { | 108 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { |
111 | QPalette pal = w-> palette ( ); | 109 | QPalette pal = w-> palette ( ); |
112 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); | 110 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); |
@@ -122,14 +120,12 @@ void QPEApplication::polish ( QWidget *w ) | |||
122 | #ifndef OPIE_NO_OVERRIDE_QT | 120 | #ifndef OPIE_NO_OVERRIDE_QT |
123 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes | 121 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes |
124 | // were multiplied by 10 (which was incorrect) | 122 | // were multiplied by 10 (which was incorrect) |
125 | 123 | ||
126 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) | 124 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) |
127 | { | 125 | { |
128 | //qDebug ( "QFontDatabase::pointSizes()" ); | ||
129 | |||
130 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); | 126 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); |
131 | 127 | ||
132 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { | 128 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { |
133 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { | 129 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { |
134 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | 130 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) |
135 | *it *= 10; | 131 | *it *= 10; |
@@ -141,41 +137,33 @@ QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString cons | |||
141 | 137 | ||
142 | // Various style/font/color related overrides for weak symbols in Qt/E, | 138 | // Various style/font/color related overrides for weak symbols in Qt/E, |
143 | // which allows us to force the usage of the global Opie appearance. | 139 | // which allows us to force the usage of the global Opie appearance. |
144 | 140 | ||
145 | void QApplication::setStyle ( QStyle *style ) | 141 | void QApplication::setStyle ( QStyle *style ) |
146 | { | 142 | { |
147 | //qDebug ( "QApplication::setStyle()" ); | ||
148 | |||
149 | if ( Opie::force_appearance & Opie::Force_Style ) | 143 | if ( Opie::force_appearance & Opie::Force_Style ) |
150 | delete style; | 144 | delete style; |
151 | else | 145 | else |
152 | QApplication::setStyle_NonWeak ( style ); | 146 | QApplication::setStyle_NonWeak ( style ); |
153 | } | 147 | } |
154 | 148 | ||
155 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) | 149 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) |
156 | { | 150 | { |
157 | //qDebug ( "QApplication::setPalette()" ); | ||
158 | |||
159 | if (!( Opie::force_appearance & Opie::Force_Style )) | 151 | if (!( Opie::force_appearance & Opie::Force_Style )) |
160 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); | 152 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); |
161 | } | 153 | } |
162 | 154 | ||
163 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) | 155 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) |
164 | { | 156 | { |
165 | //qDebug ( "QApplication::setFont()" ); | ||
166 | |||
167 | if (!( Opie::force_appearance & Opie::Force_Font )) | 157 | if (!( Opie::force_appearance & Opie::Force_Font )) |
168 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); | 158 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); |
169 | } | 159 | } |
170 | 160 | ||
171 | 161 | ||
172 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) | 162 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) |
173 | { | 163 | { |
174 | //qDebug ( "QApplication::qwsSetDecoration()" ); | ||
175 | |||
176 | if ( Opie::force_appearance & Opie::Force_Decoration ) | 164 | if ( Opie::force_appearance & Opie::Force_Decoration ) |
177 | delete deco; | 165 | delete deco; |
178 | else | 166 | else |
179 | QApplication::qwsSetDecoration_NonWeak ( deco ); | 167 | QApplication::qwsSetDecoration_NonWeak ( deco ); |
180 | } | 168 | } |
181 | #endif | 169 | #endif |