-rw-r--r-- | library/applnk.cpp | 6 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 5 | ||||
-rw-r--r-- | library/qpeapplication.h | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index c82d3b9..874a1b6 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -680,19 +680,21 @@ void AppLnk::execute() const | |||
680 | \sa exec() | 680 | \sa exec() |
681 | */ | 681 | */ |
682 | void AppLnk::execute(const QStringList& args) const | 682 | void AppLnk::execute(const QStringList& args) const |
683 | { | 683 | { |
684 | #ifdef Q_WS_QWS | 684 | #ifdef Q_WS_QWS |
685 | if ( !mRotation.isEmpty() ) { | 685 | if ( !mRotation.isEmpty() ) { |
686 | // ######## this will only work in the server | 686 | // ######## this will only work in the server |
687 | int rot = QPEApplication::defaultRotation(); | 687 | int rot = QPEApplication::defaultRotation(); |
688 | int j = 0; | ||
688 | rot = (rot+mRotation.toInt())%360; | 689 | rot = (rot+mRotation.toInt())%360; |
689 | QCString old = getenv("QWS_DISPLAY"); | 690 | QCString old = getenv( "QWS_DISPLAY" ) ? getenv( "QWS_DISPLAY" ) : "Transformed"; |
690 | setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1); | 691 | QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() ); |
692 | setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( rot ), 1 ); | ||
691 | invoke(args); | 693 | invoke(args); |
692 | setenv("QWS_DISPLAY", old.data(), 1); | 694 | setenv("QWS_DISPLAY", old.data(), 1); |
693 | } else | 695 | } else |
694 | #endif | 696 | #endif |
695 | invoke(args); | 697 | invoke(args); |
696 | } | 698 | } |
697 | 699 | ||
698 | /*! | 700 | /*! |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 0f3e4a4..19e99f2 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1283,17 +1283,20 @@ int QPEApplication::defaultRotation() | |||
1283 | 1283 | ||
1284 | /*! | 1284 | /*! |
1285 | \internal | 1285 | \internal |
1286 | */ | 1286 | */ |
1287 | void QPEApplication::setDefaultRotation( int r ) | 1287 | void QPEApplication::setDefaultRotation( int r ) |
1288 | { | 1288 | { |
1289 | if ( qApp->type() == GuiServer ) { | 1289 | if ( qApp->type() == GuiServer ) { |
1290 | deforient = r; | 1290 | deforient = r; |
1291 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 1291 | int j = 0; |
1292 | QCString old = getenv( "QWS_DISPLAY" ) ? getenv( "QWS_DISPLAY" ) : "Transformed"; | ||
1293 | QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() ); | ||
1294 | setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg(driver).arg( r ).latin1(), 1 ); | ||
1292 | Config config("qpe"); | 1295 | Config config("qpe"); |
1293 | config.setGroup( "Rotation" ); | 1296 | config.setGroup( "Rotation" ); |
1294 | config.writeEntry( "Rot", r ); | 1297 | config.writeEntry( "Rot", r ); |
1295 | } | 1298 | } |
1296 | else { | 1299 | else { |
1297 | #ifndef QT_NO_COP | 1300 | #ifndef QT_NO_COP |
1298 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 1301 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
1299 | e << r; | 1302 | e << r; |
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 167fe69..cff3e43 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -203,17 +203,20 @@ inline Transformation DegToTrans ( int d ) | |||
203 | */ | 203 | */ |
204 | 204 | ||
205 | inline void QPEApplication::setCurrentRotation( int r ) | 205 | inline void QPEApplication::setCurrentRotation( int r ) |
206 | { | 206 | { |
207 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots | 207 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots |
208 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() | 208 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() |
209 | #if QT_VERSION > 233 | 209 | #if QT_VERSION > 233 |
210 | Transformation e = DegToTrans( r ); | 210 | Transformation e = DegToTrans( r ); |
211 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 211 | QCString old = getenv("QWS_DISPLAY") ? getenv( "QWS_DISPLAY" ) : "Transformed"; |
212 | int j = 0; | ||
213 | QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() ); | ||
214 | ::setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( r ).latin1(), 1 ); | ||
212 | qApp->desktop()->qwsDisplay()->setTransformation( e ); | 215 | qApp->desktop()->qwsDisplay()->setTransformation( e ); |
213 | #else | 216 | #else |
214 | setDefaultRotation( r ); | 217 | setDefaultRotation( r ); |
215 | #endif | 218 | #endif |
216 | } | 219 | } |
217 | 220 | ||
218 | /* | 221 | /* |
219 | * Qtopia 1.7 SDK compatibility macros | 222 | * Qtopia 1.7 SDK compatibility macros |