Merge pull request #954 from xiaoyifang/fix/crash-restore-state

fix: a possible crash of restoreState() in linux with qt6.5.1
This commit is contained in:
xiaoyifang 2023-07-12 10:00:49 +08:00 committed by GitHub
commit 9c1413adea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -712,24 +712,17 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
// Create tab list menu
createTabList();
if ( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
if ( cfg.mainWindowState.size() && !cfg.resetState )
restoreState( cfg.mainWindowState );
if ( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
// Show the initial welcome text
{
ArticleView * view = getCurrentArticleView();
history.enableAdd( false );
blockUpdateWindowTitle = true;
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
history.enableAdd( cfg.preferences.storeHistory );
}
ArticleView * view = getCurrentArticleView();
history.enableAdd( false );
blockUpdateWindowTitle = true;
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
history.enableAdd( cfg.preferences.storeHistory );
translateLine->setFocus();