summaryrefslogtreecommitdiff
path: root/library/applnk.cpp
authormickeyl <mickeyl>2005-06-26 12:18:37 (UTC)
committer mickeyl <mickeyl>2005-06-26 12:18:37 (UTC)
commit53f924947144ddbb3e15d3bd1ddc877073c7ec7f (patch) (side-by-side diff)
tree501e5658099d63309fbf56fc7bd046c0a174a024 /library/applnk.cpp
parentd5a2b0d5ca4daa11894c52f3599dab56205bef4c (diff)
downloadopie-53f924947144ddbb3e15d3bd1ddc877073c7ec7f.zip
opie-53f924947144ddbb3e15d3bd1ddc877073c7ec7f.tar.gz
opie-53f924947144ddbb3e15d3bd1ddc877073c7ec7f.tar.bz2
get the default gfx driver from QWS_DISPLAY instead of hardcoding
it to 'Transformed' when launching rotated apps. Patch courtesy Manuel Teira
Diffstat (limited to 'library/applnk.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp6
1 files changed, 4 insertions, 2 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