summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-26 10:26:58 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-26 10:26:58 -0300
commitfd7a671a1d60dab5da17c5c1678dff4673925396 (patch)
tree9020e26b269d6523b4ffcba5d6dd408790352e76 /qt-ui/modeldelegates.cpp
parente6be14bf104e608f80c9ef1539ea5c51b92793f9 (diff)
downloadsubsurface-fd7a671a1d60dab5da17c5c1678dff4673925396.tar.gz
Set the Cylinder/Weigth even if it's the same old value.
Since the cylinders and weigths have other data attached to it, like size and working pressure, one could mess the other data and want it to revert to the cylinder / weigth defaults, but for that the user had to choose another item, then go back to the previous one, so the cache would be clean. This patch fixes that by reverting the values to the it fixes linus bug n2, where he had invalid data on the other fields and had to go back and forth for it to be fixed. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index ab91f1673..c75485788 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -185,11 +185,6 @@ void TankInfoDelegate::setModelData(QWidget* editor, QAbstractItemModel* model,
int tankSize = tanks->data(tanks->index(row, TankInfoModel::ML)).toInt();
int tankPressure = tanks->data(tanks->index(row, TankInfoModel::BAR)).toInt();
- // don't fuck the other data, jimmy.
- if ( mymodel->data(thisindex, CylindersModel::TYPE).toString() == currCombo.activeText){
- return;
- }
-
mymodel->setData(IDX(CylindersModel::TYPE), currCombo.activeText, Qt::EditRole);
mymodel->passInData(IDX(CylindersModel::WORKINGPRESS), tankPressure);
mymodel->passInData(IDX(CylindersModel::SIZE), tankSize);
@@ -253,10 +248,6 @@ void WSInfoDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, co
int grams = wsim->data(wsim->index(row, WSInfoModel::GR)).toInt();
QVariant v = QString(currCombo.activeText);
- // don't set if it's the same as it was before setting.
- if (mymodel->data(thisindex, WeightModel::TYPE).toString() == currCombo.activeText){
- return;
- }
mymodel->setData(IDX(WeightModel::TYPE), v, Qt::EditRole);
mymodel->passInData(IDX(WeightModel::WEIGHT), grams);
}