[Kde-extra-gear] K3b 0.12.6 released

Koos Vriezen koos.vriezen at xs4all.nl
Sat Oct 29 22:50:48 CEST 2005


On Sat, Oct 29, 2005 at 06:32:59PM -0200, Thiago Macieira wrote:
> Sebastian Trueg wrote:
> >KURL K3b::convertToLocalUrl( const KURL& url )
> >{
> >  if( !url.isLocalFile() ) {
> >    KIO::UDSEntry e;
> >    if( KIO::NetAccess::stat( url, e, 0 ) ) {
> >      for( KIO::UDSEntry::iterator it = e.begin(); it != e.end(); ++it )
> > { if( (*it).m_uds == KIO::UDS_LOCAL_PATH )
> >          return KURL::fromPathOrURL( (*it).m_str );
> >      }
> >    }
> >  }
> >
> >  return url;
> >}
> 
> Note that KIO::UDS_LOCAL_PATH isn't defined prior to KDE 3.4.
> 
> You have to define it to KIO::UDS_STRING|72 in prior versions.
> 
> Your code should be more or less:
> #if KDE_IS_VERSION(3,4,91)
>   // use KFileItem::localPath or NetAccess::mostLocalURL
> #else
> # define UDS_LOCALPATH (72 | KIO::UDS_STRING)
>   // do the loop Sebastian posted
> #endif

What about that this quite heavy, like I mailed in earlier. And worse,
doing more than requested, like connecting to a host when URL turns out
to be a network address.

Tia,

Koos


More information about the Kde-extra-gear mailing list