summaryrefslogtreecommitdiff
path: root/library
Side-by-side diff
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/applnk.cpp6
-rw-r--r--library/qpeapplication.cpp5
-rw-r--r--library/qpeapplication.h5
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
@@ -685,9 +685,11 @@ void AppLnk::execute(const QStringList& args) const
if ( !mRotation.isEmpty() ) {
// ######## this will only work in the server
int rot = QPEApplication::defaultRotation();
+ int j = 0;
rot = (rot+mRotation.toInt())%360;
- QCString old = getenv("QWS_DISPLAY");
- setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1);
+ QCString old = getenv( "QWS_DISPLAY" ) ? getenv( "QWS_DISPLAY" ) : "Transformed";
+ QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() );
+ setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( rot ), 1 );
invoke(args);
setenv("QWS_DISPLAY", old.data(), 1);
} else
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 0f3e4a4..19e99f2 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1288,7 +1288,10 @@ void QPEApplication::setDefaultRotation( int r )
{
if ( qApp->type() == GuiServer ) {
deforient = r;
- setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
+ int j = 0;
+ QCString old = getenv( "QWS_DISPLAY" ) ? getenv( "QWS_DISPLAY" ) : "Transformed";
+ QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() );
+ setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg(driver).arg( r ).latin1(), 1 );
Config config("qpe");
config.setGroup( "Rotation" );
config.writeEntry( "Rot", r );
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 167fe69..cff3e43 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -208,7 +208,10 @@ inline void QPEApplication::setCurrentRotation( int r )
// 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 );
+ QCString old = getenv("QWS_DISPLAY") ? getenv( "QWS_DISPLAY" ) : "Transformed";
+ int j = 0;
+ QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() );
+ ::setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( r ).latin1(), 1 );
qApp->desktop()->qwsDisplay()->setTransformation( e );
#else
setDefaultRotation( r );