summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
-rw-r--r--library/qpeapplication.h11
-rw-r--r--library/qt_override.cpp3
-rw-r--r--library/qt_override_p.h4
4 files changed, 16 insertions, 4 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index f4db1ab..19adb00 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -956,16 +956,17 @@ void QPEApplication::setDefaultRotation( int r )
/*!
\internal
*/
void QPEApplication::applyStyle()
{
Config config( "qpe" );
config.setGroup( "Appearance" );
+ #if QT_VERSION > 233
// don't block ourselves ...
Opie::force_appearance = 0;
static QString appname = Opie::binaryName ( );
QStringList ex = config. readListEntry ( "NoStyle", ';' );
int nostyle = 0;
for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
@@ -1028,16 +1029,17 @@ void QPEApplication::applyStyle()
fs = 10;
}
setFont ( QFont ( ff, fs ), true );
// revert to global blocking policy ...
Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
Opie::force_appearance &= ~nostyle;
+ #endif
}
void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
{
#ifdef Q_WS_QWS
QDataStream stream( data, IO_ReadOnly );
if ( msg == "applyStyle()" ) {
applyStyle();
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index e35c008..65a6d33 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -113,19 +113,19 @@ protected:
void internalSetStyle( const QString &style );
void prepareForTermination(bool willrestart);
virtual void restart();
virtual void shutdown();
bool eventFilter( QObject *, QEvent * );
void timerEvent( QTimerEvent * );
bool raiseAppropriateWindow();
virtual void tryQuit();
-
+#if QT_VERSION > 233
virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!)
-
+#endif
private:
#ifndef QT_NO_TRANSLATION
void installTranslation( const QString& baseName );
#endif
void mapToDefaultAction( QWSKeyEvent *ke, int defKey );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QCopChannel *sysChannel;
@@ -178,16 +178,21 @@ inline Transformation DegToTrans ( int d )
/*
* Set current rotation of Opie, and rotation for newly started apps.
* Differs from setDefaultRotation in that 1) it rotates currently running apps,
* and 2) does not set deforient or save orientation to qpe.conf.
*/
inline void QPEApplication::setCurrentRotation( int r )
{
+ // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots
+ // for compatibility with the SharpROM use fallback to setDefaultTransformation()
+ #if QT_VERSION > 233
Transformation e = DegToTrans( r );
-
setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
qApp->desktop()->qwsDisplay()->setTransformation( e );
+ #else
+ setDefaultRotation( r );
+ #endif
}
#endif
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index 02c48a0..edda874 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -7,17 +7,17 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <sys/param.h> // for toolchains with old libc headers
#include "qt_override_p.h"
-
+#if QT_VERSION > 233
struct color_fix_t {
char *m_app;
char *m_class;
char *m_name;
QColorGroup::ColorRole m_set;
QColorGroup::ColorRole m_get;
};
@@ -163,8 +163,9 @@ void QApplication::qwsSetDecoration ( QWSDecoration *deco )
// qDebug ( "QApplication::qwsSetDecoration()" );
if ( Opie::force_appearance & Opie::Force_Decoration )
delete deco;
else
QApplication::qwsSetDecoration_NonWeak ( deco );
}
+#endif \ No newline at end of file
diff --git a/library/qt_override_p.h b/library/qt_override_p.h
index d11917c..cb05d15 100644
--- a/library/qt_override_p.h
+++ b/library/qt_override_p.h
@@ -1,11 +1,13 @@
#ifndef __QT_OVERRIDE_H__
#define __QT_OVERRIDE_H__
+#if QT_VERSION > 233
+
namespace Opie {
enum ForceAppearance {
Force_Style = 0x01,
Force_Font = 0x02,
Force_Decoration = 0x04,
Force_All = 0xff,
@@ -13,9 +15,11 @@ enum ForceAppearance {
};
extern const char *binaryName ( );
extern int force_appearance;
}
+#endif // (QT_VERSION >233)
+
#endif