Browse Source

Log all calls to Model::createModule() and createModuleWidget().

tags/v2.0.6
Andrew Belt 2 years ago
parent
commit
8e7acf9b74
5 changed files with 11 additions and 0 deletions
  1. +3
    -0
      src/app/Browser.cpp
  2. +2
    -0
      src/app/ModuleWidget.cpp
  3. +3
    -0
      src/app/RackWidget.cpp
  4. +1
    -0
      src/engine/Engine.cpp
  5. +2
    -0
      src/history.cpp

+ 3
- 0
src/app/Browser.cpp View File

@@ -83,9 +83,11 @@ static ModuleWidget* chooseModel(plugin::Model* model) {
mi.lastAdded = system::getUnixTime();

// Create Module and ModuleWidget
INFO("Creating module %s", model->getFullName().c_str());
engine::Module* module = model->createModule();
APP->engine->addModule(module);

INFO("Creating module widget %s", model->getFullName().c_str());
ModuleWidget* moduleWidget = model->createModuleWidget(module);
APP->scene->rack->addModuleAtMouse(moduleWidget);

@@ -189,6 +191,7 @@ struct ModelBox : widget::OpaqueWidget {
mwc = new ModuleWidgetContainer;
fb->addChild(mwc);

INFO("Creating module widget %s", model->getFullName().c_str());
moduleWidget = model->createModuleWidget(NULL);
mwc->addChild(moduleWidget);
mwc->box.size = moduleWidget->box.size;


+ 2
- 0
src/app/ModuleWidget.cpp View File

@@ -782,6 +782,7 @@ void ModuleWidget::cloneAction(bool cloneCables) {
engine::Module::jsonStripIds(moduleJ);

// Clone Module
INFO("Creating module %s", model->getFullName().c_str());
engine::Module* clonedModule = model->createModule();

// Set ID here so we can copy module storage dir
@@ -798,6 +799,7 @@ void ModuleWidget::cloneAction(bool cloneCables) {
APP->engine->addModule(clonedModule);

// Clone ModuleWidget
INFO("Creating module widget %s", model->getFullName().c_str());
ModuleWidget* clonedModuleWidget = model->createModuleWidget(clonedModule);
APP->scene->rack->addModuleAtMouse(clonedModuleWidget);



+ 3
- 0
src/app/RackWidget.cpp View File

@@ -43,11 +43,13 @@ struct RackWidget::Internal {
static ModuleWidget* moduleWidgetFromJson(json_t* moduleJ) {
plugin::Model* model = plugin::modelFromJson(moduleJ);
assert(model);
INFO("Creating module %s", model->getFullName().c_str());
engine::Module* module = model->createModule();
assert(module);
module->fromJson(moduleJ);

// Create ModuleWidget
INFO("Creating module widget %s", model->getFullName().c_str());
ModuleWidget* moduleWidget = module->model->createModuleWidget(module);
assert(moduleWidget);
return moduleWidget;
@@ -361,6 +363,7 @@ void RackWidget::fromJson(json_t* rootJ) {
}

// Create ModuleWidget
INFO("Creating module widget %s", module->model->getFullName().c_str());
ModuleWidget* mw = module->model->createModuleWidget(module);

// pos


+ 1
- 0
src/engine/Engine.cpp View File

@@ -1230,6 +1230,7 @@ void Engine::fromJson(json_t* rootJ) {
}

// Create module
INFO("Creating module %s", model->getFullName().c_str());
Module* module = model->createModule();
assert(module);



+ 2
- 0
src/history.cpp View File

@@ -61,6 +61,7 @@ void ModuleAdd::undo() {
}

void ModuleAdd::redo() {
INFO("Creating module %s", model->getFullName().c_str());
engine::Module* module = model->createModule();
module->id = moduleId;
try {
@@ -71,6 +72,7 @@ void ModuleAdd::redo() {
}
APP->engine->addModule(module);

INFO("Creating module widget %s", model->getFullName().c_str());
app::ModuleWidget* mw = model->createModuleWidget(module);
mw->box.pos = pos;
APP->scene->rack->addModule(mw);


Loading…
Cancel
Save