From f365ef91f0dfe91676e594167c3d871ee9dc0690 Mon Sep 17 00:00:00 2001 From: Matthias Puchner <github@mpuchner.de> Date: Wed, 23 Feb 2022 08:18:32 +0100 Subject: [PATCH] minor corrections --- GUI/View/SampleDesigner/SampleEditorCommands.cpp | 7 ++++--- GUI/View/SampleDesigner/SampleEditorCommands.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/GUI/View/SampleDesigner/SampleEditorCommands.cpp b/GUI/View/SampleDesigner/SampleEditorCommands.cpp index 09eff003a5e..9800acb2d8c 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 69f91eb1aba..e0923cd2c1b 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; -- GitLab