From a5e00c017b3bbbdd5c9443cf89f10a82224c565f Mon Sep 17 00:00:00 2001 From: tresf Date: Fri, 10 Nov 2017 13:21:41 -0500 Subject: [PATCH] Add project upgrade --- plugins/LadspaEffect/calf/config.h.in | 2 +- src/core/DataFile.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/plugins/LadspaEffect/calf/config.h.in b/plugins/LadspaEffect/calf/config.h.in index 7094be614be..a636660e583 100644 --- a/plugins/LadspaEffect/calf/config.h.in +++ b/plugins/LadspaEffect/calf/config.h.in @@ -1,3 +1,3 @@ #define VERSION "${VERSION}" -#define PACKAGE_NAME "calf" +#define PACKAGE_NAME "veal" #define USE_LADSPA 1 diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index cd73be05dc4..aea0f75afbf 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -995,6 +995,29 @@ void DataFile::upgrade_1_3_0() } } } + + list = elementsByTagName( "effect" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement el = list.item( i ).toElement(); + if( el.attribute( "name" ) == "ladspaeffect" ) + { + QDomNodeList children = el.elementsByTagName( "key" ); + for( int j = 0; !children.item( j ).isNull(); ++j ) + { + QDomElement child = children.item( j ).toElement(); + QDomNodeList grandchildren = child.elementsByTagName( "attribute" ); + for( int k = 0; !grandchildren.item( k ).isNull(); ++k ) + { + QDomElement grandchild = grandchildren.item( k ).toElement(); + if( grandchild.attribute( "name" ) == "file" && grandchild.attribute( "value" ) == "calf" ) + { + grandchild.setAttribute( "value", "veal" ); + } + } + } + } + } }