Bug 279678 - [KUrlNavigator] Patch proposal: history related methods
Summary: [KUrlNavigator] Patch proposal: history related methods
Status: RESOLVED NOT A BUG
Alias: None
Product: kfile
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 18:39 UTC by Robert-André Mauchin
Modified: 2011-08-09 20:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
History patch for KUrlnavigator (5.90 KB, patch)
2011-08-08 18:39 UTC, Robert-André Mauchin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert-André Mauchin 2011-08-08 18:39:55 UTC
Created attachment 62671 [details]
History patch for KUrlnavigator

Version:           unspecified (using Devel) 
OS:                Linux

This patch provides new methods in order to solve bug https://bugs.kde.org/show_bug.cgi?id=157819

Goes to a specific position in the URL history.
bool goToHistory(int index);

Returns true if index is available.
bool canGoTo(int index) const;

Save a KUrlNavigator parameters into a NavigatorData struct.
NavigatorData saveNavigator() const;

Restore previous KUrlNavigator parameters to current KUrlNavigator.
void restoreNavigator(const NavigatorData navdata);

I'm new to KDE, QT and C++, any input is welcomed.

Reproducible: Didn't try



Expected Results:  
N/A
Comment 1 Peter Penz 2011-08-09 20:12:16 UTC
Thanks for the patch and your efforts to fix bug 157819, but it really would have been great if you'd have asked the maintainers of Dolphin and KUrlNavigator _before_ investigating so much time into this quite huge combination of this patch + the patch for bug 157819...

I know that the KUrlNavigator interface is quite crappy and that a cleanup must be done for KDE Framework 5, however to solve bug 157819 there is no need to do any interface extension to KUrlNavigator:
- You can ask the number of history entries by KUrlNavigator::historySize() and the current index by KUrlNavigator::historyIndex()
- Any data that needs additionally to get saved can be done in a generic way by KUrlNavigator::saveLocationState().

What's ugly with the current KUrlNavigator interface is how the iterating through the items must be done to get the whole location-states of the history. But still it is possible without adding new interfaces...

So for KDE Framework 4.x I don't plan to extend the the current KUrlNavigator interface. There are plans to do a major cleanup for KDE Framework 5 and any input would be very welcome, but I'm sorry to say that this patch cannot get merged.

A short note regarding the patch for bug 157819: There are plans for Dolphin 2.0 to split up DolphinMainWindow in smaller, more maintainable sub-classes and this was one reason why the history-feature has not been implemented yet, as the cleanup should be applied first before adding another feature to DolphinMainWindow. As said above: Please, please drop the maintainers a short note _before_ implementing a new feature of this size. I understand that this is frustrating but I still hope that you'll continue to contribute patches :-)