summaryrefslogtreecommitdiff
path: root/src/downloadmanager.h
diff options
context:
space:
mode:
authorAl <gabriel.cortesi@outlook.com>2018-05-17 19:59:06 +0200
committerGitHub <noreply@github.com>2018-05-17 19:59:06 +0200
commit5a5bfee7126313608d37d533ea98bca9489fa5dc (patch)
tree2949379fe871e81d6912ac3c0b0e752c2ae9d0c1 /src/downloadmanager.h
parent2fc55ccc869c22aaea2524e05b0f0221399fb44d (diff)
parent8731159bfbaa34c431343b4e415590ae079a24bb (diff)
Merge pull request #362 from Al12rs/dirWatcher
Downloads tab: fix for freezes and greatly improved performance and responsiveness
Diffstat (limited to 'src/downloadmanager.h')
-rw-r--r--src/downloadmanager.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/downloadmanager.h b/src/downloadmanager.h
index 17ae8a35..aa859b13 100644
--- a/src/downloadmanager.h
+++ b/src/downloadmanager.h
@@ -144,6 +144,17 @@ public:
**/
void setOutputDirectory(const QString &outputDirectory);
+ /**
+ * @brief disables feedback from the downlods fileSystemWhatcher untill disableDownloadsWatcherEnd() is called
+ *
+ **/
+ static void startDisableDirWatcher();
+
+ /**
+ * @brief re-enables feedback from the downlods fileSystemWhatcher after disableDownloadsWatcherStart() was called
+ **/
+ static void endDisableDirWatcher();
+
/**
* @return current download directory
**/
@@ -519,6 +530,12 @@ private:
QFileSystemWatcher m_DirWatcher;
+ //The dirWatcher is actually triggering off normal Mo operations such as deleting downloads or editing .meta files
+ //so it needs to be disabled during operations that are known to cause the creation or deletion of files in the Downloads folder.
+ //Notably using QSettings to edit a file creates a temporarily .lock file that causes the Watcher to trigger multiple listRefreshes freezing the ui.
+ static int m_DirWatcherDisabler;
+
+
std::map<QString, int> m_DownloadFails;
bool m_ShowHidden;