mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +00:00
CylindersModel: fold CHANGED() macro into setData()
The CHANGED macro was defined in the cleanerTableModel header. Since it had only one user, expand it there. The macro was very questionably anyway, as it would set the local "vString" variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a75360f58f
commit
66fc9fcfec
2 changed files with 3 additions and 6 deletions
|
@ -31,8 +31,4 @@ private:
|
|||
QStringList headers;
|
||||
};
|
||||
|
||||
/* Has the string value changed */
|
||||
#define CHANGED() \
|
||||
(vString = value.toString()) != data(index, role).toString()
|
||||
|
||||
#endif
|
||||
|
|
|
@ -291,7 +291,6 @@ cylinder_t *CylindersModel::cylinderAt(const QModelIndex &index)
|
|||
|
||||
bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
QString vString;
|
||||
|
||||
if (!d)
|
||||
return false;
|
||||
|
@ -321,7 +320,9 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
|
|||
return false;
|
||||
}
|
||||
|
||||
bool changed = CHANGED();
|
||||
QString vString = value.toString();
|
||||
bool changed = vString != data(index, role).toString();
|
||||
|
||||
if (index.column() != TYPE && !changed)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue