Skip to content
Snippets Groups Projects
Commit f365ef91 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

minor corrections

parent 69f4f536
No related branches found
No related tags found
1 merge request!714Undo/Redo of sample editor
......@@ -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);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment