opt: suppress url title (#1619)

* opt: suppress url title

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2024-06-27 18:01:15 +08:00 committed by GitHub
parent 08a952205c
commit d30de48fa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -478,7 +478,7 @@ void ArticleView::loadFinished( bool result )
void ArticleView::handleTitleChanged( QString const & title )
{
if ( !title.isEmpty() )
if ( !title.isEmpty() && !title.contains( "://" ) )
emit titleChanged( this, title );
}
@ -1443,7 +1443,10 @@ void ArticleView::setContent( const QByteArray & data, const QString & mimeType,
QString ArticleView::getTitle()
{
return webview->page()->title();
auto title = webview->title();
if ( title.contains( "://" ) )
return {};
return webview->title();
}
QString ArticleView::getWord() const