D14442: Unify window and tab title

David Hallas noreply at phabricator.kde.org
Wed Aug 15 13:44:52 BST 2018


hallas added a comment.


  In D14442#307088 <https://phabricator.kde.org/D14442#307088>, @markg wrote:
  
  > In D14442#306663 <https://phabricator.kde.org/D14442#306663>, @markg wrote:
  >
  > > 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.
  >
  >
  > To answer myself.
  >  Don't bother listening for the KCoreDirLister::started signal and then getting the rootitem. It's not set yet at that point. Just tried that out.
  
  
  Hi Mark,
  
  thanks for trying this out :)
  
  I have been digging a bit more into this myself, and haven't found a solution. It seems to be a bit of a fundamental problem, basically Dolphin doesn't have a KFileItem in all cases, and it has not always a way to get a KFileItem for a given QUrl. A simple example is, if you click 'Network' in the places panel, the DolphinMainWindow class is notified with a QUrl pointing to the place i clicked, in this case this will be 'remote://', but Dolphin has no way to query the 'Remote' KIO to get the display string ('Network') from it, so it cannot display this information. Today this situation is covered by querying the places model if a QUrl matches a places item, and if so use the display text for that. When Dolphin displays the contents of 'remote://' i see for example 'Samba Shares' which actually points to 'smb://', but the KFileItem::name returns 'Samba Shares', in this case where Dolphin has done KIO::listDir on 'remote://' we get the information we need. But in the case where the user entered 'smb://' in the location bar, Dolphin has no way to get a KFileItem for 'smb://' because that is returned by the 'remote://' protocol, and it has no way of knowing this coupling. This is the situation where i tried using KIO::stat on 'smb://' but that doesn't return this information, since it is the 'remote://' protocol implementing this.
  
  So long story short, with the current KIO infrastructure I can't really see a way where we always use the window title 'Samba Shares' if Dolphin has 'smb://' as the current url, we could achieve this in some cases, but it would be rather inconsistent.
  
  Currently I think I am mostly for keeping this patch as is and discuss if this window title stuff should work in a fundamentally different way?
  
  What do you guys think? Guidance is very much welcome :D

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/20180815/a06b6d23/attachment.htm>


More information about the kfm-devel mailing list