On Sat, May 28, 2016 at 3:22 PM, Arno <a...@disconnect.de> wrote: > Hi Thiago, > > On 5/28/2016 3:01 PM, Thiago Macieira wrote: >> Em sábado, 28 de maio de 2016, às 01:08:24 BRT, Arno Moeller escreveu: >>> As it seems, QUrl does not know about rdp://, so url.scheme() is empty. >>> The old code tried to "fix" it by replacing the scheme with vnc://, >>> because, as the comment stated, it was default in kde3. >> >> That doesn't make sense. QUrl does know about *any* schemes except "file", >> which means it recognises them all. > > Hmm, > Passing rdp://am@192.168.8.6 to > ~~ > QUrl url = QUrl::fromLocalFile(args.at(i)) > ~~ > with args.at(i) being rdp://192.168.8.1, I end up with url being > ~~ > file://rdp://am@192.168.8.6 > ~~
You told it to construct a url from a local file path, so, that seems somewhat expected. I'd presume what you should use is http://doc.qt.io/qt-5/qurl.html#fromUserInput which should usually make sense out of most random input. HS