summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-06-17 18:36:28 +0200
committerTannin <devnull@localhost>2014-06-17 18:36:28 +0200
commite22aeca3ff979238f701683429869f7556116407 (patch)
treec4bdbf1f20a7cffe41fefd089fb290200b67dd11 /src
parentcbd6b288eb968e522e4007cb4a74b3c1bc5a8360 (diff)
- download read buffer is now limited to 1MB. Might prevent out-of-memory errors during download
- bugfix: plugins are now disabled when deactivating a mod before the files are removed from the vfs
Diffstat (limited to 'src')
-rw-r--r--src/downloadmanager.cpp4
-rw-r--r--src/mainwindow.cpp7
2 files changed, 4 insertions, 7 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index e3cab528..d6456fc7 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -350,9 +350,6 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const ModRepositoryFileI
bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, const QString &fileName,
int modID, int fileID, const ModRepositoryFileInfo *fileInfo)
{
- if (!reply->isRunning()) {
- qDebug("this is not a running download! %d", reply->isFinished());
- }
// download invoked from an already open network reply (i.e. download link in the browser)
DownloadInfo *newDownload = DownloadInfo::createNew(fileInfo, URLs);
@@ -401,6 +398,7 @@ void DownloadManager::removePending(int modID, int fileID)
void DownloadManager::startDownload(QNetworkReply *reply, DownloadInfo *newDownload, bool resume)
{
+ reply->setReadBufferSize(1024 * 1024); // don't read more than 1MB at once to avoid memory troubles
newDownload->m_Reply = reply;
setState(newDownload, STATE_DOWNLOADING);
if (newDownload->m_Urls.count() == 0) {
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c6413fc1..e6723fc1 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2684,6 +2684,8 @@ void MainWindow::modStatusChanged(unsigned int index)
if (m_CurrentProfile->modEnabled(index)) {
updateModInDirectoryStructure(index, modInfo);
} else {
+ updateModActiveState(index, false);
+ refreshESPList();
if (m_DirectoryStructure->originExists(ToWString(modInfo->name()))) {
FilesOrigin &origin = m_DirectoryStructure->getOriginByName(ToWString(modInfo->name()));
origin.enable(false);
@@ -3004,7 +3006,7 @@ void MainWindow::updateModActiveState(int index, bool active)
int enabled = 0;
QStringList esps = dir.entryList(QStringList("*.esp"), QDir::Files);
foreach (const QString &esp, esps) {
- if (active && !m_PluginList.isEnabled(esp)) {
+ if (active != m_PluginList.isEnabled(esp)) {
m_PluginList.enableESP(esp, active);
++enabled;
}
@@ -3020,9 +3022,6 @@ void MainWindow::updateModActiveState(int index, bool active)
void MainWindow::modlistChanged(const QModelIndex&, int)
{
-/* if (role == Qt::CheckStateRole) {
- updateModActiveState(index.row(), index.data(Qt::CheckStateRole).toBool());
- }*/
}
void MainWindow::removeMod_clicked()