@ -699,8 +699,12 @@ static pid_t runTempService( const KService& _service, const KURL::List& _urls,
static KURL : : List resolveURLs ( const KURL : : List & _urls , const KService & _service )
static KURL : : List resolveURLs ( const KURL : : List & _urls , const KService & _service )
{
{
// Check which protocols the application supports.
// Check which protocols the application supports.
// This can be a list of actual protocol names, or just KIO for KDE apps.
// This can be a list of actual protocol names, or just TDEIO for TDE apps, or KIO for KDE apps.
TQStringList supportedProtocols = _service . property ( " X-KDE-Protocols " ) . toStringList ( ) ;
TQStringList supportedProtocols = _service . property ( " X-KDE-Protocols " ) . toStringList ( ) ;
if ( supportedProtocols . isEmpty ( ) )
{
supportedProtocols = _service . property ( " X-TDE-Protocols " ) . toStringList ( ) ;
}
KRunMX1 mx1 ( _service ) ;
KRunMX1 mx1 ( _service ) ;
TQString exec = _service . exec ( ) ;
TQString exec = _service . exec ( ) ;
if ( mx1 . expandMacrosShellQuote ( exec ) & & ! mx1 . hasUrls ) {
if ( mx1 . expandMacrosShellQuote ( exec ) & & ! mx1 . hasUrls ) {
@ -708,9 +712,9 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service
} else {
} else {
if ( supportedProtocols . isEmpty ( ) )
if ( supportedProtocols . isEmpty ( ) )
{
{
// compat mode: assume KIO if not set and it's a KDE app
// compat mode: assume KIO if not set and it's a TDE or KDE app
TQStringList categories = _service . property ( " Categories " ) . toStringList ( ) ;
TQStringList categories = _service . property ( " Categories " ) . toStringList ( ) ;
if ( ( categories . find ( " TDE " ) ! = categories . end ( ) ) & & ( categories . find ( " KDE " ) ! = categories . end ( ) ) )
if ( ( categories . find ( " TDE " ) ! = categories . end ( ) ) | | ( categories . find ( " KDE " ) ! = categories . end ( ) ) )
supportedProtocols . append ( " KIO " ) ;
supportedProtocols . append ( " KIO " ) ;
else { // if no KDE app, be a bit over-generic
else { // if no KDE app, be a bit over-generic
supportedProtocols . append ( " http " ) ;
supportedProtocols . append ( " http " ) ;
@ -721,13 +725,13 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service
kdDebug ( 7010 ) < < " supportedProtocols: " < < supportedProtocols < < endl ;
kdDebug ( 7010 ) < < " supportedProtocols: " < < supportedProtocols < < endl ;
KURL : : List urls ( _urls ) ;
KURL : : List urls ( _urls ) ;
if ( supportedProtocols . find ( " KIO " ) = = supportedProtocols . end ( ) ) {
if ( ( supportedProtocols . find ( " KIO " ) = = supportedProtocols . end ( ) ) & &
( supportedProtocols . find ( " TDEIO " ) = = supportedProtocols . end ( ) ) ) {
for ( KURL : : List : : Iterator it = urls . begin ( ) ; it ! = urls . end ( ) ; + + it ) {
for ( KURL : : List : : Iterator it = urls . begin ( ) ; it ! = urls . end ( ) ; + + it ) {
const KURL url = * it ;
const KURL url = * it ;
bool supported = url . isLocalFile ( ) | | supportedProtocols . find ( url . protocol ( ) . lower ( ) ) ! = supportedProtocols . end ( ) ;
bool supported = url . isLocalFile ( ) | | supportedProtocols . find ( url . protocol ( ) . lower ( ) ) ! = supportedProtocols . end ( ) ;
kdDebug ( 7010 ) < < " Looking at url= " < < url < < " supported= " < < supported < < endl ;
kdDebug ( 7010 ) < < " Looking at url= " < < url < < " supported= " < < supported < < endl ;
if ( ! supported & & KProtocolInfo : : protocolClass ( url . protocol ( ) ) = = " :local " & &
if ( ( ! supported ) & & ( KProtocolInfo : : protocolClass ( url . protocol ( ) ) = = " :local " ) )
! url . url ( ) . startsWith ( " media:/ " ) & & ! url . url ( ) . startsWith ( " system:/media " ) )
{
{
// Maybe we can resolve to a local URL?
// Maybe we can resolve to a local URL?
KURL localURL = KIO : : NetAccess : : mostLocalURL ( url , 0 ) ;
KURL localURL = KIO : : NetAccess : : mostLocalURL ( url , 0 ) ;