class KRun
|
Implements a generic runner, i. More... |
|
|
Public Methods
- KRun ( const QString& _url, mode_t _mode = 0, bool _is_local_file = false, bool _auto_delete = true )
- virtual ~KRun ()
- bool hasError ()
- bool hasFinished ()
- bool autoDelete ()
- void setAutoDelete ()
Signals
- void finished ()
- void error ()
Public Static Methods
- static bool run ( const KService& _service, QStringList& _urls )
- static bool run ( const QString& _exec, QStringList& _urls, const QString& _name = QString::null, const QString& _icon = QString::null, const QString& _mini_icon = QString::null, const QString& _desktop_file = QString::null )
- static bool runOldApplication ( const QString& _exec, QStringList& _urls, bool _allow_multiple )
Protected Methods
- virtual void init ()
- virtual void scanFile ()
- virtual void foundMimeType ( const char *_type )
- virtual void killJob ()
Protected Slots
- void slotTimeout ()
- void slotMimeType ( int _id, const char *_type )
- void slotPreData ( int _id, const char *_data, int _len )
- void slotError ( int _id, int _errid, const char *_errortext )
- void slotIsDirectory ( int _id )
- void slotIsFile ( int _id )
- void slotFinished ( int _id )
Protected Static Methods
- static bool runURL ( const char *_url, const char *_mimetype )
- static bool run ( const QString& _cmd )
- static void shellQuote ( QString &_str )
Protected Members
- QString m_strURL
- bool m_bFault
- bool m_bAutoDelete
- bool m_bFinished
- int m_jobId
- QTimer m_timer
- bool m_bScanFile
- bool m_bIsDirectory
- bool m_bInit
- bool m_bIsLocalFile
- mode_t m_mode
Detailed Description
Implements a generic runner, i.e. the 'exec' functionality of KDE
It can execute any desktop entry, as well as any file, using
default binding (service) or another bound service.
KRun ( const QString& _url, mode_t _mode = 0, bool _is_local_file = false, bool _auto_delete = true )
|
Parameters:
_mode | is the st_mode field of <tt>struct stat</tt>. If
you dont know this set it to 0.
|
_is_local_file | if this * parameter is set to false, then '_url' is
examnined to find out * whether it is a local URL or
not. This flag is just used to * improve speed, since the
function KURL::isLocalFile is a bit slow.
|
By default auto deletion is on.
[static]
Opens a list of URLs with a certain service.
Parameters:
_urls | the list of URLs, can be empty (app launched
without argument)
|
[static]
Opens a list of URLs with.
Parameters:
_exec | is the name of the executable, for example
"/usr/bin/netscape".
|
_name | is the logical name of the application, for example
"Netscape 4.06".
|
_icon | is the icon which should be used by the application.
|
_miniicon | is the icon which should be used by the application.
|
void foundMimeType ( const char *_type )
|
[protected virtual]
Called if the mimetype has been detected. The function checks
whether the document and appends the gzip protocol to the
URL. Otherwise runURL is called to finish the job.
[protected]
Used to indicate that the next action is to scan the file.
This action is invoked from slotTimeout.
[protected]
USed to indicate that the next action is to initialize.
This action is invoked from slotTimeout
bool runURL ( const char *_url, const char *_mimetype )
|
[protected static]
Open the given URL. This function is used after the mime type
is found out. It will search for all services which can handle
the mime type and call run afterwards.
[protected static]
Runs a shell command.
_cmd must be a quoted shell command. You must not append "&"
to it, since the function will do that for you. An example is
"<tt>greet 'Hello Torben'</tt>".
[protected static]
Quotes a string for the shell
Generated by: root@tantive.terraplex.com on Sun Feb 27 17:39:31 2000, using kdoc 2.0a33. |