Added spaces in ternary expressions and between operators and operands.

git-svn-id: http://voip.null.ro/svn/yate@2212 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-09-18 14:41:30 +00:00
parent e3c8137dbf
commit c767e22620
4 changed files with 44 additions and 44 deletions

View File

@ -1622,7 +1622,7 @@ void QtWindow::doInit()
// Decode param // Decode param
int pos = p->toString().find('='); int pos = p->toString().find('=');
if (pos != -1) if (pos != -1)
params.addParam(p->toString().substr(0,pos),p->toString().substr(pos+1)); params.addParam(p->toString().substr(0,pos),p->toString().substr(pos + 1));
} }
} }
TelEngine::destruct(list); TelEngine::destruct(list);
@ -1907,13 +1907,13 @@ bool QtClient::chooseFile(Window* parent, const NamedList& params,
QWidget* p = static_cast<QtWindow*>(parent); QWidget* p = static_cast<QtWindow*>(parent);
if (files) { if (files) {
QStringList list = QFileDialog::getOpenFileNames((QWidget*)p,QtClient::setUtf8(caption), QStringList list = QFileDialog::getOpenFileNames((QWidget*)p,QtClient::setUtf8(caption),
QtClient::setUtf8(dir),filters?*filters:QString::null,sFilter,options); QtClient::setUtf8(dir),filters ? *filters : QString::null,sFilter,options);
for (int i = 0; i < list.size(); i++) for (int i = 0; i < list.size(); i++)
QtClient::getUtf8(*files,"file",list[i]); QtClient::getUtf8(*files,"file",list[i]);
} }
else { else {
QString str = QFileDialog::getOpenFileName((QWidget*)p,QtClient::setUtf8(caption), QString str = QFileDialog::getOpenFileName((QWidget*)p,QtClient::setUtf8(caption),
QtClient::setUtf8(dir),filters?*filters:QString::null,sFilter,options); QtClient::setUtf8(dir),filters ? *filters : QString::null,sFilter,options);
QtClient::getUtf8(*file,str); QtClient::getUtf8(*file,str);
} }
@ -2025,11 +2025,11 @@ bool QtClient::property(bool set, QObject* obj, const char* name, String& value)
} }
if (ok) if (ok)
DDebug(ClientDriver::self(),DebugAll,"%s %s=%s for object '%s'", DDebug(ClientDriver::self(),DebugAll,"%s %s=%s for object '%s'",
set?"Set":"Got",name,value.c_str(),YQT_OBJECT_NAME(obj)); set ? "Set" : "Got",name,value.c_str(),YQT_OBJECT_NAME(obj));
else else
DDebug(ClientDriver::self(),DebugNote, DDebug(ClientDriver::self(),DebugNote,
"Failed to %s %s=%s (type=%s) for object '%s': %s", "Failed to %s %s=%s (type=%s) for object '%s': %s",
set?"set":"get",name,value.c_str(),var.typeName(), set ? "set" : "get",name,value.c_str(),var.typeName(),
YQT_OBJECT_NAME(obj),err); YQT_OBJECT_NAME(obj),err);
return ok; return ok;
} }

View File

