NOISSUE only watch mod folders when the user is looking at them
This commit is contained in:
@ -47,12 +47,21 @@ ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr<ModList> 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<ModList> mods,
|
||||
QString id, QString iconName, QString displayName,
|
||||
QString helpPage, QWidget *parent)
|
||||
|
@ -54,6 +54,8 @@ public:
|
||||
}
|
||||
virtual bool shouldDisplay() const;
|
||||
|
||||
virtual void opened();
|
||||
virtual void closed();
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
bool modListFilter(QKeyEvent *ev);
|
||||
|
Reference in New Issue
Block a user