+QHash<int, BufferId> CoreAccountSettings::jumpKeyMap()
+{
+ QHash<int, BufferId> keyMap;
+ QVariantMap variants = accountValue("JumpKeyMap", QVariant()).toMap();
+ QVariantMap::const_iterator mapIter = variants.constBegin();
+ while (mapIter != variants.constEnd()) {
+ keyMap[mapIter.key().toInt()] = mapIter.value().value<BufferId>();
+ ++mapIter;
+ }
+ return keyMap;
+}
+
+
+void CoreAccountSettings::setBufferViewOverlay(const QSet<int> &viewIds)
+{
+ QVariantList variants;
+ foreach(int viewId, viewIds) {
+ variants << qVariantFromValue(viewId);
+ }
+ setAccountValue("BufferViewOverlay", variants);
+}
+
+
+QSet<int> CoreAccountSettings::bufferViewOverlay()
+{
+ QSet<int> viewIds;
+ QVariantList variants = accountValue("BufferViewOverlay").toList();
+ for (QVariantList::const_iterator iter = variants.constBegin(); iter != variants.constEnd(); ++iter) {
+ viewIds << iter->toInt();
+ }
+ return viewIds;
+}
+
+
+void CoreAccountSettings::removeAccount(AccountId id)
+{
+ removeLocalKey(QString("%1").arg(id.toInt()));
+}
+
+
+void CoreAccountSettings::clearAccounts()
+{
+ foreach(const QString &key, localChildGroups())
+ removeLocalKey(key);
+}
+
+
+/***********************************************************************************************/
+// CoreConnectionSettings:
+
+CoreConnectionSettings::CoreConnectionSettings() : ClientSettings("CoreConnection") {}
+
+void CoreConnectionSettings::setNetworkDetectionMode(NetworkDetectionMode mode)
+{
+ setLocalValue("NetworkDetectionMode", mode);
+}
+
+
+CoreConnectionSettings::NetworkDetectionMode CoreConnectionSettings::networkDetectionMode()
+{
+ auto mode = localValue("NetworkDetectionMode", UseQNetworkConfigurationManager).toInt();
+ if (mode == 0)
+ mode = UseQNetworkConfigurationManager; // UseSolid is gone, map that to the new default
+ return static_cast<NetworkDetectionMode>(mode);
+}
+
+
+void CoreConnectionSettings::setAutoReconnect(bool autoReconnect)
+{
+ setLocalValue("AutoReconnect", autoReconnect);
+}
+
+
+bool CoreConnectionSettings::autoReconnect()
+{
+ return localValue("AutoReconnect", true).toBool();
+}
+
+
+void CoreConnectionSettings::setPingTimeoutInterval(int interval)
+{
+ setLocalValue("PingTimeoutInterval", interval);
+}
+
+
+int CoreConnectionSettings::pingTimeoutInterval()
+{
+ return localValue("PingTimeoutInterval", 60).toInt();
+}
+
+
+void CoreConnectionSettings::setReconnectInterval(int interval)
+{
+ setLocalValue("ReconnectInterval", interval);
+}
+
+
+int CoreConnectionSettings::reconnectInterval()
+{
+ return localValue("ReconnectInterval", 60).toInt();
+}
+
+
+/***********************************************************************************************/
+// NotificationSettings:
+
+NotificationSettings::NotificationSettings() : ClientSettings("Notification")
+{
+}
+
+
+void NotificationSettings::setHighlightList(const QVariantList &highlightList)
+{
+ setLocalValue("Highlights/CustomList", highlightList);
+}
+
+
+QVariantList NotificationSettings::highlightList()
+{
+ return localValue("Highlights/CustomList").toList();
+}
+
+
+void NotificationSettings::setHighlightNick(NotificationSettings::HighlightNickType highlightNickType)
+{
+ setLocalValue("Highlights/HighlightNick", highlightNickType);
+}
+
+
+NotificationSettings::HighlightNickType NotificationSettings::highlightNick()
+{
+ return (NotificationSettings::HighlightNickType)localValue("Highlights/HighlightNick",
+ CurrentNick).toInt();
+}
+
+
+void NotificationSettings::setNicksCaseSensitive(bool cs)
+{
+ setLocalValue("Highlights/NicksCaseSensitive", cs);
+}
+
+
+bool NotificationSettings::nicksCaseSensitive()
+{
+ return localValue("Highlights/NicksCaseSensitive", false).toBool();
+}
+
+
+// ========================================
+// TabCompletionSettings
+// ========================================
+
+TabCompletionSettings::TabCompletionSettings() : ClientSettings("TabCompletion")
+{
+}
+
+
+void TabCompletionSettings::setCompletionSuffix(const QString &suffix)
+{
+ setLocalValue("CompletionSuffix", suffix);
+}
+
+
+QString TabCompletionSettings::completionSuffix()
+{
+ return localValue("CompletionSuffix", ": ").toString();
+}
+
+
+void TabCompletionSettings::setAddSpaceMidSentence(bool space)
+{
+ setLocalValue("AddSpaceMidSentence", space);
+}
+
+
+bool TabCompletionSettings::addSpaceMidSentence()
+{
+ return localValue("AddSpaceMidSentence", false).toBool();
+}
+
+
+void TabCompletionSettings::setSortMode(SortMode mode)
+{
+ setLocalValue("SortMode", mode);
+}
+
+
+TabCompletionSettings::SortMode TabCompletionSettings::sortMode()
+{
+ return static_cast<SortMode>(localValue("SortMode"), LastActivity);
+}
+
+
+void TabCompletionSettings::setCaseSensitivity(Qt::CaseSensitivity cs)
+{
+ setLocalValue("CaseSensitivity", cs);
+}
+
+
+Qt::CaseSensitivity TabCompletionSettings::caseSensitivity()
+{
+ return (Qt::CaseSensitivity)localValue("CaseSensitivity", Qt::CaseInsensitive).toInt();
+}
+
+
+void TabCompletionSettings::setUseLastSpokenTo(bool use)
+{
+ setLocalValue("UseLastSpokenTo", use);
+}
+
+
+bool TabCompletionSettings::useLastSpokenTo()
+{
+ return localValue("UseLastSpokenTo", false).toBool();
+}
+
+
+// ========================================
+// ItemViewSettings
+// ========================================
+
+ItemViewSettings::ItemViewSettings(const QString &group) : ClientSettings(group)
+{
+}
+
+
+bool ItemViewSettings::displayTopicInTooltip()
+{
+ return localValue("DisplayTopicInTooltip", false).toBool();
+}
+
+
+bool ItemViewSettings::mouseWheelChangesBuffer()
+{
+ return localValue("MouseWheelChangesBuffer", false).toBool();
+}