From c44d41ee9b132d4f757658bd62d4b115b7887fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 7 Aug 2016 00:44:30 +0200 Subject: NOISSUE do not attempt to stop watching world folders if they are not being watched --- api/logic/minecraft/WorldList.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'api') 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) { -- cgit v1.2.3