From kde-core-devel Mon Mar 17 11:08:16 2008 From: Ralf Habacker Date: Mon, 17 Mar 2008 11:08:16 +0000 To: kde-core-devel Subject: Re: 'lightweight' QDir::isAbsolutePath replacement ? Message-Id: <47DE5120.1090704 () freenet ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=120575222018821 Thiago Macieira schrieb: > On Friday 14 March 2008 14:56:16 Ralf Habacker wrote: > >> bool QDir::isRelativePath(const QString &path) >> { >> bool a = QFileInfo(path).isRelative(); >> bool b = QFileInfo::isRelative(path); >> if (a != b) >> qDebug() << path << a << b; >> return a; >> } >> >> > [snip] > >> it looks that the new implementation seems to assume that a path >> starting with '\' is a relative path. >> > > Ah, I see! It's missing the conversion to Qt separators. > > > Wasn't this case covered by your test case ? I used the following pattern QStringList isAbsolutePattern; isAbsolutePattern << "" << "/" << "\\" << "C:/fdfdf" << "c:\\dfdffd" << "/edrfdfdf" << "\\dfdfdfdf" << "\\\\dfdfdfdf"; QStringList isRelativePattern; isRelativePattern << "sdsd" << "Cssss" << "." ; Ralf