QUrl behavior and KIO
Marco Martin
notmart at gmail.com
Wed Sep 4 16:39:57 UTC 2013
Hi all,
porting a couple of kio slaves (trying to make sense of the trash kio partly
ported to kf5 in a gsoc) i noticed what appears to be a slight behavior change
compared to when it used KUrl
something like this in kde4 was working:
KUrl u;
u.setPath( "/some/valid/path" );
KIO::Job* job = KIO::move( u, KUrl("trash:/"), KIO::HideProgressInfo );
something like this doesn't:
QUrl u;
u.setPath( "/some/valid/path" );
KIO::Job* job = KIO::move( u, QUrl("trash:/"), KIO::HideProgressInfo );
TrashProtocol::rename() doesn't even get called (there is on stderr a message
unknown protocol '').
while instead something like this work:
QUrl u = QUrl::fromLocalFile( "/some/valid/path" );
KIO::Job* job = KIO::move( u, QUrl("trash:/"), KIO::HideProgressInfo );
because u is now file:///some/valid/path
what should be done? modify kio to make qurls without scheme work (and assume
they are file://) or modify all the users to make sure a scheme is always
passed?
Cheers,
Marco Martin
More information about the Kde-frameworks-devel
mailing list