@ -230,7 +230,7 @@ inline bool callLogicAction(ClientLogic* logic, Window* wnd, const String& name,
return false; return false;
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Logic(%s) action='%s' in window (%p,%s) [%p]", "Logic(%s) action='%s' in window (%p,%s) [%p]",
logic->toString().c_str(),name.c_str(),wnd,wnd?wnd->id().c_str():"",logic); logic->toString().c_str(),name.c_str(),wnd,wnd ? wnd->id().c_str() : "",logic);
return logic->action(wnd,name,params); return logic->action(wnd,name,params);
} }
@ -243,7 +243,7 @@ inline bool callLogicToggle(ClientLogic* logic, Window* wnd, const String& name,
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Logic(%s) toggle='%s' active=%s in window (%p,%s) [%p]", "Logic(%s) toggle='%s' active=%s in window (%p,%s) [%p]",
logic->toString().c_str(),name.c_str(),String::boolText(active), logic->toString().c_str(),name.c_str(),String::boolText(active),
wnd,wnd?wnd->id().c_str():"",logic); wnd,wnd ? wnd->id().c_str() : "",logic);
return logic->toggle(wnd,name,active); return logic->toggle(wnd,name,active);
} }
@ -257,7 +257,7 @@ inline bool callLogicSelect(ClientLogic* logic, Window* wnd, const String& name,
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Logic(%s) select='%s' item='%s' in window (%p,%s) [%p]", "Logic(%s) select='%s' item='%s' in window (%p,%s) [%p]",
logic->toString().c_str(),name.c_str(),item.c_str(), logic->toString().c_str(),name.c_str(),item.c_str(),
wnd,wnd?wnd->id().c_str():"",logic); wnd,wnd ? wnd->id().c_str() : "",logic);
return logic->select(wnd,name,item,text); return logic->select(wnd,name,item,text);
} }
@ -369,7 +369,7 @@ bool Window::setParams(const NamedList& params)
// Set property: object_name:property_name=value // Set property: object_name:property_name=value
int pos = n.find(':'); int pos = n.find(':');
if (pos > 0) if (pos > 0)
ok = setProperty(n.substr(0,pos),n.substr(pos+1),*s) && ok; ok = setProperty(n.substr(0,pos),n.substr(pos + 1),*s) && ok;
else else
ok = false; ok = false;
} }
@ -647,7 +647,7 @@ void ClientThreadProxy::process()
m_rval = client->clearTable(m_name); m_rval = client->clearTable(m_name);
break; break;
case getText: case getText:
m_rval = client->getText(m_name,*m_rtext,m_rbool?*m_rbool:false,m_wnd,m_skip); m_rval = client->getText(m_name,*m_rtext,m_rbool ? *m_rbool : false,m_wnd,m_skip);
break; break;
case getCheck: case getCheck:
m_rval = client->getCheck(m_name,*m_rbool,m_wnd,m_skip); m_rval = client->getCheck(m_name,*m_rbool,m_wnd,m_skip);
@ -1693,7 +1693,7 @@ bool Client::action(Window* wnd, const String& name, NamedList* params)
static String sect = "action"; static String sect = "action";
XDebug(ClientDriver::self(),DebugAll,"Action '%s' in window (%p,%s)", XDebug(ClientDriver::self(),DebugAll,"Action '%s' in window (%p,%s)",
name.c_str(),wnd,wnd?wnd->id().c_str():""); name.c_str(),wnd,wnd ? wnd->id().c_str() : "");
String substitute = name; String substitute = name;
String handle; String handle;
@ -1725,7 +1725,7 @@ bool Client::toggle(Window* wnd, const String& name, bool active)
XDebug(ClientDriver::self(),DebugAll, XDebug(ClientDriver::self(),DebugAll,
"Toggle name='%s' active='%s' in window (%p,%s)", "Toggle name='%s' active='%s' in window (%p,%s)",
name.c_str(),String::boolText(active),wnd,wnd?wnd->id().c_str():""); name.c_str(),String::boolText(active),wnd,wnd ? wnd->id().c_str() : "");
String substitute = name; String substitute = name;
String handle; String handle;
@ -1759,7 +1759,7 @@ bool Client::select(Window* wnd, const String& name, const String& item, const S
XDebug(ClientDriver::self(),DebugAll, XDebug(ClientDriver::self(),DebugAll,
"Select name='%s' item='%s' in window (%p,%s)", "Select name='%s' item='%s' in window (%p,%s)",
name.c_str(),item.c_str(),wnd,wnd?wnd->id().c_str():""); name.c_str(),item.c_str(),wnd,wnd ? wnd->id().c_str() : "");
String substitute = name; String substitute = name;
String handle; String handle;
@ -2142,9 +2142,9 @@ bool Client::addLogic(ClientLogic* logic)
return false; return false;
bool dup = (0 != s_logics.find(logic->toString())); bool dup = (0 != s_logics.find(logic->toString()));
Debug(ClientDriver::self(),dup?DebugGoOn:DebugInfo, Debug(ClientDriver::self(),dup ? DebugGoOn : DebugInfo,
"Adding logic%s %p name=%s prio=%d", "Adding logic%s %p name=%s prio=%d",
dup?" [DUPLICATE]":"",logic,logic->toString().c_str(),logic->priority()); dup ? " [DUPLICATE]" : "",logic,logic->toString().c_str(),logic->priority());
for (ObjList* l = s_logics.skipNull(); l; l = l->skipNext()) { for (ObjList* l = s_logics.skipNull(); l; l = l->skipNext()) {
ClientLogic* obj = static_cast<ClientLogic*>(l->get()); ClientLogic* obj = static_cast<ClientLogic*>(l->get());
@ -2410,7 +2410,7 @@ void ClientChannel::setConference(const String& target)
if (m_transferId == target && !m_transferId) if (m_transferId == target && !m_transferId)
return; return;
Debug(this,DebugCall,"%sing conference room '%s' [%p]", Debug(this,DebugCall,"%sing conference room '%s' [%p]",
target?"Enter":"Exit",target?target.c_str():m_transferId.c_str(),this); target ? "Enter" : "Exit",target ? target.c_str() : m_transferId.c_str(),this);
m_transferId = target; m_transferId = target;
m_conference = (0 != m_transferId); m_conference = (0 != m_transferId);
setMedia(m_active && isAnswered()); setMedia(m_active && isAnswered());
@ -3195,7 +3195,7 @@ bool ClientContact::appendGroup(const String& group)
m_groups.append(new String(group)); m_groups.append(new String(group));
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Account(%s) contact='%s' added group '%s' [%p]", "Account(%s) contact='%s' added group '%s' [%p]",
m_owner?m_owner->uri().c_str():"",m_uri.c_str(),group.c_str(),this); m_owner ? m_owner->uri().c_str() : "",m_uri.c_str(),group.c_str(),this);
return true; return true;
} }
@ -3209,7 +3209,7 @@ bool ClientContact::removeGroup(const String& group)
obj->remove(); obj->remove();
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Account(%s) contact='%s' removed group '%s' [%p]", "Account(%s) contact='%s' removed group '%s' [%p]",
m_owner?m_owner->uri().c_str():"",m_uri.c_str(),group.c_str(),this); m_owner ? m_owner->uri().c_str() : "",m_uri.c_str(),group.c_str(),this);
return true; return true;
} }
@ -3248,7 +3248,7 @@ ClientResource* ClientContact::appendResource(const String& id)
m_resources.append(r); m_resources.append(r);
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Account(%s) contact='%s' added resource '%s' [%p]", "Account(%s) contact='%s' added resource '%s' [%p]",
m_owner?m_owner->uri().c_str():"",m_uri.c_str(),id.c_str(),this); m_owner ? m_owner->uri().c_str() : "",m_uri.c_str(),id.c_str(),this);
return r; return r;
} }
@ -3262,7 +3262,7 @@ bool ClientContact::removeResource(const String& id)
obj->remove(); obj->remove();
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Account(%s) contact='%s' removed resource '%s' [%p]", "Account(%s) contact='%s' removed resource '%s' [%p]",
m_owner?m_owner->uri().c_str():"",m_uri.c_str(),id.c_str(),this); m_owner ? m_owner->uri().c_str() : "",m_uri.c_str(),id.c_str(),this);
return true; return true;
} }

