D14442: Unify window and tab title
Mark Gaiser
noreply at phabricator.kde.org
Sat Aug 11 17:22:46 BST 2018
markg added a comment.
Oke, that is quite a bit of layers to figure out...
DolphinView::rootItem, which you can access in DolphinViewContainer::getCaption as m_view->rootItem(); is what you want to use.
But i've got bad news as well.
You update the window title _before_ the KIO model had time to do it's request so the m_view->rootItem(); is still invalid (or the previous folder).
You need to defer that call till after the model had set the root url (m_view->rootItem() ultimately comes from KCoreDirLister::rootItem). It is set when KCoreDirLister::listDir is called.
That could lead to the title not being set till _after_ all files have been received. Which would be rather ugly as the title only changes after receiving files.
A possible fix for you would be to listen for the KCoreDirLister::started signal, but that object alone is hidden quite deeply (It's a member of KFileItemModel) and i don't even know if that would work. You're best of making a small test project to test this out.
Also, if that is not working, it would probably be accepted as a patch to have the rootitem set when started is emitted. That would be a patch to KCoreDirLister.
I hope this helps. However you fix it, there is no easy way :)
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D14442
To: hallas, #dolphin, ngraham, elvisangelaccio
Cc: markg, kfm-devel, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180811/12e2dcc3/attachment.htm>
More information about the kfm-devel
mailing list