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:
Berthold Stoeger 2019-04-27 16:40:55 +02:00 committed by Dirk Hohndel
parent ef76905590
commit 4f0fd86d35
4 changed files with 10 additions and 30 deletions

View file

@ -10,11 +10,6 @@ TankInfoModel *TankInfoModel::instance()
return &self;
}
const QString &TankInfoModel::biggerString() const
{
return biggerEntry;
}
bool TankInfoModel::insertRows(int, int count, const QModelIndex &parent)
{
beginInsertRows(parent, rowCount(), rowCount());
@ -91,11 +86,8 @@ TankInfoModel::TankInfoModel() : rows(-1)
{
setHeaderDataStrings(QStringList() << tr("Description") << tr("ml") << tr("bar"));
struct tank_info_t *info = tank_info;
for (info = tank_info; info->name && info < tank_info + MAX_TANK_INFO; info++, rows++) {
QString infoName = gettextFromC::tr(info->name);
if (infoName.count() > biggerEntry.count())
biggerEntry = infoName;
}
for (info = tank_info; info->name && info < tank_info + MAX_TANK_INFO; info++, rows++)
;
if (rows > -1) {
beginInsertRows(QModelIndex(), 0, rows);
@ -111,7 +103,8 @@ void TankInfoModel::update()
rows = -1;
}
struct tank_info_t *info = tank_info;
for (info = tank_info; info->name && info < tank_info + MAX_TANK_INFO; info++, rows++);
for (info = tank_info; info->name && info < tank_info + MAX_TANK_INFO; info++, rows++)
;
if (rows > -1) {
beginInsertRows(QModelIndex(), 0, rows);