From fe37b48dffd8edcd6e30f4e304d3e27a731ac8ae Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 29 Jun 2013 18:04:10 +0200 Subject: - caching of downloadwidgets to fix performance problem, currently broken and disabled - added new state for downloads "uninstalled" for mods that were at one point installed and then removed - user-configured server preference is now used - updated tutorial to account for removal of integrated browser - reverted to qt 4 - using performance optimised findfirstfile on win vista and up - bugfix: it was possible to disable all columns of the mod list - bugfix: hook.dll doesn't load on win xp --- src/settings.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 991f1f59..2bfdc0a6 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -153,6 +153,23 @@ QString Settings::getDownloadDirectory() const return QDir::toNativeSeparators(m_Settings.value("Settings/download_directory", ToQString(GameInfo::instance().getDownloadDir())).toString()); } +std::map Settings::getPreferredServers() +{ + std::map result; + m_Settings.beginGroup("Servers"); + + foreach (const QString &serverKey, m_Settings.childKeys()) { + QVariantMap data = m_Settings.value(serverKey).toMap(); + int preference = data["preferred"].toInt(); + if (preference > 0) { + result[serverKey] = preference; + } + } + m_Settings.endGroup(); + + return result; +} + QString Settings::getCacheDirectory() const { return QDir::toNativeSeparators(m_Settings.value("Settings/cache_directory", ToQString(GameInfo::instance().getCacheDir())).toString()); -- cgit v1.3.1