Skip to content

Commit

Permalink
Forgot this file
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb committed Dec 18, 2024
1 parent b39f6dd commit cea99e9
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions Desktop/data/datasetpackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,24 +1488,10 @@ bool DataSetPackage::initColumnWithStrings(QVariant colId, const std::string & n
{
JASPTIMER_SCOPE(DataSetPackage::initColumnWithStrings);

int colIndex = getColIndex(colId),
threshold = Settings::value(Settings::THRESHOLD_SCALE).toInt();
Column * column = _dataSet->columns()[colIndex];
column -> setHasCustomEmptyValues(emptyValues.size());
column -> setCustomEmptyValues(emptyValues);
column -> setName(newName);
column -> setTitle(title);
column -> beginBatchedLabelsDB();
bool anyChanges = title != column->title() || newName != column->name();
columnType prevType = column->type(),
suggestedType = column->setValues(values, labels, threshold, &anyChanges); //If less unique integers than the thresholdScale then we think it must be ordinal: https://github.com/jasp-stats/INTERNAL-jasp/issues/270
column -> setType(column->type() != columnType::unknown ? column->type() : desiredType == columnType::unknown ? suggestedType : desiredType);
column -> endBatchedLabelsDB();

if(PreferencesModel::prefs()->orderByValueByDefault())
column->labelsOrderByValue();

return anyChanges || column->type() != prevType;
return _dataSet->initColumnWithStrings(
getColIndex(colId), newName, values, labels, title, desiredType, emptyValues,
Settings::value(Settings::THRESHOLD_SCALE).toInt(),
PreferencesModel::prefs()->orderByValueByDefault());
}

void DataSetPackage::initializeComputedColumns()
Expand Down

0 comments on commit cea99e9

Please sign in to comment.