diff options
author | spiff <spiff@xbmc.org> | 2012-10-18 21:06:28 +0200 |
---|---|---|
committer | spiff <spiff@xbmc.org> | 2012-10-18 21:06:28 +0200 |
commit | 407d46b6b56d1646e85d1c899aa2bd9f2691988c (patch) | |
tree | d15d3a586a8b74f5813d834739a2593af5310182 | |
parent | 7b9cc451d6257a3549d58d9dfdc9f62a1721f87a (diff) |
changed: the package folder max size is now specified in MB
-rw-r--r-- | xbmc/addons/AddonInstaller.cpp | 9 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp index ccdef2b4f9..1f29e3fcf5 100644 --- a/xbmc/addons/AddonInstaller.cpp +++ b/xbmc/addons/AddonInstaller.cpp @@ -388,7 +388,8 @@ void CAddonInstaller::PrunePackageCache() { std::map<CStdString,CFileItemList*> packs; int64_t size = EnumeratePackageFolder(packs); - if (size < g_advancedSettings.m_addonPackageFolderSize) + int64_t limit = g_advancedSettings.m_addonPackageFolderSize*1024*1024; + if (size < limit) return; // Prune packages @@ -403,13 +404,13 @@ void CAddonInstaller::PrunePackageCache() } items.Sort(SORT_METHOD_SIZE,SortOrderDescending); int i=0; - while (size > g_advancedSettings.m_addonPackageFolderSize && i < items.Size()) + while (size > limit && i < items.Size()) { size -= items[i]->m_dwSize; CFileUtils::DeleteItem(items[i++],true); } - if (size > g_advancedSettings.m_addonPackageFolderSize) + if (size > limit) { // 2. Remove the oldest packages (leaving least 1 for each add-on) items.Clear(); @@ -421,7 +422,7 @@ void CAddonInstaller::PrunePackageCache() } items.Sort(SORT_METHOD_DATE,SortOrderAscending); i=0; - while (size > g_advancedSettings.m_addonPackageFolderSize && i < items.Size()) + while (size > limit && i < items.Size()) { size -= items[i]->m_dwSize; CFileUtils::DeleteItem(items[i++],true); diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 1d2202b020..fb2e64d82c 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -298,7 +298,7 @@ void CAdvancedSettings::Initialize() m_measureRefreshrate = false; m_cacheMemBufferSize = 1024 * 1024 * 20; - m_addonPackageFolderSize = 200*1024*1024; + m_addonPackageFolderSize = 200; m_jsonOutputCompact = true; m_jsonTcpPort = 9090; |