D19311: Add navigation history to forward/back buttons

Elvis Angelaccio noreply at phabricator.kde.org
Tue Sep 24 21:11:00 BST 2019


elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> dolphinmainwindow.cpp:96-103
> +    // Converts a QUrl to a QString suitable for showing in the back/forward popup menu
> +    QString GetPopupMenuLabel(const QUrl& url)
> +    {
> +        if (url.isLocalFile()) {
> +            return url.adjusted(QUrl::RemoveScheme).toString();
> +        }
> +        return url.toString();

This whole function can be replaced with `urlNavigator->locationUrl(i).toString(QUrl::PreferLocalFile)` ;)

> dolphinmainwindow.cpp:708
> +    KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
> +    for (int numBack = gotoIndex - urlNavigator->historyIndex(); numBack; --numBack) {
> +        goBack();

`numBack > 0` would be more clear, probably? Btw I'd just call this variable `i`...

> dolphinmainwindow.cpp:737
> +    KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
> +    for (int numForward = urlNavigator->historyIndex() - gotoIndex; numForward; --numForward) {
> +        goForward();

Same here.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D19311

To: hallas, #dolphin, ngraham, elvisangelaccio, #vdg
Cc: felixernst, nerdopolist, mart, richardl, ognarb, david.fontanals, abetts, kfm-devel, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, meven, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190924/c0902a87/attachment.htm>


More information about the kfm-devel mailing list