author | mickeyl <mickeyl> | 2004-03-08 16:37:42 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-08 16:37:42 (UTC) |
commit | 2599910741451f86323af10585c858d217a122d5 (patch) (side-by-side diff) | |
tree | e00a51cc13f2cfd85eb79e9af7a79d69f777ad77 /library | |
parent | 82fb70f4e5d8582185da89264e1a1e3b2517f459 (diff) | |
download | opie-2599910741451f86323af10585c858d217a122d5.zip opie-2599910741451f86323af10585c858d217a122d5.tar.gz opie-2599910741451f86323af10585c858d217a122d5.tar.bz2 |
support launching applications with user defined arguments
-rw-r--r-- | library/applnk.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 9c60f1a..5f7da8e 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp @@ -654,33 +654,33 @@ AppLnk::AppLnk( const AppLnk © ) AppLnk::~AppLnk() { if ( mId ) qWarning("Deleting AppLnk that is in an AppLnkSet"); if ( d ) delete d; } /*! \overload Executes the application associated with this AppLnk. \sa exec() */ void AppLnk::execute() const { - execute(QStringList()); + 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(); rot = (rot+mRotation.toInt())%360; QCString old = getenv("QWS_DISPLAY"); @@ -688,33 +688,36 @@ void AppLnk::execute(const QStringList& args) const 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. \sa exec() name() */ void AppLnk::setExec( const QString& exec ) { mExec = exec; } #if 0 // this was inlined for better BC /*! Sets the Rotation property to \a rot. |