Commit 5f455af2 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6660: use const char * const, not std::string for globally visible constants

parent ce774cc5
......@@ -34,7 +34,7 @@
#include <sstream>
#include "global.h"
#include <cassert>
const char * const Preferences::DFT_ZONE = "North America";
namespace {
......@@ -140,17 +140,12 @@ void Preferences::unserialize (Conf::MappingNode *map)
}
VoipPreference::VoipPreference() : _playDtmf (true)
VoipPreference::VoipPreference() : _playDtmf (true)
, _playTones (true)
, _pulseLength (atoi (DFT_PULSE_LENGTH_STR)) // DFT_PULSE_LENGTH_STR
, _symmetricRtp (true)
, _zidFile (ZRTP_ZIDFILE) // ZRTP_ZID_FILENAME
{
}
VoipPreference::~VoipPreference() {}
{}
void VoipPreference::serialize (Conf::YamlEmitter *emitter)
{
......@@ -196,11 +191,7 @@ AddressbookPreference::AddressbookPreference() : _photo (true)
, _business (true)
, _home (true)
, _mobile (true)
{
}
AddressbookPreference::~AddressbookPreference() {}
{}
void AddressbookPreference::serialize (Conf::YamlEmitter *emitter)
{
......@@ -309,11 +300,7 @@ AudioPreference::AudioPreference() : _cardin (atoi (ALSA_DFT_CARD)) // ALSA_DFT_
, _echocancel(false)
, _echoCancelTailLength(100)
, _echoCancelDelay(0)
{
}
AudioPreference::~AudioPreference() {}
{}
void AudioPreference::serialize (Conf::YamlEmitter *emitter)
{
......@@ -416,20 +403,6 @@ void AudioPreference::unserialize (Conf::MappingNode *map)
}
}
ShortcutPreferences::ShortcutPreferences() : _hangup ("")
, _pickup ("")
, _popup ("")
, _toggleHold ("")
, _togglePickupHangup ("")
{
}
ShortcutPreferences::~ShortcutPreferences() {}
std::map<std::string, std::string> ShortcutPreferences::getShortcuts() const
{
std::map<std::string, std::string> shortcutsMap;
......
......@@ -34,68 +34,68 @@
#include "config/serializable.h"
// general preferences
const std::string orderKey ("order"); // : 1234/2345/
const std::string audioApiKey ("audioApi"); // : 0
const std::string historyLimitKey ("historyLimit"); // : 30
const std::string historyMaxCallsKey ("historyMaxCalls"); // : 20
const std::string notifyMailsKey ("notifyMails"); // : false
const std::string zoneToneChoiceKey ("zoneToneChoice"); // : North America
const std::string registrationExpireKey ("registrationExpire");// : 180
const std::string portNumKey ("portNum"); // : 5060
const std::string searchBarDisplayKey ("searchBarDisplay"); // : true
const std::string zeroConfenableKey ("zeroConfenable"); // : false
const std::string md5HashKey ("md5Hash"); // : false
static const char * const orderKey = "order";
static const char * const audioApiKey = "audioApi";
static const char * const historyLimitKey = "historyLimit";
static const char * const historyMaxCallsKey = "historyMaxCalls";
static const char * const notifyMailsKey = "notifyMails";
static const char * const zoneToneChoiceKey = "zoneToneChoice";
static const char * const registrationExpireKey = "registrationExpire";
static const char * const portNumKey = "portNum";
static const char * const searchBarDisplayKey = "searchBarDisplay";
static const char * const zeroConfenableKey = "zeroConfenable";
static const char * const md5HashKey = "md5Hash";
// voip preferences
const std::string playDtmfKey ("playDtmf"); // true true
const std::string playTonesKey ("playTones"); // true
const std::string pulseLengthKey ("pulseLength"); //=250
const std::string symmetricRtpKey ("symmetric");// =true
const std::string zidFileKey ("zidFile");// =sfl.zid
static const char * const playDtmfKey = "playDtmf";
static const char * const playTonesKey = "playTones";
static const char * const pulseLengthKey = "pulseLength";
static const char * const symmetricRtpKey = "symmetric";
static const char * const zidFileKey = "zidFile";
// addressbook preferences
const std::string photoKey ("photo");// false
const std::string enabledKey ("enabled");// true
const std::string listKey ("list");// 1243608768.30329.0@emilou-desktop/1243456917.15690.23@emilou-desktop/
const std::string maxResultsKey ("maxResults");// 25
const std::string businessKey ("business");// true
const std::string homeKey ("home");// false
const std::string mobileKey ("mobile");// false
static const char * const photoKey = "photo";
static const char * const enabledKey = "enabled";
static const char * const listKey = "list";
static const char * const maxResultsKey = "maxResults";
static const char * const businessKey = "business";
static const char * const homeKey = "home";
static const char * const mobileKey = "mobile";
// hooks preferences
const std::string iax2EnabledKey ("iax2Enabled");// : false
const std::string numberAddPrefixKey ("numberAddPrefix");//: false
const std::string numberEnabledKey ("numberEnabled"); //: false
const std::string sipEnabledKey ("sipEnabled"); //: false
const std::string urlCommandKey ("urlCommand"); //: x-www-browser
const std::string urlSipFieldKey ("urlSipField"); //: X-sflphone-url
static const char * const iax2EnabledKey = "iax2Enabled";
static const char * const numberAddPrefixKey = "numberAddPrefix";
static const char * const numberEnabledKey = "numberEnabled";
static const char * const sipEnabledKey = "sipEnabled";
static const char * const urlCommandKey = "urlCommand";
static const char * const urlSipFieldKey = "urlSipField";
// audio preferences
const std::string alsamapKey ("alsa");
const std::string pulsemapKey ("pulse");
const std::string cardinKey ("cardIn");// : 0
const std::string cardoutKey ("cardOut");// 0
const std::string cardringKey ("cardRing");// : 0
const std::string pluginKey ("plugin"); //: default
const std::string smplrateKey ("smplRate");//: 44100
const std::string devicePlaybackKey ("devicePlayback");//:
const std::string deviceRecordKey ("deviceRecord");// :
const std::string deviceRingtoneKey ("deviceRingtone");// :
const std::string recordpathKey ("recordPath");//: /home/msavard/Bureau
const std::string alwaysRecordingKey("alwaysRecording");
const std::string volumemicKey ("volumeMic");//: 100
const std::string volumespkrKey ("volumeSpkr");//: 100
const std::string noiseReduceKey ("noiseReduce");
const std::string echoCancelKey ("echoCancel");
const std::string echoTailKey ("echoTailLength");
const std::string echoDelayKey ("echoDelayLength");
static const char * const alsamapKey = "alsa";
static const char * const pulsemapKey = "pulse";
static const char * const cardinKey = "cardIn";
static const char * const cardoutKey = "cardOut";
static const char * const cardringKey = "cardRing";
static const char * const pluginKey = "plugin";
static const char * const smplrateKey = "smplRate";
static const char * const devicePlaybackKey = "devicePlayback";
static const char * const deviceRecordKey = "deviceRecord";
static const char * const deviceRingtoneKey = "deviceRingtone";
static const char * const recordpathKey = "recordPath";
static const char * const alwaysRecordingKey = "alwaysRecording";
static const char * const volumemicKey = "volumeMic";
static const char * const volumespkrKey = "volumeSpkr";
static const char * const noiseReduceKey = "noiseReduce";
static const char * const echoCancelKey = "echoCancel";
static const char * const echoTailKey = "echoTailLength";
static const char * const echoDelayKey = "echoDelayLength";
// shortcut preferences
const std::string hangupShortKey ("hangUp");
const std::string pickupShortKey ("pickUp");
const std::string popupShortKey ("popupWindow");
const std::string toggleHoldShortKey ("toggleHold");
const std::string togglePickupHangupShortKey ("togglePickupHangup");
static const char * const hangupShortKey = "hangUp";
static const char * const pickupShortKey = "pickUp";
static const char * const popupShortKey = "popupWindow";
static const char * const toggleHoldShortKey = "toggleHold";
static const char * const togglePickupHangupShortKey = "togglePickupHangup";
class AudioLayer;
......@@ -119,7 +119,7 @@ class Preferences : public Serializable
std::string getAccountOrder (void) const {
return _accountOrder;
}
void setAccountOrder (std::string ord) {
void setAccountOrder (const std::string &ord) {
_accountOrder = ord;
}
......@@ -154,7 +154,7 @@ class Preferences : public Serializable
std::string getZoneToneChoice (void) const {
return _zoneToneChoice;
}
void setZoneToneChoice (std::string str) {
void setZoneToneChoice (const std::string &str) {
_zoneToneChoice = str;
}
......@@ -214,13 +214,9 @@ class Preferences : public Serializable
class VoipPreference : public Serializable
{
public:
VoipPreference();
~VoipPreference();
virtual void serialize (Conf::YamlEmitter *emitter);
virtual void unserialize (Conf::MappingNode *map);
......@@ -256,7 +252,7 @@ class VoipPreference : public Serializable
std::string getZidFile (void) const {
return _zidFile;
}
void setZidFile (std::string file) {
void setZidFile (const std::string &file) {
_zidFile = file;
}
......@@ -272,13 +268,9 @@ class VoipPreference : public Serializable
class AddressbookPreference : public Serializable
{
public:
AddressbookPreference();
~AddressbookPreference();
virtual void serialize (Conf::YamlEmitter *emitter);
virtual void unserialize (Conf::MappingNode *map);
......@@ -300,7 +292,7 @@ class AddressbookPreference : public Serializable
std::string getList (void) const {
return _list;
}
void setList (std::string l) {
void setList (const std::string &l) {
_list = l;
}
......@@ -347,9 +339,7 @@ class AddressbookPreference : public Serializable
class HookPreference : public Serializable
{
public:
HookPreference();
virtual void serialize (Conf::YamlEmitter *emitter);
......@@ -366,7 +356,7 @@ class HookPreference : public Serializable
std::string getNumberAddPrefix (void) const {
return _numberAddPrefix;
}
void setNumberAddPrefix (std::string n) {
void setNumberAddPrefix (const std::string &n) {
_numberAddPrefix = n;
}
......@@ -387,19 +377,18 @@ class HookPreference : public Serializable
std::string getUrlCommand (void) const {
return _urlCommand;
}
void setUrlCommand (std::string u) {
void setUrlCommand (const std::string &u) {
_urlCommand = u;
}
std::string getUrlSipField (void) const {
return _urlSipField;
}
void setUrlSipField (std::string u) {
void setUrlSipField (const std::string &u) {
_urlSipField = u;
}
private:
bool _iax2Enabled;// : false
std::string _numberAddPrefix;//: false
bool _numberEnabled; //: false
......@@ -409,16 +398,10 @@ class HookPreference : public Serializable
};
class AudioPreference : public Serializable
{
public:
AudioPreference();
~AudioPreference();
virtual void serialize (Conf::YamlEmitter *emitter);
virtual void unserialize (Conf::MappingNode *map);
......@@ -448,7 +431,8 @@ class AudioPreference : public Serializable
std::string getPlugin (void) const {
return _plugin;
}
void setPlugin (std::string p) {
void setPlugin (const std::string &p) {
_plugin = p;
}
......@@ -463,6 +447,7 @@ class AudioPreference : public Serializable
std::string getDevicePlayback (void) const {
return _devicePlayback;
}
void setDevicePlayback (const std::string &p) {
_devicePlayback = p;
}
......@@ -477,7 +462,8 @@ class AudioPreference : public Serializable
std::string getDeviceRingtone (void) const {
return _deviceRingtone;
}
void setDeviceRingtone (std::string r) {
void setDeviceRingtone (const std::string &r) {
_deviceRingtone = r;
}
......@@ -569,18 +555,10 @@ class AudioPreference : public Serializable
int _echoCancelDelay;
};
class ShortcutPreferences : public Serializable
{
public:
ShortcutPreferences();
~ShortcutPreferences();
virtual void serialize (Conf::YamlEmitter *emitter);
virtual void unserialize (Conf::MappingNode *map);
void setShortcuts (std::map<std::string, std::string> shortcuts);
......@@ -589,21 +567,21 @@ class ShortcutPreferences : public Serializable
std::string getHangup (void) const {
return _hangup;
}
void setHangup (std::string hangup) {
void setHangup (const std::string &hangup) {
_hangup = hangup;
}
std::string getPickup (void) const {
return _pickup;
}
void setPickup (std::string pickup) {
void setPickup (const std::string &pickup) {
_pickup = pickup;
}
std::string getPopup (void) const {
return _popup;
}
void setPopup (std::string popup) {
void setPopup (const std::string &popup) {
_popup = popup;
}
......@@ -617,12 +595,11 @@ class ShortcutPreferences : public Serializable
std::string getTogglePickupHangup (void) const {
return _togglePickupHangup;
}
void setTogglePickupHangup (std::string toggle) {
void setTogglePickupHangup (const std::string &toggle) {
_togglePickupHangup = toggle;
}
private:
std::string _hangup;
std::string _pickup;
std::string _popup;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment