Merge pull request #1060 from xiaoyifang/opt/remove-old-logic

fix: remove old unnecessary logic which blocks updating Windows Title
This commit is contained in:
xiaoyifang 2023-08-11 08:30:05 +08:00 committed by GitHub
commit cc1258fe1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 9 deletions

View file

@ -165,7 +165,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
wordFinder( this ),
wordListSelChanged( false ),
wasMaximized( false ),
blockUpdateWindowTitle( false ),
headwordsDlg( nullptr ),
ftsIndexing( dictionaries ),
ftsDlg( nullptr ),
@ -734,8 +733,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
setWindowTitle( "GoldenDict-ng" );
blockUpdateWindowTitle = true;
// Create tab list menu
createTabList();
@ -763,7 +760,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
addNewTab();
ArticleView * view = getCurrentArticleView();
history.enableAdd( false );
blockUpdateWindowTitle = true;
view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId );
history.enableAdd( cfg.preferences.storeHistory );
@ -1945,9 +1941,7 @@ void MainWindow::updateWindowTitle()
if ( view ) {
QString str = view->getTitle();
if ( !str.isEmpty() ) {
if ( !blockUpdateWindowTitle )
setWindowTitle( tr( "%1 - %2" ).arg( str, "GoldenDict-ng" ) );
blockUpdateWindowTitle = false;
setWindowTitle( tr( "%1 - %2" ).arg( str, "GoldenDict-ng" ) );
}
}
}

View file

@ -155,8 +155,6 @@ private:
bool wasMaximized; // Window state before minimization
bool blockUpdateWindowTitle;
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
DictHeadwords * headwordsDlg;