aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ModFolderModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/mod/ModFolderModel.cpp')
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp
index adc828c2..d8170067 100644
--- a/launcher/minecraft/mod/ModFolderModel.cpp
+++ b/launcher/minecraft/mod/ModFolderModel.cpp
@@ -65,15 +65,21 @@ void ModFolderModel::startWatching()
update();
+ // Watch the mods folder
is_watching = m_watcher->addPath(m_dir.absolutePath());
- if (is_watching)
- {
+ if (is_watching) {
qDebug() << "Started watching " << m_dir.absolutePath();
- }
- else
- {
+ } else {
qDebug() << "Failed to start watching " << m_dir.absolutePath();
}
+
+ // Watch the mods index folder
+ is_watching = m_watcher->addPath(indexDir().absolutePath());
+ if (is_watching) {
+ qDebug() << "Started watching " << indexDir().absolutePath();
+ } else {
+ qDebug() << "Failed to start watching " << indexDir().absolutePath();
+ }
}
void ModFolderModel::stopWatching()
@@ -82,14 +88,18 @@ void ModFolderModel::stopWatching()
return;
is_watching = !m_watcher->removePath(m_dir.absolutePath());
- if (!is_watching)
- {
+ if (!is_watching) {
qDebug() << "Stopped watching " << m_dir.absolutePath();
- }
- else
- {
+ } else {
qDebug() << "Failed to stop watching " << m_dir.absolutePath();
}
+
+ is_watching = !m_watcher->removePath(indexDir().absolutePath());
+ if (!is_watching) {
+ qDebug() << "Stopped watching " << indexDir().absolutePath();
+ } else {
+ qDebug() << "Failed to stop watching " << indexDir().absolutePath();
+ }
}
bool ModFolderModel::update()