unexpected KUrl behavior: KUrl("someFile.ext").isLocalFile() == false

Milian Wolff mail at milianw.de
Wed Jun 16 17:02:50 BST 2010


I was just hit by a to me very unexpected behavior in KUrl, and there is even 
a unit test for it: kurltest.cpp:766

void KUrlTest::testIsRelative()
  KUrl something("something");
  QCOMPARE(something.url(), QString("something"));
  QCOMPARE(something.protocol(), QString());

That was added by David Faure in 817333, sadly the commit message is not 
really clear:

"answering Pino's question with a unit test"

;-) see also:


Can someone elaborate on why this is the correct behavior? To me something 

KUrl("someFile.txt").isLocalFile() should return true

Milian Wolff
mail at milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100616/07a4a2f5/attachment.sig>

More information about the kde-core-devel mailing list