D8273: Change window title when searching

Emmanuel Pescosta noreply at phabricator.kde.org
Sat Oct 14 12:34:29 BST 2017


emmanuelp added inline comments.

INLINE COMMENTS

> dolphinmainwindow.cpp:1003
>  
> +    if (m_activeViewContainer->isSearchModeEnabled()) {
> +        schemePrefix = i18n("Searching ");

This will lead to some tricky corner cases producing wrong window titles (like `baloosearch - /`), when the URL is a search URL but the state of the search box doesn't reflect it at this point (depends on the ordering of the method calls).

Better use the information available in the `url`, e.g.:

- If URL scheme is `baloosearch` use `Baloo::Query::titleFromQueryUrl(url)`
- If URL scheme is 'filenamesearch` use `QString("Query Results from '%1'").arg(url.queryItemValue("search"))`

      if (url.scheme() == "baloosearch") {
  #ifdef HAVE_BALOO
          return Baloo::Query::titleFromQueryUrl(url);
  #endif
      } else if (url.scheme() == "filenamesearch") {
          return QString("Query Results from '%1'").arg(url.queryItemValue("search"));
      }
  
     //... existing code ....

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

To: xyquadrat, #dolphin, #kde_applications, ngraham
Cc: emmanuelp, ngraham, #dolphin, spoorun, navarromorales, firef, andrebarros
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171014/70c7e9a4/attachment.htm>


More information about the kfm-devel mailing list