From 4513dba74d5c00b15ed8f30533afea5125f4a8aa Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Sat, 14 Oct 2017 15:16:59 -0400 Subject: [PATCH] 2017-10-14 Fred Gleason * Fixed a bug in RDStation that caused RLM plug-in parameters to fail to be copied as part of the profile of a new host. --- ChangeLog | 3 +++ lib/rdstation.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 95bf41bc..e5ef84e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16102,3 +16102,6 @@ 2017-10-14 Fred Gleason * Implemented a 'NewHostIpAddress=' parameter in the [Provisioning] section of rd.conf(5). +2017-10-14 Fred Gleason + * Fixed a bug in RDStation that caused RLM plug-in parameters to + fail to be copied as part of the profile of a new host. diff --git a/lib/rdstation.cpp b/lib/rdstation.cpp index da960cf1..22ad72e9 100644 --- a/lib/rdstation.cpp +++ b/lib/rdstation.cpp @@ -1090,7 +1090,7 @@ bool RDStation::create(const QString &name,QString *err_msg, delete q; // - // RDAirPlay Log Modes + // Clone RDAirPlay Log Modes // sql=QString("select ")+ "MACHINE,"+ // 00 @@ -1504,6 +1504,27 @@ bool RDStation::create(const QString &name,QString *err_msg, delete q1; } delete q; + + // + // Clone RLM Parameters + // + sql=QString("select ")+ + "LOG_MACHINE,"+ // 00 + "PLUGIN_PATH,"+ // 01 + "PLUGIN_ARG "+ // 02 + "from NOWNEXT_PLUGINS where "+ + "STATION_NAME=\""+RDEscapeString(exemplar)+"\""; + q=new RDSqlQuery(sql); + while(q->next()) { + sql=QString("insert into NOWNEXT_PLUGINS set ")+ + "STATION_NAME=\""+RDEscapeString(name)+"\","+ + QString().sprintf("LOG_MACHINE=%u,",q->value(0).toUInt())+ + "PLUGIN_PATH=\""+RDEscapeString(q->value(1).toString())+"\","+ + "PLUGIN_ARG=\""+RDEscapeString(q->value(2).toString())+"\""; + q1=new RDSqlQuery(sql); + delete q1; + } + delete q; } return true; } @@ -1640,6 +1661,11 @@ void RDStation::remove(const QString &name) "STATION_NAME=\""+RDEscapeString(name)+"\""; q=new RDSqlQuery(sql); delete q; + + sql=QString("delete from NOWNEXT_PLUGINS where ")+ + "STATION_NAME=\""+RDEscapeString(name)+"\""; + q=new RDSqlQuery(sql); + delete q; } void RDStation::SetRow(const QString ¶m,const QString &value) const