summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Unidiff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 0f3e4a4..19e99f2 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1259,65 +1259,68 @@ QString QPEApplication::documentDir()
1259static int deforient = -1; 1259static int deforient = -1;
1260 1260
1261/*! 1261/*!
1262 \internal 1262 \internal
1263*/ 1263*/
1264int QPEApplication::defaultRotation() 1264int QPEApplication::defaultRotation()
1265{ 1265{
1266 if ( deforient < 0 ) { 1266 if ( deforient < 0 ) {
1267 QString d = getenv( "QWS_DISPLAY" ); 1267 QString d = getenv( "QWS_DISPLAY" );
1268 if ( d.contains( "Rot90" ) ) { 1268 if ( d.contains( "Rot90" ) ) {
1269 deforient = 90; 1269 deforient = 90;
1270 } 1270 }
1271 else if ( d.contains( "Rot180" ) ) { 1271 else if ( d.contains( "Rot180" ) ) {
1272 deforient = 180; 1272 deforient = 180;
1273 } 1273 }
1274 else if ( d.contains( "Rot270" ) ) { 1274 else if ( d.contains( "Rot270" ) ) {
1275 deforient = 270; 1275 deforient = 270;
1276 } 1276 }
1277 else { 1277 else {
1278 deforient = 0; 1278 deforient = 0;
1279 } 1279 }
1280 } 1280 }
1281 return deforient; 1281 return deforient;
1282} 1282}
1283 1283
1284/*! 1284/*!
1285 \internal 1285 \internal
1286*/ 1286*/
1287void QPEApplication::setDefaultRotation( int r ) 1287void 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;
1300 } 1303 }
1301#endif 1304#endif
1302 1305
1303 } 1306 }
1304} 1307}
1305 1308
1306#include <qgfx_qws.h> 1309#include <qgfx_qws.h>
1307#include <qwindowsystem_qws.h> 1310#include <qwindowsystem_qws.h>
1308 1311
1309#if QT_VERSION > 236 1312#if QT_VERSION > 236
1310extern void qws_clearLoadedFonts(); 1313extern void qws_clearLoadedFonts();
1311#endif 1314#endif
1312 1315
1313void QPEApplication::setCurrentMode( int x, int y, int depth ) 1316void QPEApplication::setCurrentMode( int x, int y, int depth )
1314{ 1317{
1315 // Reset the caches 1318 // Reset the caches
1316#if QT_VERSION > 236 1319#if QT_VERSION > 236
1317 qws_clearLoadedFonts(); 1320 qws_clearLoadedFonts();
1318#endif 1321#endif
1319 QPixmapCache::clear(); 1322 QPixmapCache::clear();
1320 1323
1321 // Change the screen mode 1324 // Change the screen mode
1322 qt_screen->setMode(x, y, depth); 1325 qt_screen->setMode(x, y, depth);
1323 1326