Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax check on columns flux #5350

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

JorisGoosen
Copy link
Contributor

@JorisGoosen JorisGoosen requested a review from boutinb December 12, 2023 16:35
@JorisGoosen JorisGoosen changed the title Fix syntax check columns flux Fix syntax check on columns flux Dec 12, 2023
… time

JASP crashes when closing the workspace if a TextArea was open in an Analysis form.
Copy link
Contributor

@boutinb boutinb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really beautiful...
Could the column encoding not be a function of the column object directly? Then no need to cache the column names in the columnEncoder (and then no need to add all this code to catch up any change in the dataset)?

connect(this, SIGNAL(applyRequest()), this, SLOT(checkSyntaxHandler()));
//If "rowCount" changes on VariableInfo it means a column has been added or removed, this means the model should be reencoded and checked
//Fixes https://github.com/jasp-stats/jasp-issues/issues/2462
connect(VariableInfo::info(), &VariableInfo::rowCountChanged, this, &TextAreaBase::checkSyntaxHandler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really beautiful, but I don't see how to do that in another way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well we couldve added more signals and all that but this should work fine

@@ -48,6 +48,7 @@ void RowControls::init(int row, const Term& key, bool isNew)
context->setContextProperty("rowValue", key.asQString());

_rowObject = qobject_cast<QQuickItem*>(_rowComponent->create(context));
_rowObject->setParent(_parentModel);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed: the rowObject was not deleted.... and so all rowComponents.
This can make JASP crashing because these components can be connected to VariableInfo signals even if the analysis does not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@JorisGoosen
Copy link
Contributor Author

Not really beautiful... Could the column encoding not be a function of the column object directly? Then no need to cache the column names in the columnEncoder (and then no need to add all this code to catch up any change in the dataset)?

Column as parent doesnt make so much sense.
However we could make ColumnEncoder a child of DataSet, and have its values set via that.
Would make things cleaner indeed and work fine both in desktop and engine.
For R syntax mode it should still be separable anyway I think?

But I suggest we do that later, I could do it together with the refactor of empty values that im planning for after the release.

@boutinb boutinb merged commit d7f7375 into jasp-stats:development Dec 14, 2023
1 check passed
JorisGoosen added a commit that referenced this pull request Jan 2, 2024
* Make sure to update ColumnEncoder at right times

* make sure textarea runs checkSyntax whenever amount of columns changes

* RowComponent should get the right parent to be destroyed at the right time

JASP crashes when closing the workspace if a TextArea was open in an Analysis form.

---------

Co-authored-by: boutinb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Editing (inserting) columns confuses SEM module
2 participants