From 8dc9c9ce9803323b9d487388291426986ed69ac3 Mon Sep 17 00:00:00 2001 From: likehomedream Date: Fri, 13 Oct 2023 16:25:18 +0800 Subject: [PATCH] fix update historywidget --- src/mainwindow.cpp | 2 +- src/module/historywidget.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0374b96..840902a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -159,7 +159,6 @@ void MainWindow::initUI() alllayout->addWidget(m_guideWidget); alllayout->addWidget(m_historywidget); } - m_historywidget->updateHistoryDir(); }); QFileSystemWatcher* watcher = new QFileSystemWatcher(this); @@ -187,6 +186,7 @@ void MainWindow::onGoHomeClicked() m_stackedWidget->setCurrentIndex(0); }); connect(m_cacheConfirmedWidget, &cacheConfirmedWidget::cacheSave, this, [=](){ + m_historywidget->updateHistoryDir(); m_stackedWidget->setCurrentIndex(0); }); } else { diff --git a/src/module/historywidget.cpp b/src/module/historywidget.cpp index 3e18511..c3b4478 100644 --- a/src/module/historywidget.cpp +++ b/src/module/historywidget.cpp @@ -109,7 +109,10 @@ void HistoryWidget::updateHistoryDir() button->setThemeName(info->getThemeName()); button->setThemeType(info->getThemeType()); button->initUI(); + connect(button,&HistoryButton::clicked,this,[=](){ + emit startSecondEdit(info->getInfoData()); + }); layout->addWidget(button, row, col); col++;