summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make3
-rw-r--r--config.in4
-rw-r--r--library/library.pro6
-rw-r--r--library/qpeapplication.cpp10
-rw-r--r--library/qt_override.cpp40
5 files changed, 44 insertions, 19 deletions
diff --git a/Rules.make b/Rules.make
index 4833b11..a1e6f09 100644
--- a/Rules.make
+++ b/Rules.make
@@ -29,6 +29,9 @@ else
29 echo CONFIG += quick-app-bin >> $@ 29 echo CONFIG += quick-app-bin >> $@
30 echo \} >> $@ 30 echo \} >> $@
31 endif 31 endif
32ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y)
33 echo CONFIG += no-override >> $@
34endif
32 35
33$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages 36$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages
34 @echo Generating dependency information... 37 @echo Generating dependency information...
diff --git a/config.in b/config.in
index dac9024..ddbc93b 100644
--- a/config.in
+++ b/config.in
@@ -41,6 +41,10 @@ config RELEASE
41config QUICK_LAUNCH 41config QUICK_LAUNCH
42 boolean "Enable Quick Launch" 42 boolean "Enable Quick Launch"
43 default n 43 default n
44
45config OPIE_NO_OVERRIDE_QT
46 boolean "Build Opie against an unpatched version of Qt"
47 default n
44 48
45config SPECFILE 49config SPECFILE
46 string 50 string
diff --git a/library/library.pro b/library/library.pro
index 80a0f62..ab1f451 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -118,6 +118,8 @@ SOURCES = calendar.cpp \
118 lnkproperties.cpp \ 118 lnkproperties.cpp \
119 qt_override.cpp 119 qt_override.cpp
120 120
121
122
121# Qt 3 compatibility 123# Qt 3 compatibility
122HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h 124HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h
123SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp 125SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp
@@ -149,3 +151,7 @@ TRANSLATIONS = ../i18n/de/libqpe.ts \
149 151
150 152
151include ( $(OPIEDIR)/include.pro ) 153include ( $(OPIEDIR)/include.pro )
154
155contains( CONFIG, no-override ){
156 DEFINES += OPIE_NO_OVERRIDE_QT
157}
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 28fb13a..feba8b6 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1124,7 +1124,8 @@ void QPEApplication::applyStyle()
1124 Config config( "qpe" ); 1124 Config config( "qpe" );
1125 config.setGroup( "Appearance" ); 1125 config.setGroup( "Appearance" );
1126 1126
1127 #if QT_VERSION > 233 1127#if QT_VERSION > 233
1128#if !defined(OPIE_NO_OVERRIDE_QT)
1128 // don't block ourselves ... 1129 // don't block ourselves ...
1129 Opie::force_appearance = 0; 1130 Opie::force_appearance = 0;
1130 1131
@@ -1138,6 +1139,9 @@ void QPEApplication::applyStyle()
1138 break; 1139 break;
1139 } 1140 }
1140 } 1141 }
1142#else
1143 int nostyle = 0;
1144#endif
1141 1145
1142 // Widget style 1146 // Widget style
1143 QString style = config.readEntry( "Style", "FlatStyle" ); 1147 QString style = config.readEntry( "Style", "FlatStyle" );
@@ -1194,10 +1198,12 @@ void QPEApplication::applyStyle()
1194 1198
1195 setFont ( QFont ( ff, fs ), true ); 1199 setFont ( QFont ( ff, fs ), true );
1196 1200
1201#if !defined(OPIE_NO_OVERRIDE_QT)
1197 // revert to global blocking policy ... 1202 // revert to global blocking policy ...
1198 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; 1203 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
1199 Opie::force_appearance &= ~nostyle; 1204 Opie::force_appearance &= ~nostyle;
1200 #endif 1205#endif
1206#endif
1201} 1207}
1202 1208
1203void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) 1209void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index edda874..df5a419 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -22,12 +22,12 @@ struct color_fix_t {
22 QColorGroup::ColorRole m_get; 22 QColorGroup::ColorRole m_get;
23}; 23};
24 24
25 25#ifndef OPIE_NO_OVERRIDE_QT
26 26
27static const color_fix_t apps_that_need_special_colors [] = { 27static const color_fix_t apps_that_need_special_colors [] = {
28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, 28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base },
29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, 29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base },
30 30
31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } 31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base }
32}; 32};
33 33
@@ -35,7 +35,7 @@ static const char * const apps_that_need_pointsizes_times_10 [] = {
35 "HancomMobileWord", 35 "HancomMobileWord",
36 "hancomsheet", 36 "hancomsheet",
37 "HancomPresenterViewer", 37 "HancomPresenterViewer",
38 38
39 0 39 0
40}; 40};
41 41
@@ -56,32 +56,35 @@ static void binaryNameFree ( )
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#else
77int Opie::force_appearance = 0;
78#endif
76 79
77// Fix for a toolchain incompatibility (binaries compiled with 80// Fix for a toolchain incompatibility (binaries compiled with
78// old tcs using shared libs compiled with newer tcs) 81// old tcs using shared libs compiled with newer tcs)
79 82
80extern "C" { 83extern "C" {
81 84
82extern void __gmon_start__ ( ) __attribute__(( weak )); 85extern void __gmon_start__ ( ) __attribute__(( weak ));
83 86
84extern void __gmon_start__ ( ) 87extern void __gmon_start__ ( )
85{ 88{
86} 89}
87 90
@@ -89,11 +92,12 @@ extern void __gmon_start__ ( )
89 92
90 93
91// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles 94// 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 95// that set a background pixmap (it would be easier to fix eraseRect(), but
93// TT made it an inline ...) 96// TT made it an inline ...)
94 97
95void QPEApplication::polish ( QWidget *w ) 98void QPEApplication::polish ( QWidget *w )
96{ 99{
100#ifndef OPIE_NO_OVERRIDE_QT
97 //qDebug ( "QPEApplication::polish()" ); 101 //qDebug ( "QPEApplication::polish()" );
98 102
99 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { 103 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) {
@@ -105,10 +109,12 @@ void QPEApplication::polish ( QWidget *w )
105 w-> setPalette ( pal ); 109 w-> setPalette ( pal );
106 } 110 }
107 } 111 }
112#endif
108 QApplication::polish ( w ); 113 QApplication::polish ( w );
109} 114}
110 115
111 116
117#ifndef OPIE_NO_OVERRIDE_QT
112// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes 118// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes
113// were multiplied by 10 (which was incorrect) 119// were multiplied by 10 (which was incorrect)
114 120
@@ -120,8 +126,8 @@ QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString cons
120 126
121 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { 127 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) {
122 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { 128 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) {
123 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 129 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
124 *it *= 10; 130 *it *= 10;
125 } 131 }
126 } 132 }
127 return sl; 133 return sl;
@@ -156,7 +162,7 @@ void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *c
156 if (!( Opie::force_appearance & Opie::Force_Font )) 162 if (!( Opie::force_appearance & Opie::Force_Font ))
157 QApplication::setFont_NonWeak ( fnt, informWidgets, className ); 163 QApplication::setFont_NonWeak ( fnt, informWidgets, className );
158} 164}
159 165
160 166
161void QApplication::qwsSetDecoration ( QWSDecoration *deco ) 167void QApplication::qwsSetDecoration ( QWSDecoration *deco )
162{ 168{
@@ -167,5 +173,5 @@ void QApplication::qwsSetDecoration ( QWSDecoration *deco )
167 else 173 else
168 QApplication::qwsSetDecoration_NonWeak ( deco ); 174 QApplication::qwsSetDecoration_NonWeak ( deco );
169} 175}
170 176#endif
171#endif \ No newline at end of file 177#endif