Commit 6579f94c authored by Agata Cacko's avatar Agata Cacko
Browse files

Fix crash on undo after importing assistant set

Before this commit, importing assistant set was not undoable,
which broke internal state of the tool, which led to crash.
This commit makes importing the assistant set undoable,
preventing the crash.

parent 7d765f9d
Pipeline #196136 passed with stage
in 84 minutes and 17 seconds
......@@ -1169,6 +1169,10 @@ void KisAssistantTool::loadAssistants()
QMap<int, KisPaintingAssistantHandleSP> sideHandleMap;
KisPaintingAssistantSP assistant;
bool errors = false;
m_origAssistantList = KisPaintingAssistant::cloneAssistantList(m_canvas->paintingAssistantsDecoration()->assistants());
while (!xml.atEnd()) {
switch (xml.readNext()) {
case QXmlStreamReader::StartElement:
......@@ -1303,9 +1307,12 @@ void KisAssistantTool::loadAssistants()
if (errors) {
QMessageBox::warning(qApp->activeWindow(), i18nc("@title:window", "Krita"), i18n("Errors were encountered. Not all assistants were successfully loaded."));
KUndo2Command *command = new EditAssistantsCommand(m_canvas, m_origAssistantList, KisPaintingAssistant::cloneAssistantList(m_canvas->paintingAssistantsDecoration()->assistants()));
m_handles = m_canvas->paintingAssistantsDecoration()->handles();
void KisAssistantTool::saveAssistants()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment