summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-07 00:44:30 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-07 11:44:42 +0200
commitc44d41ee9b132d4f757658bd62d4b115b7887fe3 (patch)
treec0561e813b62ee85ba70066ac2682bc90819968d /api
parentcf0694a0cb9041c14cc0e06b9495590baacead73 (diff)
downloadMultiMC-c44d41ee9b132d4f757658bd62d4b115b7887fe3.tar
MultiMC-c44d41ee9b132d4f757658bd62d4b115b7887fe3.tar.gz
MultiMC-c44d41ee9b132d4f757658bd62d4b115b7887fe3.tar.lz
MultiMC-c44d41ee9b132d4f757658bd62d4b115b7887fe3.tar.xz
MultiMC-c44d41ee9b132d4f757658bd62d4b115b7887fe3.zip
NOISSUE do not attempt to stop watching world folders if they are not being watched
Diffstat (limited to 'api')
-rw-r--r--api/logic/minecraft/WorldList.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/api/logic/minecraft/WorldList.cpp b/api/logic/minecraft/WorldList.cpp
index 42c8a3e6..df897e7c 100644
--- a/api/logic/minecraft/WorldList.cpp
+++ b/api/logic/minecraft/WorldList.cpp
@@ -37,6 +37,10 @@ WorldList::WorldList(const QString &dir)
void WorldList::startWatching()
{
+ if(is_watching)
+ {
+ return;
+ }
update();
is_watching = m_watcher->addPath(m_dir.absolutePath());
if (is_watching)
@@ -51,6 +55,10 @@ void WorldList::startWatching()
void WorldList::stopWatching()
{
+ if(!is_watching)
+ {
+ return;
+ }
is_watching = !m_watcher->removePath(m_dir.absolutePath());
if (!is_watching)
{