Merge pull request #1906 from xiaoyifang/opt/articleview-loadfinish

opt: rearrange some code execution order
This commit is contained in:
xiaoyifang 2024-11-06 17:49:28 +08:00 committed by GitHub
commit 8d0859b932
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -440,19 +440,16 @@ void ArticleView::inspectElement()
void ArticleView::loadFinished( bool result )
{
setZoomFactor( cfg.preferences.zoomFactor );
QUrl url = webview->url();
qDebug() << "article view loaded url:" << url.url().left( 200 ) << result;
webview->unsetCursor();
if ( url.url() == "about:blank" ) {
return;
}
if ( !result ) {
qWarning() << "article loaded unsuccessful";
return;
}
QUrl url = webview->url();
if ( url.url() == "about:blank" ) {
return;
}
qDebug() << "article view loaded url:" << url.url().left( 50 ) << result;
if ( cfg.preferences.autoScrollToTargetArticle ) {
QString const scrollTo = Utils::Url::queryItemValue( url, "scrollto" );