KUrl(QString) fix
Ralf Habacker
ralf.habacker at freenet.de
Wed Dec 20 16:56:39 GMT 2006
Leonardo Stern schrieb:
> Greetings,
>
> KUrl kurl("file:///foo/bar")
> path() == "/foo/bar" (not "foo/bar).
> .
unfortunally this patch breaks support for KUrl
kurl("file:///C:/foo/bar") .
Ralf
> What Is better : a inline patch or a attachment one ?
>
> regards,
> Leonardo Stern
>
>
> Index: kdecore/kurl.cpp
> ===================================================================
> --- kdecore/kurl.cpp (revision 615140)
> +++ kdecore/kurl.cpp (working copy)
> @@ -311,14 +311,10 @@
> KUrl::KUrl( const QString &str )
> : QUrl(), d(0)
> {
> - if ( !str.isEmpty() ) {
> + if ( !str.isEmpty() ) {
> #ifdef Q_WS_WIN
> kDebug(126) << "KUrl::KUrl " << str.toAscii().data() << endl;
> - if ( str.startsWith("file:///") ) {
> - kDebug(126) << "KUrl::KUrl " << "converting file schema from: "
> << str.toAscii().data() << " to: " << QUrl::fromPercentEncoding(
> str.mid(8).toLatin1() ) << endl;
> - setPath( QUrl::fromPercentEncoding( str.mid(8).toLatin1() ) );
> - }
> - else if ( str.startsWith("file://") && str[7].isLetter() &&
> str[8] == QLatin1Char(':') ) {
> + if ( str.startsWith("file://") && str[7].isLetter() && str[8] ==
> QLatin1Char(':') ) {
> kDebug(126) << "KUrl::KUrl " << "converting file schema from: "
> << str.toAscii().data() << " to: " << QUrl::fromPercentEncoding(
> str.mid(7).toLatin1() ) << endl;
> setPath( QUrl::fromPercentEncoding( str.mid(7).toLatin1() ) );
> }
More information about the kde-core-devel
mailing list