/* # Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING # # If you have any feedback please consult http://openslx.org/feedback and # send your suggestions, praise, or complaints to feedback@openslx.org # # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # src/net/mcast/McastConfiguration.cpp # - hold Multicast protocol configuration data # ----------------------------------------------------------------------------- */ #include #include "McastConfiguration.h" void McastConfiguration::loadFrom(QSettings* _settings, char const* group) { if (group) _settings->beginGroup(group); _multicastAddress = _settings->value("groupAddress", DEFAULT_MULTICAST_ADDRESS).toString(); _multicastInterface = _settings->value("interface", DEFAULT_MULTICAST_INTERFACE).toString(); _multicastMTU = _settings->value("mtu", DEFAULT_MULTICAST_MTU).value(); _multicastRate = _settings->value("rate", DEFAULT_MULTICAST_RATE).value(); _multicastUseUDP = _settings->value("use-udp", DEFAULT_MULTICAST_USEUDP).toBool(); _multicastWinSize = _settings->value("winsize", DEFAULT_MULTICAST_WSIZ).value(); _multicastUDPPortBase = _settings->value("portbase", DEFAULT_MULTICAST_UDPPORT).value(); _multicastDPort = _settings->value("dport", DEFAULT_MULTICAST_DPORT).value(); _multicastSPort = _settings->value("sport", DEFAULT_MULTICAST_SPORT).value(); if (group) _settings->endGroup(); } void McastConfiguration::writeTo(QSettings* _settings, char const* group) const { if (group) _settings->beginGroup(group); _settings->setValue("groupAddress", _multicastAddress); _settings->setValue("interface", _multicastInterface); _settings->setValue("mtu", _multicastMTU); _settings->setValue("rate", _multicastRate); _settings->setValue("use-udp", _multicastUseUDP); _settings->setValue("winsize", _multicastWinSize); _settings->setValue("portbase", _multicastUDPPortBase); _settings->setValue("dport", _multicastDPort); _settings->setValue("sport", _multicastSPort); if (group) _settings->endGroup(); }