Review Request 127138: Konqueror: Fix window title showing as "/" when URL ends with that

Jonathan Marten jjm at keelhaul.me.uk
Tue Feb 23 11:40:18 GMT 2016



> On Feb. 23, 2016, 7:49 a.m., David Faure wrote:
> > konqueror/src/konqview.cpp, line 692
> > <https://git.reviewboard.kde.org/r/127138/diff/1/?file=445029#file445029line692>
> >
> >     Your code is correct in that it's equivalent to the old code. However I wonder if this couldn't be simplified.
> >     
> >     If we want to display the filename of this->url(), unless "caption" was set to something completely different by the part, we could just compare path() instead of fileName()...
> >     
> >         const QUrl captionUrl(QUrl::fromUserInput(caption));
> >         if (captionUrl.isValid() && captionUrl.isLocalFile() && captionUrl.path() == url().path()) {
> >             adjustedCaption = captionUrl.adjusted(QUrl::StripTrailingSlash).fileName();
> >             // if empty...
> >         }
> >     
> >     This looks a bit simpler, I think? If you agree, can you test it, and push it if it works?

Tested and working, thanks for the suggestion!


- Jonathan


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


On Feb. 22, 2016, 3:12 p.m., Jonathan Marten wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127138/
> -----------------------------------------------------------
> 
> (Updated Feb. 22, 2016, 3:12 p.m.)
> 
> 
> Review request for KDE Base Apps and David Faure.
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> This happens when a local file URL which ends in "/" is navigated to.  For example, going to "/home/user" correctly shows "user" as the window title, while going to "/home/user/" shows "/" because the fileName() of that URL is empty.  This happens in particular when using the "Up" action, as it goes from "/home/user/foo" to "/home/user/".
> 
> This change ensures that trailing slashes are removed from URLs before using fileName() on them.
> 
> 
> Diffs
> -----
> 
>   konqueror/src/konqview.cpp 3707c7a 
> 
> Diff: https://git.reviewboard.kde.org/r/127138/diff/
> 
> 
> Testing
> -------
> 
> Built kde-baseapps with these changes, observed correct display of base name in Konqueror window title while navigating.
> 
> 
> Thanks,
> 
> Jonathan Marten
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20160223/a2132602/attachment.htm>


More information about the kde-core-devel mailing list