From 89daa70b6b11dd41e4016ed0e63d5a8a532d4c6e Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Wed, 3 Jul 2024 11:26:06 +0800 Subject: [PATCH] Revert "clean: remove useless code and refactor" This reverts commit 3a46dd290b995f7a0040bbe590ef26b4794a68fe. 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 --- src/ui/mainwindow.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index 30311234..ae32dc1e 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -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(); }