Review Request 118017: Fix expansion of ~

David Faure faure at kde.org
Tue May 6 21:22:30 UTC 2014



> On May 6, 2014, 12:51 p.m., David Faure wrote:
> > kurifilter-plugins/shorturi/kshorturifilter.cpp, line 374
> > <https://git.reviewboard.kde.org/r/118017/diff/1/?file=271779#file271779line374>
> >
> >     Better use QUrl u = QUrl::fromLocalFile(path) then.
> 
> Alexander Richardson wrote:
>     Doesn't pass before
> 
> Alexander Richardson wrote:
>     isMalformed is found by calling !uri().isValid(), which is !QUrl::fromUserInput("~").isValid().
>     
>     Without removing the isMalformed check, it will never attempt to determine whether the file exists and therefore exists will always be false and the result is an empty URL then.
> 
> Alexander Richardson wrote:
>     This is the test I am using in KIO: http://paste.kde.org/ptyzmefz6

I meant the unittest in kio-extras/kurifilter-plugins/tests/, which tests kshorturifilter with many different kinds of input data.

Ouch, I see that it has 30 failures right now....

My question was whether the removal of isValid() created new failures or not. But let's first fix these failures, it'll be easier afterwards.

I fixed the first one, now down to 26 failures. With your fromLocalFile fix, down to 19 failures.

But the isMalformed check can stay: I see in the unittest output that with these two fixes, "~" gets resolved properly.

I'll commit stuff shortly.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118017/#review57402
-----------------------------------------------------------


On May 6, 2014, 12:42 p.m., Alexander Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118017/
> -----------------------------------------------------------
> 
> (Updated May 6, 2014, 12:42 p.m.)
> 
> 
> Review request for Plasma and David Faure.
> 
> 
> Repository: kio-extras
> 
> 
> Description
> -------
> 
> With QUrl we have to set the scheme manually, seems like KUrl defaulted to
> file://.
> 
> Also removed the !isMalformed in the codition, QUrl("~") is malformed,
> whereas KUrl("~") was not
> 
> 
> Diffs
> -----
> 
>   kurifilter-plugins/shorturi/kshorturifilter.cpp 58f3435f7599acf692a082d216a0c58684bcf8b6 
> 
> Diff: https://git.reviewboard.kde.org/r/118017/diff/
> 
> 
> Testing
> -------
> 
> Added unit test in KIO, works now
> 
> 
> Thanks,
> 
> Alexander Richardson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140506/af39f98e/attachment.html>


More information about the Plasma-devel mailing list