mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Dive sites: remove LocationInformationModel::setData() function
Editing of dive sites does not work via this model and the function was broken anyway (it didn't subtract 2 from the index). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
43e6359f40
commit
65ca3444f5
2 changed files with 0 additions and 16 deletions
|
@ -137,21 +137,6 @@ QStringList LocationInformationModel::allSiteNames() const
|
|||
return locationNames;
|
||||
}
|
||||
|
||||
bool LocationInformationModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
if (!index.isValid() || index.row() < 2)
|
||||
return false;
|
||||
|
||||
if (role != Qt::EditRole)
|
||||
return false;
|
||||
|
||||
struct dive_site *ds = get_dive_site(index.row());
|
||||
free(ds->name);
|
||||
ds->name = copy_qstring(value.toString());
|
||||
emit dataChanged(index, index);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LocationInformationModel::removeRows(int row, int, const QModelIndex&)
|
||||
{
|
||||
if(row >= rowCount())
|
||||
|
|
|
@ -24,7 +24,6 @@ public:
|
|||
int columnCount(const QModelIndex &parent) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
||||
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
||||
void setFirstRowTextField(QLineEdit *textField);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue