D8273: Change window title when searching

Mark Gaiser noreply at phabricator.kde.org
Mon Oct 16 11:50:42 BST 2017


markg added a comment.


    /**
     * Sets a context that is used for remembering the view-properties.
     * Per default the context is empty and the path of the currently set URL
     * is used for remembering the view-properties. Setting a custom context
     * makes sense if specific types of URLs (e.g. search-URLs) should
     * share common view-properties.
     */
    void setViewPropertiesContext(const QString& context);
    QString viewPropertiesContext() const;
  
  I think you want that, it's in every view object (DolphinView).
  You can probably get the property with: m_activeViewContainer->view()->viewPropertiesContext()
  
  Right now, the viewPropertiesContext is search when in a search, but i don't know if that's after you typed in a query and pressed enter or as soon as the search box is open.
  If it's the latter, then you should probably expand the viewPropertiesContext to say (for instance) "search" when the box is open, but enter isn't pressed yet and "search-results" when results are shown.
  
  Note, you also have the "isSearchUrl(const QUrl &url)" method in DolphinViewContainer. It probably does exactly what you want, but imho it's check to determine the "isSearchUrl" is rather weak. It simply does a string contains on the scheme which evaluates to true if "search" is in the scheme. It probably works just fine.
  
  Just my 5 cents :)

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

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


More information about the kfm-devel mailing list