From fb9487810b874e04ee96d2b5e7a403488fcc46b8 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Sat, 14 Oct 2017 10:38:55 -0400 Subject: [PATCH] 2017-10-14 Fred Gleason * Implemented a '%r' wildcard for Rivendell Host Name. --- ChangeLog | 2 ++ docs/datetime_wildcards.txt | 2 +- lib/export_bmiemr.cpp | 10 +++++----- lib/export_cutlog.cpp | 10 +++++----- lib/export_deltaflex.cpp | 10 +++++----- lib/export_musicclassical.cpp | 10 +++++----- lib/export_musicplayout.cpp | 10 +++++----- lib/export_musicsummary.cpp | 10 +++++----- lib/export_nprsoundex.cpp | 10 +++++----- lib/export_radiotraffic.cpp | 10 +++++----- lib/export_soundex.cpp | 10 +++++----- lib/export_spincount.cpp | 10 +++++----- lib/export_technical.cpp | 10 +++++----- lib/export_textlog.cpp | 10 +++++----- lib/rddatedecode.cpp | 13 +++++++++++-- lib/rddatedecode.h | 7 +++++-- lib/rdreport.cpp | 20 +++++++++++++------- lib/rdreport.h | 8 +++++--- lib/rdsvc.cpp | 14 ++++++++------ lib/rdsvc.h | 5 ++++- rdadmin/add_svc.cpp | 8 +++++--- rdadmin/createdb.cpp | 2 +- rdadmin/edit_report.cpp | 11 ++++++----- rdadmin/edit_svc.cpp | 11 ++++++----- rdadmin/list_svcs.cpp | 9 +++++---- rdadmin/test_import.cpp | 22 ++++++++++++---------- rdairplay/rdairplay.cpp | 7 ++++--- rdairplay/rlmhost.cpp | 2 +- rdcatchd/batch.cpp | 2 +- rdcatchd/catch_event.cpp | 5 +++-- rdcatchd/catch_event.h | 8 +++++--- rdcatchd/local_macros.cpp | 2 +- rdcatchd/rdcatchd.cpp | 8 ++++---- rdlogedit/voice_tracker.cpp | 2 +- rdlogmanager/commandline_ops.cpp | 11 ++++++----- rdlogmanager/generate_log.cpp | 25 +++++++++++++------------ rdlogmanager/pick_report_dates.cpp | 12 +++++++----- tests/datedecode_test.cpp | 17 +++++++++++++++-- tests/datedecode_test.h | 2 +- utils/rdclilogedit/operations.cpp | 2 +- utils/rddgimport/rddgimport.cpp | 4 ++-- web/rdxport/logs.cpp | 2 +- web/rdxport/services.cpp | 2 +- 43 files changed, 211 insertions(+), 156 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69b1409b..20987b25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16094,3 +16094,5 @@ methods. * Added a 'Set End Date/Time' control to the 'Edit Group' dialog in RDAdmin(1). +2017-10-14 Fred Gleason + * Implemented a '%r' wildcard for Rivendell Host Name. diff --git a/docs/datetime_wildcards.txt b/docs/datetime_wildcards.txt index 055d5899..d24a9edb 100644 --- a/docs/datetime_wildcards.txt +++ b/docs/datetime_wildcards.txt @@ -83,7 +83,7 @@ where: Q -- [unassigned] - r -- [unassigned] + r -- Rivendell Host Name [not FQDN] R -- [unassigned] diff --git a/lib/export_bmiemr.cpp b/lib/export_bmiemr.cpp index 2d70d64e..095cd39a 100644 --- a/lib/export_bmiemr.cpp +++ b/lib/export_bmiemr.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to BMI EMR Format // -// (C) Copyright 2002-2006,2016 Fred Gleason +// (C) Copyright 2002-2006,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -39,11 +39,11 @@ bool RDReport::ExportBmiEmr(const QDate &startdate,const QDate &enddate, QString station_format=stationFormat(); #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif // diff --git a/lib/export_cutlog.cpp b/lib/export_cutlog.cpp index 8482401b..65acb8a6 100644 --- a/lib/export_cutlog.cpp +++ b/lib/export_cutlog.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Cut Report. // -// (C) Copyright 2002-2016 Fred Gleason +// (C) Copyright 2002-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -41,11 +41,11 @@ bool RDReport::ExportCutLog(const QDate &startdate,const QDate &enddate, QString cart_num; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_deltaflex.cpp b/lib/export_deltaflex.cpp index 2ca21fae..bfe549fb 100644 --- a/lib/export_deltaflex.cpp +++ b/lib/export_deltaflex.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to CBSI DeltaFlex // -// (C) Copyright 2002-2005,2016 Fred Gleason +// (C) Copyright 2002-2005,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -43,11 +43,11 @@ bool RDReport::ExportDeltaflex(const QDate &startdate,const QDate &enddate, QString air_fmt; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_musicclassical.cpp b/lib/export_musicclassical.cpp index 73c94727..e07a1ee6 100644 --- a/lib/export_musicclassical.cpp +++ b/lib/export_musicclassical.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Classical Music Playout report // -// (C) Copyright 2014,2016 Fred Gleason +// (C) Copyright 2014,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -41,11 +41,11 @@ bool RDReport::ExportMusicClassical(const QDate &startdate,const QDate &enddate, QString cart_num; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_musicplayout.cpp b/lib/export_musicplayout.cpp index ce167db1..1b1817ed 100644 --- a/lib/export_musicplayout.cpp +++ b/lib/export_musicplayout.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to an ASCII Text File. // -// (C) Copyright 2012,2016 Fred Gleason +// (C) Copyright 2012,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -41,11 +41,11 @@ bool RDReport::ExportMusicPlayout(const QDate &startdate,const QDate &enddate, QString cart_num; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_musicsummary.cpp b/lib/export_musicsummary.cpp index 7ec6df9d..a31da4da 100644 --- a/lib/export_musicsummary.cpp +++ b/lib/export_musicsummary.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to an ASCII Text File. // -// (C) Copyright 2012,2016 Fred Gleason +// (C) Copyright 2012,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -40,11 +40,11 @@ bool RDReport::ExportMusicSummary(const QDate &startdate,const QDate &enddate, QString str; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_nprsoundex.cpp b/lib/export_nprsoundex.cpp index dca9b608..b736ba16 100644 --- a/lib/export_nprsoundex.cpp +++ b/lib/export_nprsoundex.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell NPR SoundExchange Report to an ASCII Text File. // -// (C) Copyright 2002-2006,2013,2016 Fred Gleason +// (C) Copyright 2002-2006,2013,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -51,11 +51,11 @@ bool RDReport::ExportNprSoundEx(const QDate &startdate,const QDate &enddate, QString channel_name=stationId(); #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif if((f=fopen(filename,"wb"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_radiotraffic.cpp b/lib/export_radiotraffic.cpp index 77053b2a..fbb848bd 100644 --- a/lib/export_radiotraffic.cpp +++ b/lib/export_radiotraffic.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to RadioTraffic.com // -// (C) Copyright 2002-2005,2009,2016 Fred Gleason +// (C) Copyright 2002-2005,2009,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -38,11 +38,11 @@ bool RDReport::ExportRadioTraffic(const QDate &startdate,const QDate &enddate, QString air_fmt; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_soundex.cpp b/lib/export_soundex.cpp index 83c08d44..461ebe76 100644 --- a/lib/export_soundex.cpp +++ b/lib/export_soundex.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell SoundExchange Report to an ASCII Text File. // -// (C) Copyright 2002-2006,2016 Fred Gleason +// (C) Copyright 2002-2006,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -48,11 +48,11 @@ bool RDReport::ExportSoundEx(const QDate &startdate,const QDate &enddate, QString channel_name=stationId(); #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif // diff --git a/lib/export_spincount.cpp b/lib/export_spincount.cpp index aab334b5..433a589e 100644 --- a/lib/export_spincount.cpp +++ b/lib/export_spincount.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Spin Count Report to an ASCII Text File. // -// (C) Copyright 2015 Fred Gleason +// (C) Copyright 2015,2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -50,11 +50,11 @@ bool RDReport::ExportSpinCount(const QDate &startdate,const QDate &enddate, #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/export_technical.cpp b/lib/export_technical.cpp index c16c660a..c6dcef08 100644 --- a/lib/export_technical.cpp +++ b/lib/export_technical.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Technical Report to an ASCII Text File. // -// (C) Copyright 2002-2006,2016 Fred Gleason +// (C) Copyright 2002-2006,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -44,11 +44,11 @@ bool RDReport::ExportTechnical(const QDate &startdate,const QDate &enddate, char eol[3]="\n"; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); if(incl_crs) { strcpy(eol,"\r\n"); } diff --git a/lib/export_textlog.cpp b/lib/export_textlog.cpp index 6cd35da3..43792b91 100644 --- a/lib/export_textlog.cpp +++ b/lib/export_textlog.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to an ASCII Text File. // -// (C) Copyright 2002-2005,2016 Fred Gleason +// (C) Copyright 2002-2005,2016-2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -42,11 +42,11 @@ bool RDReport::ExportTextLog(const QDate &startdate,const QDate &enddate, QString cart_num; #ifdef WIN32 - QString filename= - RDDateDecode(exportPath(RDReport::Windows),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_config,serviceName()); #else - QString filename= - RDDateDecode(exportPath(RDReport::Linux),startdate,serviceName()); + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_config,serviceName()); #endif QFile file(filename); diff --git a/lib/rddatedecode.cpp b/lib/rddatedecode.cpp index e200f76e..e53f056f 100644 --- a/lib/rddatedecode.cpp +++ b/lib/rddatedecode.cpp @@ -22,7 +22,8 @@ #include -QString RDDateDecode(QString str,const QDate &date,const QString &svcname) +QString RDDateDecode(QString str,const QDate &date,RDConfig *config, + const QString &svcname) { QString string; int yearnum; @@ -117,6 +118,10 @@ QString RDDateDecode(QString str,const QDate &date,const QString &svcname) field=QString().sprintf("%02d",date.month()); break; + case 'r': // Rivendell Host Name + field=config->stationName(); + break; + case 's': // Service name if(!svcname.isEmpty()) { field=svcname; @@ -171,7 +176,7 @@ QString RDDateDecode(QString str,const QDate &date,const QString &svcname) QString RDDateTimeDecode(QString str,const QDateTime &datetime, - const QString &svcname) + RDConfig *config,const QString &svcname) { QString string; int yearnum; @@ -294,6 +299,10 @@ QString RDDateTimeDecode(QString str,const QDateTime &datetime, field=datetime.time().toString("ap"); break; + case 'r': // Rivendell Host Name + field=config->stationName(); + break; + case 'S': // Second (SS) field=QString().sprintf("%02d",datetime.time().second()); break; diff --git a/lib/rddatedecode.h b/lib/rddatedecode.h index d0ae5f74..f76e7977 100644 --- a/lib/rddatedecode.h +++ b/lib/rddatedecode.h @@ -23,9 +23,12 @@ #include -QString RDDateDecode(QString str,const QDate &date,const QString &svcname=""); +#include + +QString RDDateDecode(QString str,const QDate &date,RDConfig *config, + const QString &svcname=""); QString RDDateTimeDecode(QString str,const QDateTime &datetime, - const QString &svcname=""); + RDConfig *config,const QString &svcname=""); #endif // RDDATEDECODE diff --git a/lib/rdreport.cpp b/lib/rdreport.cpp index 71ee8fee..e6836f3d 100644 --- a/lib/rdreport.cpp +++ b/lib/rdreport.cpp @@ -32,9 +32,10 @@ #include #include -RDReport::RDReport(const QString &rptname,QObject *parent) +RDReport::RDReport(const QString &rptname,RDConfig *config,QObject *parent) { report_name=rptname; + report_config=config; report_error_code=RDReport::ErrorOk; } @@ -311,9 +312,11 @@ bool RDReport::outputExists(const QDate &startdate) { QString out_path; #ifdef WIN32 - out_path=RDDateDecode(exportPath(RDReport::Windows),startdate); + out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_config, + serviceName()); #else - out_path=RDDateDecode(exportPath(RDReport::Linux),startdate); + out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config, + serviceName()); #endif return QFile::exists(out_path); } @@ -448,7 +451,7 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, (const char *)name()); q=new RDSqlQuery(sql); while(q->next()) { - svc=new RDSvc(q->value(0).toString()); + svc=new RDSvc(q->value(0).toString(),report_config); if(svc->exists()) { rec_name=q->value(0).toString(); rec_name.replace(" ","_"); @@ -672,10 +675,13 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, } #ifdef WIN32 *out_path=RDDateDecode(exportPath(RDReport::Windows),startdate); - QString post_cmd=RDDateDecode(postExportCommand(RDReport::Windows),startdate); + QString post_cmd=RDDateDecode(postExportCommand(RDReport::Windows),startdate, + report_config,serviceName()); #else - *out_path=RDDateDecode(exportPath(RDReport::Linux),startdate); - QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate); + *out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config, + serviceName()); + QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate, + report_config,serviceName()); #endif system(post_cmd); // printf("MIXDOWN TABLE: %s_SRT\n",(const char *)mixname); diff --git a/lib/rdreport.h b/lib/rdreport.h index 782b96bb..68c87c20 100644 --- a/lib/rdreport.h +++ b/lib/rdreport.h @@ -2,7 +2,7 @@ // // Abstract a Rivendell Report Descriptor // -// (C) Copyright 2002-2006,2016 Fred Gleason +// (C) Copyright 2002-2006,2017 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -24,9 +24,10 @@ #include #include +#include +#include #include #include -#include class RDReport { @@ -41,7 +42,7 @@ class RDReport enum ExportType {Generic=0,Traffic=1,Music=2}; enum StationType {TypeOther=0,TypeAm=1,TypeFm=2,TypeLast=3}; enum ErrorCode {ErrorOk=0,ErrorCanceled=1,ErrorCantOpen=2}; - RDReport(const QString &rptname,QObject *parent=0); + RDReport(const QString &rptname,RDConfig *config,QObject *parent=0); QString name() const; bool exists() const; QString description() const; @@ -127,6 +128,7 @@ class RDReport QString OsFieldName(ExportOs os) const; QString TypeFieldName(ExportType type,bool forced) const; QString report_name; + RDConfig *report_config; RDReport::ErrorCode report_error_code; }; diff --git a/lib/rdsvc.cpp b/lib/rdsvc.cpp index 66bee7e9..6400f38e 100644 --- a/lib/rdsvc.cpp +++ b/lib/rdsvc.cpp @@ -34,10 +34,11 @@ // // Global Classes // -RDSvc::RDSvc(QString svcname,QObject *parent) +RDSvc::RDSvc(QString svcname,RDConfig *config,QObject *parent) : QObject(parent) { svc_name=svcname; + svc_config=config; } @@ -337,7 +338,7 @@ QString RDSvc::importFilename(ImportSource src,const QDate &date) const QString ret; RDSqlQuery *q=new RDSqlQuery(sql); if(q->first()) { - ret=RDDateDecode(q->value(0).toString(),date); + ret=RDDateDecode(q->value(0).toString(),date,svc_config,svc_name); } delete q; return ret; @@ -417,7 +418,8 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str, // // Open Source File // - if((infile=fopen(RDDateDecode(infilename,date),"r"))==NULL) { + if((infile=fopen(RDDateDecode(infilename,date,svc_config,svc_name),"r"))== + NULL) { return false; } @@ -425,7 +427,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str, // Run Preimport Command // if(!preimport_cmd.isEmpty()) { - system(RDDateDecode(preimport_cmd,date)); + system(RDDateDecode(preimport_cmd,date,svc_config,svc_name)); } QString parser_table; @@ -733,7 +735,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname, MODIFIED_DATETIME=now(),START_DATE=null,\ END_DATE=null,NEXT_ID=0", (const char *)RDEscapeString(svc_name), - (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date)), + (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)), "RDLogManager"); if(!purge_date.isValid()) { sql+=(",PURGE_DATE=\""+purge_date.toString("yyyy-MM-dd")+"\""); @@ -755,7 +757,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname, PURGE_DATE=%s", (const char *)RDEscapeString(logname), (const char *)RDEscapeString(svc_name), - (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date)), + (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)), "RDLogManager", (const char *)RDCheckDateTime(purge_date,"yyyy-MM-dd")); q=new RDSqlQuery(sql); diff --git a/lib/rdsvc.h b/lib/rdsvc.h index c3a757e2..fcd6ad24 100644 --- a/lib/rdsvc.h +++ b/lib/rdsvc.h @@ -26,6 +26,8 @@ #include #include +#include + class RDSvc : public QObject { Q_OBJECT @@ -35,7 +37,7 @@ class RDSvc : public QObject enum ImportField {CartNumber=0,ExtData=3,ExtEventId=4,ExtAnncType=5, Title=6,StartHours=7,StartMinutes=8,StartSeconds=9, LengthHours=10,LengthMinutes=11,LengthSeconds=12}; - RDSvc(QString svcname,QObject *parent=0); + RDSvc(QString svcname,RDConfig *config,QObject *parent=0); QString name() const; bool exists() const; QString description() const; @@ -109,6 +111,7 @@ class RDSvc : public QObject QString *label_cart,QString *track_cart); bool CheckId(std::vector *v,int value); QString svc_name; + RDConfig *svc_config; }; diff --git a/rdadmin/add_svc.cpp b/rdadmin/add_svc.cpp index d5baed46..2fe12e53 100644 --- a/rdadmin/add_svc.cpp +++ b/rdadmin/add_svc.cpp @@ -31,11 +31,13 @@ #include #include -#include -#include #include #include +#include "add_svc.h" +#include "edit_svc.h" +#include "globals.h" + AddSvc::AddSvc(QString *svcname,QWidget *parent) : QDialog(parent,"",true) { @@ -145,7 +147,7 @@ void AddSvc::okData() return; } - RDSvc *svc=new RDSvc(svc_name_edit->text(),this); + RDSvc *svc=new RDSvc(svc_name_edit->text(),admin_config,this); if(svc->exists()) { QMessageBox::warning(this,tr("Service Exists"), tr("Service Already Exists!")); diff --git a/rdadmin/createdb.cpp b/rdadmin/createdb.cpp index b8c04964..73272f47 100644 --- a/rdadmin/createdb.cpp +++ b/rdadmin/createdb.cpp @@ -2588,7 +2588,7 @@ bool InitDb(QString name,QString pwd,QString station_name) // // Create Default Service // - RDSvc *svc=new RDSvc(RD_SERVICE_NAME); + RDSvc *svc=new RDSvc(RD_SERVICE_NAME,admin_config); svc->create(""); svc->setDescription(RD_SERVICE_DESCRIPTION); delete svc; diff --git a/rdadmin/edit_report.cpp b/rdadmin/edit_report.cpp index 867c2ff3..cb30ceb3 100644 --- a/rdadmin/edit_report.cpp +++ b/rdadmin/edit_report.cpp @@ -34,10 +34,11 @@ #include #include -#include -#include -#include -#include +#include "autofill_carts.h" +#include "edit_report.h" +#include "edit_svc_perms.h" +#include "globals.h" +#include "test_import.h" EditReport::EditReport(QString rptname,QWidget *parent) : QDialog(parent,"",true) @@ -55,7 +56,7 @@ EditReport::EditReport(QString rptname,QWidget *parent) setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); - edit_report=new RDReport(rptname); + edit_report=new RDReport(rptname,admin_config); str=QString(tr("Edit Report")); setCaption(QString().sprintf("%s - %s",(const char *)str, (const char *)rptname)); diff --git a/rdadmin/edit_svc.cpp b/rdadmin/edit_svc.cpp index d841fc6d..a79fa46b 100644 --- a/rdadmin/edit_svc.cpp +++ b/rdadmin/edit_svc.cpp @@ -37,10 +37,11 @@ #include #include -#include -#include -#include -#include +#include "autofill_carts.h" +#include "edit_svc.h" +#include "globals.h" +#include "edit_svc_perms.h" +#include "test_import.h" EditSvc::EditSvc(QString svc,QWidget *parent) : QDialog(parent,"",true) @@ -58,7 +59,7 @@ EditSvc::EditSvc(QString svc,QWidget *parent) setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); - svc_svc=new RDSvc(svc); + svc_svc=new RDSvc(svc,admin_config); setCaption(tr("Edit Service")); diff --git a/rdadmin/list_svcs.cpp b/rdadmin/list_svcs.cpp index 5fdf98c2..f8d2681d 100644 --- a/rdadmin/list_svcs.cpp +++ b/rdadmin/list_svcs.cpp @@ -30,9 +30,10 @@ #include #include -#include -#include -#include +#include "add_svc.h" +#include "edit_svc.h" +#include "globals.h" +#include "list_svcs.h" ListSvcs::ListSvcs(QWidget *parent) : QDialog(parent,"",true) @@ -184,7 +185,7 @@ void ListSvcs::deleteData() } } delete q; - RDSvc *svc=new RDSvc(list_box->currentText()); + RDSvc *svc=new RDSvc(list_box->currentText(),admin_config); svc->remove(); delete svc; list_box->removeItem(list_box->currentItem()); diff --git a/rdadmin/test_import.cpp b/rdadmin/test_import.cpp index 288f749f..e7d8277a 100644 --- a/rdadmin/test_import.cpp +++ b/rdadmin/test_import.cpp @@ -22,15 +22,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "globals.h" +#include "rdconf.h" +#include "rddatedecode.h" +#include "rddatedialog.h" +#include "rddb.h" +#include "rdevent_line.h" +#include "rdlistviewitem.h" +#include "rdpasswd.h" +#include "rduser.h" + +#include "test_import.h" TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent) : QDialog(parent,"",true) @@ -254,7 +256,7 @@ void TestImport::dateChangedData(const QDate &date) { test_filename_edit-> setText(RDDateDecode(test_svc->importPath(test_src,RDSvc::Linux),date, - test_svc->name())); + admin_config,test_svc->name())); } diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index a6f85a12..e310fb23 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -162,7 +162,8 @@ MainWidget::MainWidget(QWidget *parent) for(unsigned k=0;kvalue(j).length();k++) { if(cmd->value(j).at(k)==QChar(':')) { air_start_logname[i]= - RDDateTimeDecode(cmd->value(j).left(k),air_startup_datetime); + RDDateTimeDecode(cmd->value(j).left(k),air_startup_datetime, + air_config); lineno=cmd->value(j).right(cmd->value(j).length()-(k+1)); if(lineno.right(1)=="+") { air_start_start[i]=true; @@ -969,7 +970,7 @@ void MainWidget::ripcConnected(bool state) case RDAirPlayConf::StartPrevious: air_start_logname[i]= RDDateTimeDecode(rdairplay_conf->currentLog(i), - air_startup_datetime); + air_startup_datetime,air_config); if(!air_start_logname[i].isEmpty()) { if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) { if((air_start_line[i]=rdairplay_conf->logCurrentLine(i))>=0) { @@ -987,7 +988,7 @@ void MainWidget::ripcConnected(bool state) case RDAirPlayConf::StartSpecified: air_start_logname[i]= RDDateTimeDecode(rdairplay_conf->logName(i), - air_startup_datetime); + air_startup_datetime,air_config); if(!air_start_logname[i].isEmpty()) { if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) { if(air_start_logname[i]==rdairplay_conf->currentLog(i)) { diff --git a/rdairplay/rlmhost.cpp b/rdairplay/rlmhost.cpp index 75fcce86..cb428723 100644 --- a/rdairplay/rlmhost.cpp +++ b/rdairplay/rlmhost.cpp @@ -85,7 +85,7 @@ void RLMHost::sendEvent(const QString &svcname,const QString &logname, struct rlm_pad *now=new struct rlm_pad; struct rlm_pad *next=new struct rlm_pad; memset(svc,0,sizeof(struct rlm_svc)); - RDSvc *service=new RDSvc(svcname); + RDSvc *service=new RDSvc(svcname,air_config); if(!svcname.isEmpty()) { sprintf(svc->svc_name,"%s",(const char *)svcname.left(255)); if(!service->programCode().isEmpty()) { diff --git a/rdcatchd/batch.cpp b/rdcatchd/batch.cpp index 54a9c5f5..cda0e6a9 100644 --- a/rdcatchd/batch.cpp +++ b/rdcatchd/batch.cpp @@ -156,7 +156,7 @@ void MainObject::RunBatch(RDCmdSwitch *cmd) fprintf(stderr,"rdcatchd: id %d not found\n",id); exit(256); } - batch_event=new CatchEvent(); + batch_event=new CatchEvent(RDConfiguration()); LoadEvent(q,batch_event,false); delete q; diff --git a/rdcatchd/catch_event.cpp b/rdcatchd/catch_event.cpp index 11414e70..59e47035 100644 --- a/rdcatchd/catch_event.cpp +++ b/rdcatchd/catch_event.cpp @@ -22,8 +22,9 @@ #include -CatchEvent::CatchEvent() +CatchEvent::CatchEvent(RDConfig *config) { + catch_config=config; clear(); } @@ -661,7 +662,7 @@ void CatchEvent::resolveUrl(int time_offset) } setResolvedUrl(RDDateTimeDecode(url(), QDateTime(date.addDays(eventdateOffset()), - current_time))); + current_time),catch_config)); } diff --git a/rdcatchd/catch_event.h b/rdcatchd/catch_event.h index cc6188a2..11ac186d 100644 --- a/rdcatchd/catch_event.h +++ b/rdcatchd/catch_event.h @@ -23,14 +23,15 @@ #include -#include -#include #include +#include +#include +#include class CatchEvent { public: - CatchEvent(); + CatchEvent(RDConfig *config); unsigned id() const; void setId(int id); bool isActive() const; @@ -191,6 +192,7 @@ class CatchEvent int catch_podcast_length; int catch_podcast_time; int catch_eventdate_offset; + RDConfig *catch_config; }; diff --git a/rdcatchd/local_macros.cpp b/rdcatchd/local_macros.cpp index 61361159..2d4ea073 100644 --- a/rdcatchd/local_macros.cpp +++ b/rdcatchd/local_macros.cpp @@ -39,7 +39,7 @@ void MainObject::RunLocalMacros(RDMacro *rml) QDateTime dt; RDUser *user; bool ok=false; - CatchEvent e; + CatchEvent e(RDConfiguration()); unsigned event_ptr=0; QString sql; RDSqlQuery *q; diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index 2b8c03b8..1fbef7f9 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -821,7 +821,7 @@ void MainObject::engineData(int id) catch_events[event]. setResolvedUrl(RDDateTimeDecode(catch_events[event].url(), QDateTime(date.addDays(catch_events[event].eventdateOffset()), - current_time))); + current_time),RDConfiguration())); StartDownloadEvent(event); break; @@ -1911,7 +1911,7 @@ void MainObject::LoadEngine(bool adv_day) (const char *)catch_rdstation->name()); q=new RDSqlQuery(sql); while(q->next()) { - catch_events.push_back(CatchEvent()); + catch_events.push_back(CatchEvent(RDConfiguration())); LoadEvent(q,&catch_events.back(),true); } LogLine(RDConfig::LogInfo,QString().sprintf("loaded %d events",(int)catch_events.size())); @@ -2184,7 +2184,7 @@ bool MainObject::AddEvent(int id) (const char *)catch_rdstation->name(),id); q=new RDSqlQuery(sql); if(q->first()) { - catch_events.push_back(CatchEvent()); + catch_events.push_back(CatchEvent(RDConfiguration())); LoadEvent(q,&catch_events.back(),true); switch((RDRecording::Type)q->value(2).toInt()) { case RDRecording::Recording: @@ -2685,7 +2685,7 @@ void MainObject::StartRmlRecording(int chan,int cartnum,int cutnum,int maxlen) RDDeck *deck=new RDDeck(catch_config->stationName(),chan); RDCut *cut=new RDCut(cartnum,cutnum); QDateTime dt=QDateTime(QDate::currentDate(),QTime::currentTime()); - catch_events.push_back(CatchEvent()); + catch_events.push_back(CatchEvent(RDConfiguration())); catch_events.back().setId(GetNextDynamicId()); catch_events.back().setIsActive(true); catch_events.back().setOneShot(true); diff --git a/rdlogedit/voice_tracker.cpp b/rdlogedit/voice_tracker.cpp index 17a2ad2b..f60b014a 100644 --- a/rdlogedit/voice_tracker.cpp +++ b/rdlogedit/voice_tracker.cpp @@ -214,7 +214,7 @@ VoiceTracker::VoiceTracker(const QString &logname,QString *import_path, // Voicetrack Group // RDLog *log=new RDLog(logname); - RDSvc *svc=new RDSvc(log->service()); + RDSvc *svc=new RDSvc(log->service(),log_config); track_group=new RDGroup(svc->trackGroup()); track_tracks=log->scheduledTracks()-log->completedTracks(); delete svc; diff --git a/rdlogmanager/commandline_ops.cpp b/rdlogmanager/commandline_ops.cpp index b1d4547b..f5df3db4 100644 --- a/rdlogmanager/commandline_ops.cpp +++ b/rdlogmanager/commandline_ops.cpp @@ -77,13 +77,14 @@ int RunLogOperation(int argc,char *argv[],const QString &svcname, #ifndef WIN32 rduser=new RDUser(rdstation_conf->defaultName()); #endif // WIN32 - RDSvc *svc=new RDSvc(svcname); + RDSvc *svc=new RDSvc(svcname,config); if(!svc->exists()) { fprintf(stderr,"rdlogmanager: no such service\n"); return 256; } QDate start_date=QDate::currentDate().addDays(1+start_offset); - QString logname=RDDateDecode(svc->nameTemplate(),start_date,svc->name()); + QString logname= + RDDateDecode(svc->nameTemplate(),start_date,config,svc->name()); RDLog *log=new RDLog(logname); // @@ -107,9 +108,9 @@ int RunLogOperation(int argc,char *argv[],const QString &svcname, delete q; if(!svc->generateLog(start_date, RDDateDecode(svc->nameTemplate(),start_date, - svc->name()), + config,svc->name()), RDDateDecode(svc->nameTemplate(),start_date.addDays(1), - svc->name()), + config,svc->name()), &unused_report)) { fprintf(stderr,"rdlogmanager: unable to generate log\n"); return 256; @@ -234,7 +235,7 @@ int RunReportOperation(int argc,char *argv[],const QString &rptname, // // Open Report Generator // - RDReport *report=new RDReport(rptname); + RDReport *report=new RDReport(rptname,config); if(!report->exists()) { fprintf(stderr,"rdlogmanager: no such report\n"); return 256; diff --git a/rdlogmanager/generate_log.cpp b/rdlogmanager/generate_log.cpp index 776867eb..e35c5af1 100644 --- a/rdlogmanager/generate_log.cpp +++ b/rdlogmanager/generate_log.cpp @@ -306,9 +306,9 @@ void GenerateLog::createData() // // Generate Log // - RDSvc *svc=new RDSvc(gen_service_box->currentText(),this); + RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()); + log_config,svc->name()); RDLog *log=new RDLog(logname); if(log->exists()) { str1=QString(tr("The log for")); @@ -363,9 +363,10 @@ void GenerateLog::createData() gen_progress_dialog,SLOT(setProgress(int))); svc->generateLog(gen_date_edit->date(), RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()), + log_config,svc->name()), RDDateDecode(svc->nameTemplate(),gen_date_edit->date(). - addDays(1),svc->name()),&unused_report); + addDays(1),log_config,svc->name()), + &unused_report); log->updateTracks(); delete log; delete svc; @@ -393,9 +394,9 @@ void GenerateLog::musicData() { unsigned tracks=0; - RDSvc *svc=new RDSvc(gen_service_box->currentText(),this); + RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()); + log_config,svc->name()); RDLog *log=new RDLog(logname); if(((log->linkState(RDLog::SourceMusic)==RDLog::LinkDone)|| (log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone))) { @@ -445,9 +446,9 @@ void GenerateLog::musicData() void GenerateLog::trafficData() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),this); + RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()); + log_config,svc->name()); RDLog *log=new RDLog(logname); if((log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone)) { QString str1=QString(tr("The log for")); @@ -480,9 +481,9 @@ void GenerateLog::trafficData() void GenerateLog::fileScanData() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),this); + RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()); + log_config,svc->name()); RDLog *log=new RDLog(logname); if(gen_music_enabled) { if(QFile::exists(svc-> @@ -549,9 +550,9 @@ void GenerateLog::resizeEvent(QResizeEvent *e) void GenerateLog::UpdateControls() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),this); + RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - svc->name()); + log_config,svc->name()); RDLog *log=new RDLog(logname); if(log->exists()) { if(log->linkQuantity(RDLog::SourceMusic)>0) { diff --git a/rdlogmanager/pick_report_dates.cpp b/rdlogmanager/pick_report_dates.cpp index ebf9bf6f..837aec84 100644 --- a/rdlogmanager/pick_report_dates.cpp +++ b/rdlogmanager/pick_report_dates.cpp @@ -178,7 +178,7 @@ void PickReportDates::generateData() tr("The end date cannot be earlier than the start date!")); return; } - RDReport *report=new RDReport(edit_report_box->currentText(),this); + RDReport *report=new RDReport(edit_report_box->currentText(),log_config,this); if((edit_startdate_edit->date()!=edit_enddate_edit->date())&& (!RDReport::multipleDaysAllowed(report->filter()))) { QMessageBox::warning(this,tr("Invalid Date Range"), @@ -194,11 +194,13 @@ void PickReportDates::generateData() return; } #ifdef WIN32 - QString filename=RDDateDecode(report->exportPath(RDReport::Windows), - edit_startdate_edit->date(),edit_svcname); + QString filename= + RDDateDecode(report->exportPath(RDReport::Windows), + edit_startdate_edit->date(),log_config,edit_svcname); #else - QString filename=RDDateDecode(report->exportPath(RDReport::Linux), - edit_startdate_edit->date(),edit_svcname); + QString filename= + RDDateDecode(report->exportPath(RDReport::Linux), + edit_startdate_edit->date(),log_config,edit_svcname); #endif QFile file(filename); if(file.exists()) { diff --git a/tests/datedecode_test.cpp b/tests/datedecode_test.cpp index 4e982808..7e1c4177 100644 --- a/tests/datedecode_test.cpp +++ b/tests/datedecode_test.cpp @@ -34,6 +34,7 @@ MainObject::MainObject(QObject *parent) { QString date=""; QString datetime=""; + QString service=""; // // Read Command Options @@ -50,6 +51,10 @@ MainObject::MainObject(QObject *parent) datetime=cmd->value(i); cmd->setProcessed(i,true); } + if(cmd->key(i)=="--service") { + service=cmd->value(i); + cmd->setProcessed(i,true); + } if(!cmd->processed(i)) { fprintf(stderr,"datedecode_test: unknown option \"%s\"\n", (const char *)cmd->value(i)); @@ -67,15 +72,23 @@ MainObject::MainObject(QObject *parent) exit(256); } + // + // Open Config + // + RDConfig *config=new RDConfig(); + config->load(); + // // Process Code // if(!date.isEmpty()) { printf("%s\n", - (const char *)RDDateDecode(date,QDate::currentDate())); + (const char *)RDDateDecode(date,QDate::currentDate(),config, + service)); } if(!datetime.isEmpty()) { - printf("%s\n",(const char *)RDDateTimeDecode(datetime,QDateTime(QDate::currentDate(),QTime::currentTime()))); + printf("%s\n",(const char *)RDDateTimeDecode(datetime, + QDateTime(QDate::currentDate(),QTime::currentTime()),config,service)); } exit(0); } diff --git a/tests/datedecode_test.h b/tests/datedecode_test.h index 19f898ce..ece72363 100644 --- a/tests/datedecode_test.h +++ b/tests/datedecode_test.h @@ -23,7 +23,7 @@ #include -#define DATEDECODE_TEST_USAGE "[options]\n\nTest the Rivendell date decoding routines\n\nOptions are:\n--date=\n Decode the string using RDDateDecode() and print the result\n on stdout.\n\n--datetime=\n Decode the string using RDDateTimeDecode() and print\n the result on stdout.\n\n" +#define DATEDECODE_TEST_USAGE "[options]\n\nTest the Rivendell date decoding routines\n\nOptions are:\n--date=\n Decode the string using RDDateDecode() and print the result\n on stdout.\n\n--datetime=\n Decode the string using RDDateTimeDecode() and print\n the result on stdout.\n\n--service=\n Service name to use.\n\n" class MainObject : public QObject { diff --git a/utils/rdclilogedit/operations.cpp b/utils/rdclilogedit/operations.cpp index dfd6ba35..1dec76fd 100644 --- a/utils/rdclilogedit/operations.cpp +++ b/utils/rdclilogedit/operations.cpp @@ -509,7 +509,7 @@ void MainObject::Setpurgedate(const QDate &date) void MainObject::Setservice(const QString &str) { - RDSvc *svc=new RDSvc(str); + RDSvc *svc=new RDSvc(str,edit_config); if(svc->exists()) { edit_service=str; edit_modified=true; diff --git a/utils/rddgimport/rddgimport.cpp b/utils/rddgimport/rddgimport.cpp index 2392c228..eb742518 100644 --- a/utils/rddgimport/rddgimport.cpp +++ b/utils/rddgimport/rddgimport.cpp @@ -209,7 +209,7 @@ void MainWidget::serviceActivatedData(int index) if(dg_svc!=NULL) { delete dg_svc; } - dg_svc=new RDSvc(dg_service_box->currentText()); + dg_svc=new RDSvc(dg_service_box->currentText(),dg_config); if(dg_group!=NULL) { delete dg_group; } @@ -391,7 +391,7 @@ bool MainWidget::WriteTrafficFile() // Open Output File // outname=RDDateDecode(dg_svc->importPath(RDSvc::Traffic,RDSvc::Linux), - dg_date_edit->date()); + dg_date_edit->date(),dg_config,dg_svc->name()); if((f=fopen(outname,"w"))==NULL) { LogMessage(tr("WARNING: Unable to open traffic output file")+" \""+ outname+"\" ["+strerror(errno)+"]."); diff --git a/web/rdxport/logs.cpp b/web/rdxport/logs.cpp index 1bfbc5cb..f7a443db 100644 --- a/web/rdxport/logs.cpp +++ b/web/rdxport/logs.cpp @@ -52,7 +52,7 @@ void Xport::AddLog() if(!xport_post->getValue("SERVICE_NAME",&service_name)) { XmlExit("Missing SERVICE_NAME",400,"logs.cpp",LINE_NUMBER); } - RDSvc *svc=new RDSvc(service_name); + RDSvc *svc=new RDSvc(service_name,xport_config); if(!svc->exists()) { XmlExit("No such service",404,"logs.cpp",LINE_NUMBER); } diff --git a/web/rdxport/services.cpp b/web/rdxport/services.cpp index 87cd4ae9..406e40a6 100644 --- a/web/rdxport/services.cpp +++ b/web/rdxport/services.cpp @@ -64,7 +64,7 @@ void Xport::ListServices() printf("\n"); printf("\n"); while(q->next()) { - svc=new RDSvc(q->value(0).toString()); + svc=new RDSvc(q->value(0).toString(),xport_config); printf("%s",(const char *)svc->xml()); delete svc; }