mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: remove biggerString() functions
The TankInfoModel and WeightInfoModel had biggerString() functions to determine the correct column widths for the tank- and weight-type columns. The users were removed around 2013. Remove these functions and the corresponding member variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ef76905590
commit
4f0fd86d35
4 changed files with 10 additions and 30 deletions
|
@ -71,20 +71,12 @@ int WSInfoModel::rowCount(const QModelIndex&) const
|
|||
return rows + 1;
|
||||
}
|
||||
|
||||
const QString &WSInfoModel::biggerString() const
|
||||
{
|
||||
return biggerEntry;
|
||||
}
|
||||
|
||||
WSInfoModel::WSInfoModel() : rows(-1)
|
||||
{
|
||||
setHeaderDataStrings(QStringList() << tr("Description") << tr("kg"));
|
||||
struct ws_info_t *info;
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++) {
|
||||
QString wsInfoName = gettextFromC::tr(info->name);
|
||||
if (wsInfoName.count() > biggerEntry.count())
|
||||
biggerEntry = wsInfoName;
|
||||
}
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++)
|
||||
;
|
||||
|
||||
if (rows > -1) {
|
||||
beginInsertRows(QModelIndex(), 0, rows);
|
||||
|
@ -98,11 +90,8 @@ void WSInfoModel::updateInfo()
|
|||
beginRemoveRows(QModelIndex(), 0, this->rows);
|
||||
endRemoveRows();
|
||||
rows = -1;
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++) {
|
||||
QString wsInfoName = gettextFromC::tr(info->name);
|
||||
if (wsInfoName.count() > biggerEntry.count())
|
||||
biggerEntry = wsInfoName;
|
||||
}
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++)
|
||||
;
|
||||
|
||||
if (rows > -1) {
|
||||
beginInsertRows(QModelIndex(), 0, rows);
|
||||
|
@ -118,7 +107,8 @@ void WSInfoModel::update()
|
|||
rows = -1;
|
||||
}
|
||||
struct ws_info_t *info;
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++);
|
||||
for (info = ws_info; info->name && info < ws_info + MAX_WS_INFO; info++, rows++)
|
||||
;
|
||||
|
||||
if (rows > -1) {
|
||||
beginInsertRows(QModelIndex(), 0, rows);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue