Deleted script body?

User avatar
SlySven
Posts: 903
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Deleted script body?

Post by SlySven » Sat Dec 17, 2016 12:53 am

The issue is probably something related to making sure the "script" area (the text edit widget on the right hand side) is saved as the focus is moved away from it to somewhere else on the editor and then blanking it out ready for the new contents for a different item that has been chosen. If you want to take a bash at the issue put a qDebug() at the start and possibly other "interesting" points of most of the methods in the dlgTriggerEditor.cpp class file and try and determine the program flow - particularly for the methods that read/write the value held in the (QPlainTextEdit *) dlgTriggerEditor::mpSourceEditor item. You will probably find a program flow sequence in which something is saving the current script editor content, then something is clearing it and then saving it again after it has been cleared but is still being associated with the old thing being edited. One gotcha in these cases for Qt Widgets is that the Double mouse click event is (obviously) preceded by the Single mouse click event - but is followed by another Single mouse click event - I don't think that is the issue here but it is the sort of unintended effect we are getting in the editor (which is, I think, one of the oldest parts of the application) and which has been revised extensively through the life of the Mudlet project... 8-)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest