From fe4191f9e554aceb3bf6e3a874cf966927156f07 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 11 Aug 2021 05:46:22 -0400 Subject: [PATCH] Implement RackWidget::cloneSelectedModulesAction(). --- src/app/ModuleWidget.cpp | 5 +---- src/app/RackWidget.cpp | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 086525e0..e36ed196 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -775,10 +775,7 @@ void ModuleWidget::cloneAction() { // JSON serialization is the obvious way to do this json_t* moduleJ = toJson(); - // Don't use IDs from JSON - json_object_del(moduleJ, "id"); - json_object_del(moduleJ, "leftModuleId"); - json_object_del(moduleJ, "rightModuleId"); + cleanupModuleJson(moduleJ); // Clone Module engine::Module* clonedModule = model->createModule(); diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index fb42b657..59439064 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -901,7 +901,10 @@ void RackWidget::disconnectSelectedModulesAction() { } void RackWidget::cloneSelectedModulesAction() { - // TODO + json_t* rootJ = selectedModulesToJson(); + DEFER({json_decref(rootJ);}); + // TODO The Action name is incorrect here. + pasteJsonAction(rootJ); } void RackWidget::bypassSelectedModulesAction(bool bypassed) {