MCPcopy Create free account
hub / github.com/KDE/krita / composeCommands

Function composeCommands

libs/command/kis_command_utils.cpp:201–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 KUndo2Command* composeCommands(KUndo2Command *parent, KUndo2Command *cmd) {
202 KIS_SAFE_ASSERT_RECOVER(cmd) {
203 cmd = new KUndo2Command(kundo2_noi18n("failed"));
204 }
205
206 KIS_SAFE_ASSERT_RECOVER_NOOP(!cmd->hasParent());
207 KIS_SAFE_ASSERT_RECOVER_NOOP(!parent || !parent->hasParent());
208
209 if (!parent) return cmd;
210
211 if (CompositeCommand *compositeParent = dynamic_cast<CompositeCommand*>(parent)) {
212 compositeParent->addCommand(cmd);
213 return parent;
214 }
215
216 CompositeCommand *newCompositeParent = new CompositeCommand();
217 newCompositeParent->setText(parent->text());
218 newCompositeParent->addCommand(parent);
219 newCompositeParent->addCommand(cmd);
220
221 return newCompositeParent;
222 }
223
224 void redoAndMergeIntoAccumulatingCommand(KUndo2Command *cmd, std::unique_ptr<KUndo2Command> &accumulatingCommand)
225 {

Callers 2

layerPropertiesMethod · 0.85
saveLayerMethod · 0.85

Calls 4

hasParentMethod · 0.80
addCommandMethod · 0.45
setTextMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected