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




konqueror/src/konqview.cpp (line 692)
<https://git.reviewboard.kde.org/r/127138/#comment63155>

    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?


- David Faure


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
> 
>

Reply via email to