mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-29 16:53:53 +01:00
2018-07-16 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL quieries in 'rdadmin/' ensure UTF-8 compatibility.
This commit is contained in:
@@ -400,11 +400,13 @@ EditNowNext::EditNowNext(RDAirPlayConf *conf,QWidget *parent)
|
||||
setText(QString().sprintf("%06u",nownext_conf->logNextCart(i)));
|
||||
}
|
||||
}
|
||||
sql=QString().sprintf("select ID,PLUGIN_PATH,PLUGIN_ARG \
|
||||
from NOWNEXT_PLUGINS \
|
||||
where (STATION_NAME=\"%s\")&& \
|
||||
(LOG_MACHINE=0)",
|
||||
(const char *)nownext_conf->station());
|
||||
sql=QString("select ")+
|
||||
"ID,"+ // 00
|
||||
"PLUGIN_PATH,"+ // 01
|
||||
"PLUGIN_ARG "+ // 02
|
||||
"from NOWNEXT_PLUGINS where "+
|
||||
"(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\") && "+
|
||||
"(LOG_MACHINE=0)";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
item=new RDListViewItem(nownext_plugin_list);
|
||||
@@ -507,8 +509,6 @@ void EditNowNext::editNextcartData(int lognum)
|
||||
void EditNowNext::okData()
|
||||
{
|
||||
QHostAddress addr[3];
|
||||
QString str1;
|
||||
QString str2;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDListViewItem *item;
|
||||
@@ -518,14 +518,10 @@ void EditNowNext::okData()
|
||||
nownext_address_edit[i]->setText("0.0.0.0");
|
||||
}
|
||||
if(!addr[i].setAddress(nownext_address_edit[i]->text())) {
|
||||
str1=QString(tr("The IP address"));
|
||||
str2=QString(tr("is invalid!"));
|
||||
QMessageBox::warning(this,tr("Invalid Address"),
|
||||
QString().
|
||||
sprintf("%s \"%s\" %s",(const char *)str1,
|
||||
(const char *)nownext_address_edit[i]->
|
||||
text(),
|
||||
(const char *)str2));
|
||||
tr("The IP address")+
|
||||
" \""+nownext_address_edit[i]->text()+"\" "+
|
||||
tr("is invalid!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -546,24 +542,19 @@ void EditNowNext::okData()
|
||||
else {
|
||||
nownext_conf->setLogNextCart(i,nownext_nextcart_edit[i]->text().toUInt());
|
||||
}
|
||||
sql=QString().sprintf("delete from NOWNEXT_PLUGINS where \
|
||||
(STATION_NAME=\"%s\")&&(LOG_MACHINE=%d)",
|
||||
(const char *)RDEscapeString(nownext_conf->station()),
|
||||
i);
|
||||
sql=QString("delete from NOWNEXT_PLUGINS where ")+
|
||||
"(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\")&&"+
|
||||
QString().sprintf("(LOG_MACHINE=%d)",i);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
item=(RDListViewItem *)nownext_plugin_list->firstChild();
|
||||
while(item!=NULL) {
|
||||
sql=QString().sprintf("insert into NOWNEXT_PLUGINS set \
|
||||
STATION_NAME=\"%s\", \
|
||||
LOG_MACHINE=0, \
|
||||
PLUGIN_PATH=\"%s\", \
|
||||
PLUGIN_ARG=\"%s\"",
|
||||
(const char *)
|
||||
RDEscapeString(nownext_conf->station()),
|
||||
(const char *)RDEscapeString(item->text(0)),
|
||||
(const char *)RDEscapeString(item->text(1)));
|
||||
sql=QString("insert into NOWNEXT_PLUGINS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\","+
|
||||
"LOG_MACHINE=0,"+
|
||||
"PLUGIN_PATH=\""+RDEscapeString(item->text(0))+"\","+
|
||||
"PLUGIN_ARG=\""+RDEscapeString(item->text(1))+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
item=(RDListViewItem *)item->nextSibling();
|
||||
|
||||
Reference in New Issue
Block a user