summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-02-16 15:49:35 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-02-16 15:54:40 +0100
commitc02fbe89c7ecb65b39698a014b506be3fc77b853 (patch)
tree0c27385d7fdec8c8d1330e038a140d3383afbdf9 /src
parente33d0f9d35fd8c97dfca413da9a927afd8196631 (diff)
Allow not refreshing downloads when setting their folder, for example during init.
Diffstat (limited to 'src')
-rw-r--r--src/downloadmanager.cpp6
-rw-r--r--src/downloadmanager.h2
-rw-r--r--src/organizercore.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 7b416d50..bbf2f79e 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -281,14 +281,16 @@ void DownloadManager::pauseAll()
}
-void DownloadManager::setOutputDirectory(const QString &outputDirectory)
+void DownloadManager::setOutputDirectory(const QString &outputDirectory, const bool refresh)
{
QStringList directories = m_DirWatcher.directories();
if (directories.length() != 0) {
m_DirWatcher.removePaths(directories);
}
m_OutputDirectory = QDir::fromNativeSeparators(outputDirectory);
- refreshList();
+ if (refresh) {
+ refreshList();
+ }
m_DirWatcher.addPath(m_OutputDirectory);
}
diff --git a/src/downloadmanager.h b/src/downloadmanager.h
index 4fc61cad..d6342f22 100644
--- a/src/downloadmanager.h
+++ b/src/downloadmanager.h
@@ -158,7 +158,7 @@ public:
*
* @param outputDirectory the new output directory
**/
- void setOutputDirectory(const QString &outputDirectory);
+ void setOutputDirectory(const QString &outputDirectory, const bool refresh = true);
/**
* @brief disables feedback from the downlods fileSystemWhatcher untill disableDownloadsWatcherEnd() is called
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 18c8bcd4..12302df2 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -106,7 +106,7 @@ OrganizerCore::OrganizerCore(Settings &settings)
, m_ArchivesInit(false)
, m_PluginListsWriter(std::bind(&OrganizerCore::savePluginList, this))
{
- m_DownloadManager.setOutputDirectory(m_Settings.paths().downloads());
+ m_DownloadManager.setOutputDirectory(m_Settings.paths().downloads(), false);
NexusInterface::instance(m_PluginContainer)->setCacheDirectory(
m_Settings.paths().cache());