hein requested changes to this revision. hein added a comment. This revision now requires changes to proceed.
I'm not entirely happy with the way this works, I think the history may need to be kept on the QML side instead, then: (a) You can properly evict the history when the URL in the config changes (b) Tie the visibility of the Back button to whether the history is empty or not So basically before QML runs FolderModel::cd write down the URL, then when back is pressed pop it off. FolderModel can't know when to evict the history because it can't distinguish between setUrl coming from cd() or from a config change, only the applet code can. Having history functionality in FolderModel is otherwise attractive, so this is a bit of a dilemma. Putting the history into QML however keeps FolderModel "dumber" in the sense that it doesn't have to reason about intent and just does what it's told, and the higher level situation is captured on the side of the user of the model instead. INLINE COMMENTS > foldermodel.cpp:487 > + if (backUrl.isValid()) { > + setUrl(backUrl.toString()); > + m_history.removeLast(); For future reference: This can be simplified to takeLast(). REPOSITORY R119 Plasma Desktop REVISION DETAIL https://phabricator.kde.org/D3931 EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: chinmoyr, hein, #plasma Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas