[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-windows
Subject: KDE/kdelibs/kdecore
From: Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date: 2009-02-22 19:31:01
Message-ID: 1235331061.415118.17796.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 930172 by chehrlic:
no idea what I break with this commit for KUrl handling on windows but KUrl::path() \
is /c:/foo . See mozilla urlbar and QUrl documentation. And we've to accept \
file:///tmp as a valid url - it doesn't matter that this path can't exist on windows \
- it only matters if it's a valid url.
CCMAIL: kde-windows@kde.org
M +4 -9 io/kurl.cpp
M +8 -15 tests/kurltest.cpp
--- trunk/KDE/kdelibs/kdecore/io/kurl.cpp #930171:930172
@@ -385,11 +385,11 @@
setPath( pathToSet.left( index ) );
_setQuery( pathToSet.mid( index + 1 ) );
}
+ return;
}
-#else
+#endif
if ( str[0] == QLatin1Char('/') || str[0] == QLatin1Char('~') )
setPath( str );
-#endif
else {
_setEncodedUrl( str.toUtf8() );
}
@@ -420,11 +420,11 @@
setPath( QString::fromUtf8( str+1 ) );
else if ( IS_DRIVE_OR_DOUBLESLASH_0 )
setPath( QString::fromUtf8( str ) );
-#else
+ }
+#endif
if ( str && str[0] ) {
if ( str[0] == '/' || str[0] == '~' )
setPath( QString::fromUtf8( str ) );
-#endif
else
_setEncodedUrl( str );
}
@@ -841,12 +841,7 @@
QString KUrl::path( AdjustPathOption trailing ) const
{
-#ifdef Q_OS_WIN
- // throw away the first '/' when it's a local file
- return trailingSlash( trailing, isLocalFile() ? QUrl::toLocalFile() : QUrl::path() \
);
-#else
return trailingSlash( trailing, QUrl::path() );
-#endif
}
QString KUrl::toLocalFile( AdjustPathOption trailing ) const
--- trunk/KDE/kdelibs/kdecore/tests/kurltest.cpp #930171:930172
@@ -38,13 +38,6 @@
#include <stdio.h>
#include <stdlib.h>
-// needed to build a valid path on windows
-#ifdef Q_OS_WIN
-#define LOCAL_FILE_PREFIX "C:"
-#else
-#define LOCAL_FILE_PREFIX
-#endif
-
void KUrlTest::testEmptyURL()
{
KUrl emptyURL;
@@ -1682,8 +1675,8 @@
void KUrlTest::testPathOrURL()
{
// passing path or url to the constructor: both work
- KUrl uloc( LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel" );
- QCOMPARE( uloc.path(), \
QString(LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel") ); + KUrl uloc( \
"/home/dfaure/konqtests/Mat%C3%A9riel" ); + QCOMPARE( uloc.path(), \
QString("/home/dfaure/konqtests/Mat%C3%A9riel") ); uloc = KUrl( "http://www.kde.org" \
); QCOMPARE( uloc.pathOrUrl(), uloc.url() );
QCOMPARE( uloc.pathOrUrl(KUrl::AddTrailingSlash), QString("http://www.kde.org/") \
); @@ -1708,7 +1701,7 @@
#endif
// pathOrUrl tests
- uloc = KUrl( LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel" );
+ uloc = KUrl( "/home/dfaure/konqtests/Mat%C3%A9riel" );
QCOMPARE( uloc.pathOrUrl(), uloc.path() );
uloc = "http://www.kde.org";
QCOMPARE( uloc.url(), QString("http://www.kde.org") );
@@ -1716,8 +1709,8 @@
QCOMPARE( uloc.pathOrUrl(), QString::fromUtf8("file:///home/dfaure/konq \
tests/Matériel#ref" ) ); uloc = \
"file:///home/dfaure/konq%20tests/Mat%C3%A9riel?query"; QCOMPARE( uloc.pathOrUrl(), \
QString::fromUtf8("file:///home/dfaure/konq tests/Matériel?query" ) \
);
- uloc = KUrl( LOCAL_FILE_PREFIX"/home/dfaure/file#with#hash" );
- QCOMPARE( uloc.pathOrUrl(), QString(LOCAL_FILE_PREFIX"/home/dfaure/file#with#hash" \
) ); + uloc = KUrl( "/home/dfaure/file#with#hash" );
+ QCOMPARE( uloc.pathOrUrl(), QString("/home/dfaure/file#with#hash" ) );
// test creation of url from pathOrUrl
uloc = KUrl( QString::fromUtf8("http://www.kde.org/home/andreas/täst") );
@@ -1738,11 +1731,11 @@
{
// passing path or url to the constructor: both work
KUrl uloc;
- uloc = LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel";
- QCOMPARE( uloc.path(), \
QString(LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel") ); + uloc = \
"/home/dfaure/konqtests/Mat%C3%A9riel"; + QCOMPARE( uloc.path(), \
QString("/home/dfaure/konqtests/Mat%C3%A9riel") ); KUrl u2;
u2 = uloc;
- QCOMPARE( u2.path(), \
QString(LOCAL_FILE_PREFIX"/home/dfaure/konqtests/Mat%C3%A9riel") ); + QCOMPARE( \
u2.path(), QString("/home/dfaure/konqtests/Mat%C3%A9riel") ); uloc = \
"http://www.kde.org"; QCOMPARE( uloc.pathOrUrl(), uloc.url() );
uloc = QString("www.kde.org" );
_______________________________________________
Kde-windows mailing list
Kde-windows@kde.org
https://mail.kde.org/mailman/listinfo/kde-windows
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic