From 88f975eff7e44341c7fc35767ff954c7cb27ca9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 11 May 2015 22:50:35 +0200 Subject: NOISSUE only watch mod folders when the user is looking at them --- application/pages/ModFolderPage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'application/pages/ModFolderPage.cpp') diff --git a/application/pages/ModFolderPage.cpp b/application/pages/ModFolderPage.cpp index f070098f..16272653 100644 --- a/application/pages/ModFolderPage.cpp +++ b/application/pages/ModFolderPage.cpp @@ -47,12 +47,21 @@ ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr mods, m_helpName = helpPage; ui->modTreeView->setModel(m_mods.get()); ui->modTreeView->installEventFilter(this); - m_mods->startWatching(); auto smodel = ui->modTreeView->selectionModel(); connect(smodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(modCurrent(QModelIndex, QModelIndex))); } +void ModFolderPage::opened() +{ + m_mods->startWatching(); +} + +void ModFolderPage::closed() +{ + m_mods->stopWatching(); +} + CoreModFolderPage::CoreModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, QString iconName, QString displayName, QString helpPage, QWidget *parent) -- cgit v1.2.3