refs #297, #50 Added network setting for FSD wire text codec.

This commit is contained in:
Mathew Sutcliffe
2015-07-01 00:06:21 +01:00
parent eb594e5397
commit 6688a87ece
3 changed files with 19 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
#include "blackcore/settingscache.h"
#include "blackmisc/network/serverlist.h"
#include <QTextCodec>
namespace BlackCore
{
@@ -21,6 +22,19 @@ namespace BlackCore
{
namespace Network
{
//! Name of text codec to use with text in FSD protocol
struct WireTextCodec : public CSettingTrait<QString>
{
//! \copydoc BlackCore::CSetting::key
static const char *key() { return "network/wiretextcodec"; }
//! \copydoc BlackCore::CSetting::defaultValue
static const QString &defaultValue() { static const QString dv("latin1"); return dv; }
//! \copydoc BlackCore::CSetting::isValid
static bool isValid(const QString &value) { return QTextCodec::codecForName(qPrintable(value)); }
};
//! Virtual air traffic servers
struct TrafficServers : public CSettingTrait<BlackMisc::Network::CServerList>
{