From 4f0fd86d3530cf921e63e8a462946a8dfccff5ae Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 27 Apr 2019 16:40:55 +0200 Subject: 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 --- qt-models/weightsysteminfomodel.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'qt-models/weightsysteminfomodel.cpp') diff --git a/qt-models/weightsysteminfomodel.cpp b/qt-models/weightsysteminfomodel.cpp index f8d2905cf..58cc0ba47 100644 --- a/qt-models/weightsysteminfomodel.cpp +++ b/qt-models/weightsysteminfomodel.cpp @@ -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); -- cgit v1.2.3-70-g09d2