diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-05-17 00:01:54 +0200 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-05-17 00:03:10 +0200 |
| commit | 8731159bfbaa34c431343b4e415590ae079a24bb (patch) | |
| tree | 05ad6d57458c5c98d7b8d01364a1e5e5e09e6f53 /src/downloadmanager.h | |
| parent | 1c6543454ef4d3b84e2ce1f6928b6c99005eee29 (diff) | |
Huge performace improvements for downloads tab by disabling the dirWatcher triggered refreshes.
Avoid app freezes caused by stacked refresh calls.
Added chack to see if a download is alerady hidden before trying to hide it.
Made sure to refresh Download tab where it was othwerwise relying in the dirwatcher to refresh.
Diffstat (limited to 'src/downloadmanager.h')
| -rw-r--r-- | src/downloadmanager.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 74627be5..aa859b13 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -148,12 +148,12 @@ public: * @brief disables feedback from the downlods fileSystemWhatcher untill disableDownloadsWatcherEnd() is called
*
**/
- void startDisableDirWatcher();
+ static void startDisableDirWatcher();
/**
* @brief re-enables feedback from the downlods fileSystemWhatcher after disableDownloadsWatcherStart() was called
**/
- void endDisableDirWatcher();
+ static void endDisableDirWatcher();
/**
* @return current download directory
@@ -533,7 +533,8 @@ private: //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.
- int m_DirWatcherDisabler;
+ static int m_DirWatcherDisabler;
+
std::map<QString, int> m_DownloadFails;
|
