Skip to content

Commit

Permalink
Do not reset model during analysis initialization
Browse files Browse the repository at this point in the history
Fixes jasp-stats/INTERNAL-jasp#2684

If an assigned VariablesList has a 'addAvailableVariablesToAssigned' flag on, then it gets automatically the variables set of the Available VariablesList, This feature should not be activate during the initialization of the analysis: this overwrites the terms in the assigned VariablesList (set by the options saved in the JASP file)
  • Loading branch information
boutinb authored and JorisGoosen committed Nov 6, 2024
1 parent afa1ecd commit 9ed2728
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions QMLComponents/models/listmodelinteractionassigned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "listmodeltermsavailable.h"
#include "listmodeltermsassigned.h"
#include "controls/jasplistcontrol.h"
#include "analysisform.h"

using namespace std;

Expand Down Expand Up @@ -123,6 +124,9 @@ void ListModelInteractionAssigned::_addTerms(const Terms& terms, bool combineWit

void ListModelInteractionAssigned::availableTermsResetHandler(Terms termsAdded, Terms termsRemoved)
{
if (listView()->form() && !listView()->form()->initialized())
return;

if (termsAdded.size() > 0 && listView()->addAvailableVariablesToAssigned())
{
_addTerms(termsAdded, _addInteractionsByDefault);
Expand Down

0 comments on commit 9ed2728

Please sign in to comment.