Skip to content

Commit

Permalink
fix last bug and make code prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisGoosen committed Oct 10, 2024
1 parent a904529 commit 4c71cd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Desktop/data/datasetpackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ Column * DataSetPackage::requestComputedColumnCreation(const std::string & colum

bool DataSetPackage::requestColumnCreation(const std::string & columnName, Analysis * analysis, columnType type)
{
if(DataSetPackage::pkg()->isColumnNameFree(columnName))
if(!DataSetPackage::pkg()->isColumnNameFree(columnName))
return false;

createComputedColumn(columnName, type, computedColumnType::analysisNotComputed, analysis);
Expand Down
15 changes: 8 additions & 7 deletions QMLComponents/boundcontrols/boundcontrolbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ void BoundControlBase::handleComputedColumn(const Json::Value& value)
std::string newName = value.asString(),
orgName = orgValue.asString();

if (newName.empty() && !orgName.empty())
emit _control->requestComputedColumnDestruction(orgName);

else if (newName != orgName)
if (newName != orgName)
{
if (_isComputedColumn) emit _control->requestComputedColumnCreation(newName);
else emit _control->requestColumnCreation(newName, _columnType);

if (!orgName.empty())
emit _control->requestComputedColumnDestruction(orgName);

if(!newName.empty())
{
if (_isComputedColumn) emit _control->requestComputedColumnCreation(newName);
else emit _control->requestColumnCreation(newName, _columnType);
}

}
}
}
Expand Down
3 changes: 2 additions & 1 deletion QMLComponents/controls/textinputbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ void TextInputBase::setUp()

void TextInputBase::setDisplayValue()
{
setProperty("displayValue", _value);
if(property("displayValue") != _value)
setProperty("displayValue", _value);
}

void TextInputBase::rScriptDoneHandler(const QString &result)
Expand Down

0 comments on commit 4c71cd9

Please sign in to comment.