View File

@ -70,7 +70,7 @@ static inline void setAccParam(NamedList& params, const String& prefix,
const String& param, const char* defVal) const String& param, const char* defVal)
{ {
NamedString* ns = params.getParam("acc_" + param); NamedString* ns = params.getParam("acc_" + param);
params.setParam(prefix + "_" + param,ns?ns->c_str():defVal); params.setParam(prefix + "_" + param,ns ? ns->c_str() : defVal);
} }
// Set the image parameter of a list // Set the image parameter of a list
@ -98,8 +98,8 @@ static void updateProtocolSpec(NamedList& p, const String& proto, const String&
ObjList* obj = options.split(',',false); ObjList* obj = options.split(',',false);
String prefix = "acc_proto_" + proto; String prefix = "acc_proto_" + proto;
// Texts // Texts
setAccParam(p,prefix,"resource",proto=="jabber"?"yate":""); setAccParam(p,prefix,"resource",proto == "jabber" ? "yate" : "");
setAccParam(p,prefix,"port",proto=="jabber"?"5222":""); setAccParam(p,prefix,"port",proto == "jabber" ? "5222" : "");
setAccParam(p,prefix,"address",""); setAccParam(p,prefix,"address","");
// Options // Options
prefix << "_opt_"; prefix << "_opt_";
@ -368,7 +368,7 @@ bool ClientLogic::action(Window* wnd, const String& name, NamedList* params)
if (callOut || name == "log_in_call") { if (callOut || name == "log_in_call") {
String billid; String billid;
if (Client::self() && if (Client::self() &&
Client::self()->getSelect(callOut?s_logOutgoing:s_logIncoming,billid) && Client::self()->getSelect(callOut ? s_logOutgoing : s_logIncoming,billid) &&
billid) billid)
return callLogCall(billid); return callLogCall(billid);
return false; return false;
@ -378,7 +378,7 @@ bool ClientLogic::action(Window* wnd, const String& name, NamedList* params)
if (callOut || name == "log_in_contact") { if (callOut || name == "log_in_contact") {
String billid; String billid;
if (Client::self() && if (Client::self() &&
Client::self()->getSelect(callOut?s_logOutgoing:s_logIncoming,billid) && Client::self()->getSelect(callOut ? s_logOutgoing : s_logIncoming,billid) &&
billid) billid)
return callLogCreateContact(billid); return callLogCreateContact(billid);
return false; return false;
@ -405,7 +405,7 @@ bool ClientLogic::toggle(Window* wnd, const String& name, bool active)
Debug(ClientDriver::self(),DebugAll, Debug(ClientDriver::self(),DebugAll,
"Logic(%s) toggle '%s'=%s in window (%p,%s)", "Logic(%s) toggle '%s'=%s in window (%p,%s)",
m_name.c_str(),name.c_str(),String::boolText(active), m_name.c_str(),name.c_str(),String::boolText(active),
wnd,wnd?wnd->id().c_str():""); wnd,wnd ? wnd->id().c_str() : "");
// Check for window params // Check for window params
if (Client::self() && Window::isValidParamPrefix(name)) { if (Client::self() && Window::isValidParamPrefix(name)) {
@ -495,7 +495,7 @@ bool ClientLogic::toggle(Window* wnd, const String& name, bool active)
return true; return true;
int pos = tmp.find(':'); int pos = tmp.find(':');
if (pos > 0 && Client::self()) if (pos > 0 && Client::self())
return Client::self()->setSelect(tmp.substr(0,pos),tmp.substr(pos+1),wnd); return Client::self()->setSelect(tmp.substr(0,pos),tmp.substr(pos + 1),wnd);
return true; return true;
} }
@ -561,7 +561,7 @@ bool ClientLogic::select(Window* wnd, const String& name, const String& item,
{ {
DDebug(ClientDriver::self(),DebugAll, DDebug(ClientDriver::self(),DebugAll,
"Logic(%s) select name='%s' item='%s' in window (%p,%s)", "Logic(%s) select name='%s' item='%s' in window (%p,%s)",
m_name.c_str(),name.c_str(),item.c_str(),wnd,wnd?wnd->id().c_str():""); m_name.c_str(),name.c_str(),item.c_str(),wnd,wnd ? wnd->id().c_str() : "");
if (name == s_accountList) { if (name == s_accountList) {
if (!Client::self()) if (!Client::self())
@ -648,12 +648,12 @@ bool ClientLogic::select(Window* wnd, const String& name, const String& item,
return false; return false;
NamedList p(""); NamedList p("");
for (const char** par = Client::s_provParams; *par; par++) for (const char** par = Client::s_provParams; *par; par++)
p.addParam(String("acc_")+*par,sect->getValue(*par)); p.addParam(String("acc_") + *par,sect->getValue(*par));
NamedString* proto = sect->getParam("protocol"); NamedString* proto = sect->getParam("protocol");
if (proto) { if (proto) {
selectProtocolSpec(p,*proto,m_accShowAdvanced); selectProtocolSpec(p,*proto,m_accShowAdvanced);
NamedString* opt = sect->getParam("options"); NamedString* opt = sect->getParam("options");
updateProtocolSpec(p,*proto,opt?*opt:String::empty()); updateProtocolSpec(p,*proto,opt ? *opt : String::empty());
} }
Client::self()->setParams(&p,wnd); Client::self()->setParams(&p,wnd);
return true; return true;
@ -847,7 +847,7 @@ bool ClientLogic::editAccount(bool newAcc, NamedList* params, Window* wnd)
if (newAcc) { if (newAcc) {
proto = "--"; proto = "--";
for (const String* par = s_accParams; !par->null(); par++) for (const String* par = s_accParams; !par->null(); par++)
params->setParam("acc_"+*par,""); params->setParam("acc_" + *par,"");
} }
else { else {
if (!Client::self()) if (!Client::self())
@ -869,7 +869,7 @@ bool ClientLogic::editAccount(bool newAcc, NamedList* params, Window* wnd)
selectProtocolSpec(*params,proto,m_accShowAdvanced); selectProtocolSpec(*params,proto,m_accShowAdvanced);
NamedString* tmp = params->getParam("acc_options"); NamedString* tmp = params->getParam("acc_options");
for (int i = 0; i < Client::OtherProtocol; i++) for (int i = 0; i < Client::OtherProtocol; i++)
updateProtocolSpec(*params,Client::s_protocols[i],tmp?*tmp:String::empty()); updateProtocolSpec(*params,Client::s_protocols[i],tmp ? *tmp : String::empty());
params->setParam("context",acc); params->setParam("context",acc);
params->setParam("acc_account",acc); params->setParam("acc_account",acc);
params->setParam("modal",String::boolText(true)); params->setParam("modal",String::boolText(true));
@ -881,7 +881,7 @@ static inline void saveAccParam(NamedList& params,
const String& prefix, const String& param, Window* wnd) const String& prefix, const String& param, Window* wnd)
{ {
String val; String val;
if (!Client::self()->getText(prefix+param,val,false,wnd)) if (!Client::self()->getText(prefix + param,val,false,wnd))
return; return;
if (val) if (val)
params.setParam(param,val); params.setParam(param,val);
@ -949,7 +949,7 @@ bool ClientLogic::acceptAccount(NamedList* params, Window* wnd)
for (ObjList* o = Client::s_accOptions.skipNull(); o; o = o->skipNext()) { for (ObjList* o = Client::s_accOptions.skipNull(); o; o = o->skipNext()) {
String* opt = static_cast<String*>(o->get()); String* opt = static_cast<String*>(o->get());
bool checked = false; bool checked = false;
Client::self()->getCheck(prefix+*opt,checked,wnd); Client::self()->getCheck(prefix + *opt,checked,wnd);
if (checked) if (checked)
options.append(*opt,","); options.append(*opt,",");
} }
@ -1115,8 +1115,8 @@ bool ClientLogic::editContact(bool newCont, NamedList* params, Window* wnd)
// Make sure we reset all controls in window // Make sure we reset all controls in window
NamedList p(""); NamedList p("");
if (newCont) { if (newCont) {
p.addParam("abk_name",params?params->c_str():""); p.addParam("abk_name",params ? params->c_str() : "");
p.addParam("abk_target",params?params->getValue("target"):""); p.addParam("abk_target",params ? params->getValue("target") : "");
} }
else { else {
if (!Client::self()) if (!Client::self())
@ -1365,8 +1365,8 @@ bool ClientLogic::callLogCreateContact(const String& billid)
return false; return false;
NamedString* called = getCdrCalled(*sect,*direction); NamedString* called = getCdrCalled(*sect,*direction);
NamedList p(""); NamedList p("");
p.setParam("abk_name",called?called->c_str():""); p.setParam("abk_name",called ? called->c_str() : "");
p.setParam("abk_target",called?called->c_str():""); p.setParam("abk_target",called ? called->c_str() : "");
p.setParam("modal",String::boolText(true)); p.setParam("modal",String::boolText(true));
return Client::openPopup("addrbook",&p); return Client::openPopup("addrbook",&p);
} }
@ -1815,7 +1815,7 @@ bool ClientLogic::handleClientChanUpdate(Message& msg, bool& stopLogic)
updateFormats = false; updateFormats = false;
buildStatus(status,"Call active",CHANUPD_ADDR,CHANUPD_ID); buildStatus(status,"Call active",CHANUPD_ADDR,CHANUPD_ID);
Client::self()->setSelect(s_channelList,CHANUPD_ID); Client::self()->setSelect(s_channelList,CHANUPD_ID);
setImageParam(p,"party",outgoing?"down_active.png":"up_active.png"); setImageParam(p,"party",outgoing ? "down_active.png" : "up_active.png");
if (outgoing) { if (outgoing) {
if (noticed) if (noticed)
Client::self()->ringer(true,false); Client::self()->ringer(true,false);
@ -1829,7 +1829,7 @@ bool ClientLogic::handleClientChanUpdate(Message& msg, bool& stopLogic)
case ClientChannel::OnHold: case ClientChannel::OnHold:
enableActions = true; enableActions = true;
buildStatus(status,"Call on hold",CHANUPD_ADDR,CHANUPD_ID); buildStatus(status,"Call on hold",CHANUPD_ADDR,CHANUPD_ID);
setImageParam(p,"party",outgoing?"down.png":"up.png"); setImageParam(p,"party",outgoing ? "down.png" : "up.png");
if (outgoing) { if (outgoing) {
if (noticed) if (noticed)
Client::self()->ringer(true,false); Client::self()->ringer(true,false);
@ -1864,8 +1864,8 @@ bool ClientLogic::handleClientChanUpdate(Message& msg, bool& stopLogic)
} }
else else
return false; return false;
setImageParam(p,"party",chan?chan->party():"",outgoing?"down.png":"up.png"); setImageParam(p,"party",chan ? chan->party() : "",outgoing ? "down.png" : "up.png");
setImageParam(p,"time","",outgoing?"chan_ringing.png":"chan_idle.png"); setImageParam(p,"time","",outgoing ? "chan_ringing.png" : "chan_idle.png");
// Start incoming ringer if there is no active channel // Start incoming ringer if there is no active channel
if (outgoing && notConf) { if (outgoing && notConf) {
ClientChannel* ch = ClientDriver::findActiveChan(); ClientChannel* ch = ClientDriver::findActiveChan();
@ -1926,7 +1926,7 @@ bool ClientLogic::handleClientChanUpdate(Message& msg, bool& stopLogic)
if (chan && chan->transferId() && notConf) { if (chan && chan->transferId() && notConf) {
setStatus = false; setStatus = false;
ClientChannel* trans = ClientDriver::findChan(chan->transferId()); ClientChannel* trans = ClientDriver::findChan(chan->transferId());
setImageParam(p,"status",trans?trans->party():"","transfer.png"); setImageParam(p,"status",trans ? trans->party() : "","transfer.png");
TelEngine::destruct(trans); TelEngine::destruct(trans);
buildStatus(status,"Call transferred",CHANUPD_ADDR,CHANUPD_ID); buildStatus(status,"Call transferred",CHANUPD_ADDR,CHANUPD_ID);
} }

View File

@ -2444,7 +2444,7 @@ public:
* @param dest Destination string * @param dest Destination string
*/ */
inline void buildContactId(String& dest) inline void buildContactId(String& dest)
{ buildContactId(dest,m_owner?m_owner->toString():String::empty(),m_id); } { buildContactId(dest,m_owner ? m_owner->toString() : String::empty(),m_id); }
/** /**
* Check if a window is this contact's chat * Check if a window is this contact's chat