fix: Page container extra info set on logs page

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-25 22:00:33 +03:00
parent bcf45c74a1
commit 6d0e255ca1
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@
class BasePage {
public:
using updateExtraInfoFunc = std::function<void(QString)>;
using updateExtraInfoFunc = std::function<void(QString, QString)>;
virtual ~BasePage() {}
virtual QString id() const = 0;
virtual QString displayName() const = 0;

View File

@ -83,7 +83,7 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared
connect(selection_model, &QItemSelectionModel::currentChanged, this, &ExternalResourcesPage::current);
auto updateExtra = [this]() {
if (updateExtraInfo)
updateExtraInfo(extraHeaderInfoString());
updateExtraInfo(id(), extraHeaderInfoString());
};
connect(selection_model, &QItemSelectionModel::selectionChanged, this, updateExtra);
connect(model.get(), &ResourceFolderModel::updateFinished, this, updateExtra);

View File

@ -93,8 +93,8 @@ PageContainer::PageContainer(BasePageProvider *pageProvider, QString defaultId,
page->listIndex = counter;
page->setParentContainer(this);
counter++;
page->updateExtraInfo = [this](QString info) {
if (m_currentPage)
page->updateExtraInfo = [this](QString id, QString info) {
if (m_currentPage && id == m_currentPage->id())
m_header->setText(m_currentPage->displayName() + info);
};
}