diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-05-31 08:56:09 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-05-31 09:37:12 +0200 |
commit | eaa7f3e3d4eac4876803d20bdda9ee0d701d5f5b (patch) | |
tree | 8cc1cdc342d3458c613a253447bf307fa0e42e8b /tdeio | |
parent | 8d0bae409253e5892a6e3521b291a7152048ca40 (diff) | |
download | tdelibs-eaa7f3e3d4eac4876803d20bdda9ee0d701d5f5b.tar.gz tdelibs-eaa7f3e3d4eac4876803d20bdda9ee0d701d5f5b.zip |
Fix the last wrong condition from commit 99739b61143c05f7fb1157dc145e19e9c090de6e.
Revert the wrong fix from commit 3d3e77773df70317267c2d471c37e9374256590d.
If desktop file does not include X-TDE-Protocols property, use X-KDE-Protocols
property to limit the use of TDEIO protocols for non-TDE programs.
This resolves issue TDE/tdebase#224.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeio')
-rw-r--r-- | tdeio/tdeio/krun.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tdeio/tdeio/krun.cpp b/tdeio/tdeio/krun.cpp index 402b339b0..44b383915 100644 --- a/tdeio/tdeio/krun.cpp +++ b/tdeio/tdeio/krun.cpp @@ -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 ) { // Check which protocols the application supports. - // This can be a list of actual protocol names, or just TDEIO 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-TDE-Protocols").toStringList(); + if (supportedProtocols.isEmpty()) + { + supportedProtocols = _service.property("X-KDE-Protocols").toStringList(); + } KRunMX1 mx1( _service ); TQString exec = _service.exec(); if ( mx1.expandMacrosShellQuote( exec ) && !mx1.hasUrls ) { @@ -708,9 +712,9 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service } else { if ( supportedProtocols.isEmpty() ) { - // compat mode: assume TDEIO if not set and it's a KDE app + // compat mode: assume TDEIO if not set and it's a TDE or KDE app 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( "TDEIO" ); else { // if no KDE app, be a bit over-generic supportedProtocols.append( "http"); @@ -721,13 +725,13 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service kdDebug(7010) << "supportedProtocols:" << supportedProtocols << endl; KURL::List urls( _urls ); - if ( supportedProtocols.find( "TDEIO" ) == supportedProtocols.end() ) { + if ((supportedProtocols.find("TDEIO") == supportedProtocols.end()) && + (supportedProtocols.find("KIO") == supportedProtocols.end())) { for( KURL::List::Iterator it = urls.begin(); it != urls.end(); ++it ) { const KURL url = *it; bool supported = url.isLocalFile() || supportedProtocols.find( url.protocol().lower() ) != supportedProtocols.end(); kdDebug(7010) << "Looking at url=" << url << " supported=" << supported << endl; - if ( !supported && KProtocolInfo::protocolClass(url.protocol()) == ":local" && - !url.url().startsWith("media:/") && !url.url().startsWith("system:/media")) + if ((!supported) && (KProtocolInfo::protocolClass(url.protocol()) == ":local")) { // Maybe we can resolve to a local URL? KURL localURL = TDEIO::NetAccess::mostLocalURL( url, 0 ); |