summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-11 18:38:28 (UTC)
committer sandman <sandman>2002-12-11 18:38:28 (UTC)
commit073b2388a8c9bd2cc3b4f98025f5fcda424df1c6 (patch) (unidiff)
treec5ea60c7af591aa2597c27691b4ff2ee61b53b1b
parent8ca42b97de03ac84da04b9be84f9bbb8eb17b52d (diff)
downloadopie-073b2388a8c9bd2cc3b4f98025f5fcda424df1c6.zip
opie-073b2388a8c9bd2cc3b4f98025f5fcda424df1c6.tar.gz
opie-073b2388a8c9bd2cc3b4f98025f5fcda424df1c6.tar.bz2
No need for debug output anymore ... it works now
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qt_override.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index 9c5ba24..02c48a0 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -49,122 +49,122 @@ int Opie::force_appearance = 0;
49// by looking at argv [0] (which could be anything) 49// by looking at argv [0] (which could be anything)
50 50
51static void binaryNameFree ( ) 51static void binaryNameFree ( )
52{ 52{
53 ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here 53 ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here
54} 54}
55 55
56const char *Opie::binaryName ( ) 56const char *Opie::binaryName ( )
57{ 57{
58 static const char *appname = 0; 58 static const char *appname = 0;
59 59
60 if ( !appname ) { 60 if ( !appname ) {
61 char dst [PATH_MAX + 1]; 61 char dst [PATH_MAX + 1];
62 int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); 62 int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX );
63 63
64 if ( l <= 0 ) 64 if ( l <= 0 )
65 l = 0; 65 l = 0;
66 66
67 dst [l] = 0; 67 dst [l] = 0;
68 const char *b = ::strrchr ( dst, '/' ); 68 const char *b = ::strrchr ( dst, '/' );
69 appname = ::strdup ( b ? b + 1 : dst ); 69 appname = ::strdup ( b ? b + 1 : dst );
70 70
71 ::atexit ( binaryNameFree ); 71 ::atexit ( binaryNameFree );
72 } 72 }
73 return appname; 73 return appname;
74} 74}
75 75
76 76
77// Fix for a toolchain incompatibility (binaries compiled with 77// Fix for a toolchain incompatibility (binaries compiled with
78// old tcs using shared libs compiled with newer tcs) 78// old tcs using shared libs compiled with newer tcs)
79 79
80extern "C" { 80extern "C" {
81 81
82extern void __gmon_start__ ( ) __attribute__(( weak )); 82extern void __gmon_start__ ( ) __attribute__(( weak ));
83 83
84extern void __gmon_start__ ( ) 84extern void __gmon_start__ ( )
85{ 85{
86} 86}
87 87
88} 88}
89 89
90 90
91// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles 91// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles
92// that set a background pixmap (it would be easier to fix eraseRect(), but 92// that set a background pixmap (it would be easier to fix eraseRect(), but
93// TT made it an inline ...) 93// TT made it an inline ...)
94 94
95void QPEApplication::polish ( QWidget *w ) 95void QPEApplication::polish ( QWidget *w )
96{ 96{
97 qDebug ( "QPEApplication::polish()" ); 97 //qDebug ( "QPEApplication::polish()" );
98 98
99 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { 99 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) {
100 if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && 100 if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) &&
101 ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && 101 ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) &&
102 ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { 102 ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) {
103 QPalette pal = w-> palette ( ); 103 QPalette pal = w-> palette ( );
104 pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); 104 pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get ));
105 w-> setPalette ( pal ); 105 w-> setPalette ( pal );
106 } 106 }
107 } 107 }
108 QApplication::polish ( w ); 108 QApplication::polish ( w );
109} 109}
110 110
111 111
112// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes 112// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes
113// were multiplied by 10 (which was incorrect) 113// were multiplied by 10 (which was incorrect)
114 114
115QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) 115QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset )
116{ 116{
117 qDebug ( "QFontDatabase::pointSizes()" ); 117 //qDebug ( "QFontDatabase::pointSizes()" );
118 118
119 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); 119 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
120 120
121 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { 121 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) {
122 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { 122 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) {
123 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 123 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
124 *it *= 10; 124 *it *= 10;
125 } 125 }
126 } 126 }
127 return sl; 127 return sl;
128} 128}
129 129
130 130
131// Various style/font/color related overrides for weak symbols in Qt/E, 131// Various style/font/color related overrides for weak symbols in Qt/E,
132// which allows us to force the usage of the global Opie appearance. 132// which allows us to force the usage of the global Opie appearance.
133 133
134void QApplication::setStyle ( QStyle *style ) 134void QApplication::setStyle ( QStyle *style )
135{ 135{
136 qDebug ( "QApplication::setStyle()" ); 136 //qDebug ( "QApplication::setStyle()" );
137 137
138 if ( Opie::force_appearance & Opie::Force_Style ) 138 if ( Opie::force_appearance & Opie::Force_Style )
139 delete style; 139 delete style;
140 else 140 else
141 QApplication::setStyle_NonWeak ( style ); 141 QApplication::setStyle_NonWeak ( style );
142} 142}
143 143
144void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) 144void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className )
145{ 145{
146 qDebug ( "QApplication::setPalette()" ); 146 //qDebug ( "QApplication::setPalette()" );
147 147
148 if (!( Opie::force_appearance & Opie::Force_Style )) 148 if (!( Opie::force_appearance & Opie::Force_Style ))
149 QApplication::setPalette_NonWeak ( pal, informWidgets, className ); 149 QApplication::setPalette_NonWeak ( pal, informWidgets, className );
150} 150}
151 151
152void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) 152void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className )
153{ 153{
154 qDebug ( "QApplication::setFont()" ); 154 //qDebug ( "QApplication::setFont()" );
155 155
156 if (!( Opie::force_appearance & Opie::Force_Font )) 156 if (!( Opie::force_appearance & Opie::Force_Font ))
157 QApplication::setFont_NonWeak ( fnt, informWidgets, className ); 157 QApplication::setFont_NonWeak ( fnt, informWidgets, className );
158} 158}
159 159
160 160
161void QApplication::qwsSetDecoration ( QWSDecoration *deco ) 161void QApplication::qwsSetDecoration ( QWSDecoration *deco )
162{ 162{
163 qDebug ( "QApplication::qwsSetDecoration()" ); 163 //qDebug ( "QApplication::qwsSetDecoration()" );
164 164
165 if ( Opie::force_appearance & Opie::Force_Decoration ) 165 if ( Opie::force_appearance & Opie::Force_Decoration )
166 delete deco; 166 delete deco;
167 else 167 else
168 QApplication::qwsSetDecoration_NonWeak ( deco ); 168 QApplication::qwsSetDecoration_NonWeak ( deco );
169} 169}
170 170