summaryrefslogtreecommitdiff
path: root/library/applnk.cpp
Side-by-side diff
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
@@ -664,51 +664,53 @@ AppLnk::~AppLnk()
/*!
\overload
Executes the application associated with this AppLnk.
\sa exec()
*/
void AppLnk::execute() const
{
execute( QStringList::split( ' ', property( "Arguments" ) ) );
}
/*!
Executes the application associated with this AppLnk, with
\a args as arguments.
\sa exec()
*/
void AppLnk::execute(const QStringList& args) const
{
#ifdef Q_WS_QWS
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
#endif
invoke(args);
}
/*!
Invokes the application associated with this AppLnk, with
\a args as arguments. Rotation is not taken into account by
this function, so you should not call it directly.
\sa execute()
*/
void AppLnk::invoke(const QStringList& args) const
{
if ( property( "Arguments" ).isEmpty() )
Global::execute( exec(), args[0] );
else
Global::execute( exec(), args.join( " " ) );
}
/*!
Sets the Exec property to \a exec.