diff --git a/Changelog b/Changelog index 2261389d1..08f44c860 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unreleased - Christophe Dumez - v2.6.7 - BUGFIX: Encoding fixes (Windows) - BUGFIX: Fix "append label to save path" on Windows + - BUGFIX: Disable OS cache for aligned files to reduce memory consumption * Tue Feb 8 2011 - Christophe Dumez - v2.6.6 - FEATURE: IP address reported to trackers is now customizable diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index bc4b63bf2..179445909 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -388,6 +388,9 @@ void QBtSession::configureSession() { #endif sessionSettings.cache_size = pref.diskCacheSize()*64; qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB"; + // Disable OS cache to avoid memory problems (uTorrent behavior) + sessionSettings.disk_io_write_mode = session_settings::disable_os_cache_for_aligned_files; + sessionSettings.disk_io_read_mode = session_settings::disable_os_cache_for_aligned_files; // Queueing System if(pref.isQueueingSystemEnabled()) { sessionSettings.active_downloads = pref.getMaxActiveDownloads(); @@ -2410,11 +2413,6 @@ QString QBtSession::getSavePath(QString hash, bool fromScanDir, QString filePath savePath = defaultSavePath; append_root_folder = true; } - } else { - QIniSettings settings("qBittorrent", "qBittorrent"); - if(!settings.value("ported_to_new_savepath_system", false).toBool()) { - append_root_folder = true; - } } if(!fromScanDir && appendLabelToSavePath) { const QString label = TorrentPersistentData::getLabel(hash); @@ -2425,9 +2423,7 @@ QString QBtSession::getSavePath(QString hash, bool fromScanDir, QString filePath } if(append_root_folder && !root_folder.isEmpty()) { // Append torrent root folder to the save path - if(!savePath.endsWith(QDir::separator())) - savePath += QDir::separator(); - savePath += root_folder; + savePath = QDir(savePath).absoluteFilePath(root_folder); qDebug("Torrent root folder is %s", qPrintable(root_folder)); TorrentPersistentData::saveSavePath(hash, savePath); }