KUrl(QString) fix
Leonardo Stern
leonardo.stern at gmail.com
Wed Dec 20 16:02:41 GMT 2006
Greetings,
KUrl kurl("file:///foo/bar")
path() == "/foo/bar" (not "foo/bar).
.
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