X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsettings.cpp;h=b968406d86532f1f449f98dc5462a7384688f191;hp=0af9c6ec0d3a7938a36903c245d9509c5c6d2a47;hb=79ae829bc853477bbd4869f9335912b1daf32953;hpb=60fc122387a4613da0fa2dca87f9ddde3ea9b8d3 diff --git a/src/client/clientsettings.cpp b/src/client/clientsettings.cpp index 0af9c6ec..b968406d 100644 --- a/src/client/clientsettings.cpp +++ b/src/client/clientsettings.cpp @@ -125,6 +125,7 @@ QVariantMap CoreAccountSettings::retrieveAccountData(AccountId id) { map["ProxyUser"] = oldmap.value("proxyUser"); map["ProxyPassword"] = oldmap.value("proxyPassword"); map["ProxyType"] = oldmap.value("proxyType"); + map["Internal"] = oldmap.value("InternalAccount"); map["AccountId"] = id.toInt(); map["Uuid"] = QUuid::createUuid().toString(); @@ -166,6 +167,24 @@ QHash CoreAccountSettings::jumpKeyMap() { return keyMap; } +void CoreAccountSettings::setBufferViewOverlay(const QSet &viewIds) { + QVariantList variants; + foreach(int viewId, viewIds) { + variants << qVariantFromValue(viewId); + } + setAccountValue("BufferViewOverlay", variants); +} + +QSet CoreAccountSettings::bufferViewOverlay() { + QSet viewIds; + QVariantList variants = accountValue("BufferViewOverlay").toList(); + QVariantList::const_iterator iter = variants.constBegin(); + 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())); } @@ -175,6 +194,48 @@ void CoreAccountSettings::clearAccounts() { removeLocalKey(key); } +/***********************************************************************************************/ +// CoreConnectionSettings: + +CoreConnectionSettings::CoreConnectionSettings() : ClientSettings("CoreConnection") {} + +void CoreConnectionSettings::setNetworkDetectionMode(NetworkDetectionMode mode) { + setLocalValue("NetworkDetectionMode", mode); +} + +CoreConnectionSettings::NetworkDetectionMode CoreConnectionSettings::networkDetectionMode() { +#ifdef HAVE_KDE + NetworkDetectionMode def = UseSolid; +#else + NetworkDetectionMode def = UsePingTimeout; +#endif + return (NetworkDetectionMode)localValue("NetworkDetectionMode", def).toInt(); +} + +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: @@ -220,6 +281,14 @@ 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); }