Revert "clean: remove useless code and refactor"

This reverts commit 3a46dd290b.

the changes is not exactly the same.
close the last tab will cause the windows to create a new blank tab which will fall into infinite loop
This commit is contained in:
Xiao Yi Fang 2024-07-03 11:26:06 +08:00 committed by xiaoyifang
parent 8b67a9bd7e
commit 89daa70b6b

View file

@ -1834,9 +1834,11 @@ void MainWindow::closeCurrentTab()
void MainWindow::closeAllTabs()
{
while ( ui.tabWidget->count() > 0 ) {
while ( ui.tabWidget->count() > 1 )
closeCurrentTab();
}
// close last tab
closeCurrentTab();
}
void MainWindow::closeRestTabs()
@ -1876,13 +1878,19 @@ void MainWindow::switchToPrevTab()
void MainWindow::backClicked()
{
GD_DPRINTF( "Back\n" );
ArticleView * view = getCurrentArticleView();
view->back();
}
void MainWindow::forwardClicked()
{
GD_DPRINTF( "Forward\n" );
ArticleView * view = getCurrentArticleView();
view->forward();
}