X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsettings.cpp;h=171d7fe4c8058308d62518e8f0219177b78621c3;hp=4e3fd1628361251987cbae13a7d5ad097ce36d52;hb=3a3e844f9fcfd12235a0086af75ecd503b621ef4;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222 diff --git a/src/client/clientsettings.cpp b/src/client/clientsettings.cpp index 4e3fd162..171d7fe4 100644 --- a/src/client/clientsettings.cpp +++ b/src/client/clientsettings.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -25,6 +25,7 @@ #include #ifdef HAVE_SSL #include +#include #endif #include "client.h" @@ -42,9 +43,9 @@ ClientSettings::~ClientSettings() /***********************************************************************************************/ -CoreAccountSettings::CoreAccountSettings(const QString &subgroup) +CoreAccountSettings::CoreAccountSettings(QString subgroup) : ClientSettings("CoreAccounts"), - _subgroup(subgroup) + _subgroup(std::move(subgroup)) { } @@ -216,7 +217,7 @@ QSet CoreAccountSettings::bufferViewOverlay() { QSet viewIds; QVariantList variants = accountValue("BufferViewOverlay").toList(); - for (QVariantList::const_iterator iter = variants.constBegin(); iter != variants.constEnd(); iter++) { + for (QVariantList::const_iterator iter = variants.constBegin(); iter != variants.constEnd(); ++iter) { viewIds << iter->toInt(); } return viewIds; @@ -249,12 +250,10 @@ void CoreConnectionSettings::setNetworkDetectionMode(NetworkDetectionMode mode) CoreConnectionSettings::NetworkDetectionMode CoreConnectionSettings::networkDetectionMode() { -#ifdef HAVE_KDE - NetworkDetectionMode def = UseSolid; -#else - NetworkDetectionMode def = UsePingTimeout; -#endif - return (NetworkDetectionMode)localValue("NetworkDetectionMode", def).toInt(); + auto mode = localValue("NetworkDetectionMode", UseQNetworkConfigurationManager).toInt(); + if (mode == 0) + mode = UseQNetworkConfigurationManager; // UseSolid is gone, map that to the new default + return static_cast(mode); } @@ -322,7 +321,8 @@ void NotificationSettings::setHighlightNick(NotificationSettings::HighlightNickT NotificationSettings::HighlightNickType NotificationSettings::highlightNick() { - return (NotificationSettings::HighlightNickType)localValue("Highlights/HighlightNick", CurrentNick).toInt(); + return (NotificationSettings::HighlightNickType)localValue("Highlights/HighlightNick", + CurrentNick).toInt(); }