diff --git a/GUI/View/SampleDesigner/SampleEditorCommands.cpp b/GUI/View/SampleDesigner/SampleEditorCommands.cpp index 09eff003a5ee7d835826d876659568f491b81c63..9800acb2d8c1693445a8b8452273055d76a6a1b9 100644 --- a/GUI/View/SampleDesigner/SampleEditorCommands.cpp +++ b/GUI/View/SampleDesigner/SampleEditorCommands.cpp @@ -32,6 +32,7 @@ CommandRemoveLayer::CommandRemoveLayer(SampleEditorController* ec, LayerItem* la : QUndoCommand(parent) , m_ec(ec) { + setText("Remove layer"); m_indexOfLayer = ec->multiLayerItem()->layers().indexOf(layerItem); m_layerItemBackup = GUI::Util::createBackup(layerItem); } @@ -55,13 +56,13 @@ void CommandRemoveLayer::undo() } CommandChangeValue::CommandChangeValue(const QString& label, SampleEditorController* ec, - double oldValue, double newValue, QString path, + double oldValue, double newValue, const QString& path, QUndoCommand* parent /*= nullptr*/) : QUndoCommand(parent) , m_ec(ec) , m_oldValue(oldValue) , m_newValue(newValue) - , m_path(std::move(path)) + , m_path(path) { setText("change " + label + "\n"); } @@ -73,7 +74,7 @@ int CommandChangeValue::id() const bool CommandChangeValue::mergeWith(const QUndoCommand* command) { - if (command->id() != id()) // make sure other is also an AppendText command + if (command->id() != id()) // make sure other is also a changeValue command return false; const auto* const other = dynamic_cast<const CommandChangeValue*>(command); diff --git a/GUI/View/SampleDesigner/SampleEditorCommands.h b/GUI/View/SampleDesigner/SampleEditorCommands.h index 69f91eb1aba3ed81b4f60e107fdc1a3e109519b9..e0923cd2c1b30fcd636e6de94482b086fbf57414 100644 --- a/GUI/View/SampleDesigner/SampleEditorCommands.h +++ b/GUI/View/SampleDesigner/SampleEditorCommands.h @@ -24,7 +24,7 @@ class LayerItem; class CommandChangeValue : public QUndoCommand { public: CommandChangeValue(const QString& label, SampleEditorController* ec, double oldValue, - double newValue, QString path, QUndoCommand* parent = nullptr); + double newValue, const QString& path, QUndoCommand* parent = nullptr); int id() const override; bool mergeWith(const QUndoCommand* command) override;