D8273: Change window title when searching

Anthony Fieroni noreply at phabricator.kde.org
Sun Nov 12 15:02:18 GMT 2017


anthonyfieroni added a comment.


  Function should looks like:
  
    void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
    {
        static KFilePlacesModel s_placesModel;
    
        if (url.scheme().contains(QStringLiteral("search"))) {
            const auto search = i18n("Searching for ");
            const auto text = m_activeViewContainer->currentSearchText();
            setWindowTitle(search + text);
            return;
        }
        // ... rest of the function
    }

INLINE COMMENTS

> dolphinmainwindow.cpp:1004
>  
> +    if(m_activeViewContainer->view()->viewPropertiesContext() == "search"){
> +        schemePrefix = i18n("Search for ");

if[space]( and )[space]{ 

in every place.

> dolphinmainwindow.cpp:1006
> +        schemePrefix = i18n("Search for ");
> +        if(m_activeViewContainer->currentFacet() != ""){
> +            schemePrefix += m_activeViewContainer->currentFacet().toLower() + "s";

Always use isEmpty do not compare with empty null-terminated string.

> dolphinmainwindow.cpp:1009
> +            if(m_activeViewContainer->currentSearchText() != ""){
> +                schemePrefix += i18n(" named ");
> +            }

You cannot construct translated text in this way. Translated strings should be whole sentence.

> dolphinsearchbox.cpp:572
>  
> +QString DolphinSearchBox::getFacet() const
> +{

getXXX is not used as template name, use facetType instead.

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

To: xyquadrat, #dolphin, #kde_applications, ngraham
Cc: anthonyfieroni, elvisangelaccio, 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/20171112/7a307daa/attachment.htm>


More information about the kfm-devel mailing list