Work-around issue in Path(QString) ctor
Problem: Path(QString) will call Path(QUrl) constructor, constructing an
url via QUrl::fromUserInput(...).
Because QUrl::fromUserInput by default is in tolerant mode, Path("/tmp/
") would be transformed into Path(QUrl("file:///tmp")) -> thus break the
path.
Consider this example:
#include <QDebug> #include <QUrl> int main() { auto u1 = QUrl::fromLocalFile("/tmp/ "); auto u2 = QUrl::fromUserInput("/tmp/ "); qDebug() << u1.toLocalFile(); qDebug() << u2.toLocalFile(); }
Will give:
main(8): "/tmp/ " main(9): "/tmp/"
TODO: We need another Path ctor when we are sure we want to pass a local
file (e.g. by adding a static Path::fromLocalFile(...))?
CCBUG: 378933