mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-17 16:11:12 +02:00
2020-10-05 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug the 'Editing Event' dialog in rdlogmanager(1) that caused the Services List to be initialized with all services upon creation, even when one or more services had already be added to the list by the user. * Fixed a bug the 'Edit Clock' dialog in rdlogmanager(1) that caused the Services List to be initialized with all services upon creation, even when one or more services had already be added to the list by the user. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -213,25 +213,29 @@ void ListEvents::addData()
|
||||
}
|
||||
else {
|
||||
if(edit_filter_box->currentItem()==0) {
|
||||
sql="select NAME from SERVICES";
|
||||
sql=QString(" select ")+
|
||||
"ID "+ // 00
|
||||
"from EVENT_PERMS where "+
|
||||
"EVENT_NAME=\""+RDEscapeString(logname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
sql=QString().sprintf("insert into EVENT_PERMS set\
|
||||
EVENT_NAME=\"%s\",SERVICE_NAME=\"%s\"",
|
||||
(const char *)logname,
|
||||
(const char *)q->value(0).toString());
|
||||
if(!q->first()) {
|
||||
sql="select NAME from SERVICES";
|
||||
q1=new RDSqlQuery(sql);
|
||||
while(q1->next()) {
|
||||
sql=QString("insert into EVENT_PERMS set ")+
|
||||
"EVENT_NAME=\""+RDEscapeString(logname)+"\","+
|
||||
"SERVICE_NAME=\""+RDEscapeString(q1->value(0).toString())+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
else {
|
||||
sql=QString().sprintf("insert into EVENT_PERMS set\
|
||||
EVENT_NAME=\"%s\",SERVICE_NAME=\"%s\"",
|
||||
(const char *)logname,
|
||||
(const char *)edit_filter_box->currentText());
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
sql=QString("insert into EVENT_PERMS set ")+
|
||||
"EVENT_NAME=\""+RDEscapeString(logname)+"\","+
|
||||
"SERVICE_NAME=\""+RDEscapeString(edit_filter_box->currentText())+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
}
|
||||
delete event_dialog;
|
||||
|
Reference in New Issue
Block a user