Git commit 76394c3aa77454bd9d53f60b7f4982c00848afbe by Alex Richardson. Committed on 21/03/2013 at 13:42. Pushed by arichardson into branch 'master'. structures: fix validation not working M +2 -2 kasten/controllers/view/structures/script/scripthandler.cpp M +2 -3 kasten/controllers/view/structures/structview.cpp http://commits.kde.org/okteta/76394c3aa77454bd9d53f60b7f4982c00848afbe diff --git a/kasten/controllers/view/structures/script/scripthandler.cpp b/= kasten/controllers/view/structures/script/scripthandler.cpp index 5a11100..8b5a5ff 100644 --- a/kasten/controllers/view/structures/script/scripthandler.cpp +++ b/kasten/controllers/view/structures/script/scripthandler.cpp @@ -60,7 +60,7 @@ void ScriptHandler::validateData(DataInformation* data) = //check if has a validation function: QScriptValue validationFunc =3D data->validationFunc(); - if (!validationFunc.isValid()) + if (validationFunc.isValid()) { #ifdef OKTETA_DEBUG_SCRIPT mDebugger->attachTo(mEngine.data()); @@ -94,8 +94,8 @@ void ScriptHandler::validateData(DataInformation* data) if (!str.isEmpty()) data->setValidationError(str); } + data->mHasBeenValidated =3D true; } - data->mHasBeenValidated =3D true; } = void ScriptHandler::updateDataInformation(DataInformation* data) diff --git a/kasten/controllers/view/structures/structview.cpp b/kasten/con= trollers/view/structures/structview.cpp index 5184bf7..7b1b9c5 100644 --- a/kasten/controllers/view/structures/structview.cpp +++ b/kasten/controllers/view/structures/structview.cpp @@ -72,8 +72,7 @@ StructView::StructView(StructTool* tool, QWidget* parent)= : mStructTreeView->setItemsExpandable(true); mStructTreeView->setUniformRowHeights(true); mStructTreeView->setAllColumnsShowFocus(true); - mStructTreeView->setEditTriggers(QAbstractItemView::DoubleClicked - | QAbstractItemView::EditKeyPressed); + mStructTreeView->setEditTriggers(QAbstractItemView::DoubleClicked | QA= bstractItemView::EditKeyPressed); mStructTreeView->setItemDelegate(mDelegate); mStructTreeView->setDragEnabled(false); mStructTreeView->setSortingEnabled(false); @@ -289,7 +288,7 @@ void StructView::onByteArrayModelChanged(Okteta::Abstra= ctByteArrayModel* model) QModelIndex current =3D mStructTreeView->currentIndex(); mLockStructureButton->setEnabled(mTool->canStructureBeLocked(current)); setLockButtonState(mTool->isStructureLocked(current)); - mValidateButton->setEnabled(validModel && current.isValid()); + mValidateButton->setEnabled(validModel); } = }