Change from gettextFromC::instance()->tr() to gettextFromC::tr();

Code cleanup.

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2018-06-17 17:55:47 +02:00 committed by bstoeger
parent 88e6ba2f61
commit c953aadcf8
9 changed files with 18 additions and 18 deletions

View file

@ -253,7 +253,7 @@ QVariant DivePlannerPointsModel::data(const QModelIndex &index, int role) const
else
return p.time / 60;
case DIVEMODE:
return gettextFromC::instance()->tr(divemode_text_ui[p.divemode]);
return gettextFromC::tr(divemode_text_ui[p.divemode]);
case GAS:
/* Check if we have the same gasmix two or more times
* If yes return more verbose string */

View file

@ -84,7 +84,7 @@ void DiveTypeSelectionModel::repopulate()
{
QStringList modes = QStringList();
for (int i = 0; i < FREEDIVE; i++)
modes.append(gettextFromC::instance()->tr(divemode_text_ui[i]));
modes.append(gettextFromC::tr(divemode_text_ui[i]));
setStringList(modes);
}

View file

@ -92,7 +92,7 @@ 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++, rows++) {
QString infoName = gettextFromC::instance()->tr(info->name);
QString infoName = gettextFromC::tr(info->name);
if (infoName.count() > biggerEntry.count())
biggerEntry = infoName;
}

View file

@ -58,7 +58,7 @@ QVariant WeightModel::data(const QModelIndex &index, int role) const
case Qt::EditRole:
switch (index.column()) {
case TYPE:
ret = gettextFromC::instance()->tr(ws->description);
ret = gettextFromC::tr(ws->description);
break;
case WEIGHT:
ret = get_weight_string(ws->weight, true);
@ -104,11 +104,11 @@ bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int r
case TYPE:
if (!value.isNull()) {
//TODO: C-function weight_system_set_description ?
if (!ws->description || gettextFromC::instance()->tr(ws->description) != vString) {
if (!ws->description || gettextFromC::tr(ws->description) != vString) {
// loop over translations to see if one matches
int i = -1;
while (ws_info[++i].name) {
if (gettextFromC::instance()->tr(ws_info[i].name) == vString) {
if (gettextFromC::tr(ws_info[i].name) == vString) {
ws->description = copy_string(ws_info[i].name);
break;
}
@ -125,7 +125,7 @@ bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int r
// now update the ws_info
changed = true;
WSInfoModel *wsim = WSInfoModel::instance();
QModelIndexList matches = wsim->match(wsim->index(0, 0), Qt::DisplayRole, gettextFromC::instance()->tr(ws->description));
QModelIndexList matches = wsim->match(wsim->index(0, 0), Qt::DisplayRole, gettextFromC::tr(ws->description));
if (!matches.isEmpty())
wsim->setData(wsim->index(matches.first().row(), WSInfoModel::GR), ws->weight.grams);
}

View file

@ -58,7 +58,7 @@ QVariant WSInfoModel::data(const QModelIndex &index, int role) const
ret = gr;
break;
case DESCRIPTION:
ret = gettextFromC::instance()->tr(info->name);
ret = gettextFromC::tr(info->name);
break;
}
break;
@ -81,7 +81,7 @@ WSInfoModel::WSInfoModel() : rows(-1)
setHeaderDataStrings(QStringList() << tr("Description") << tr("kg"));
struct ws_info_t *info = ws_info;
for (info = ws_info; info->name; info++, rows++) {
QString wsInfoName = gettextFromC::instance()->tr(info->name);
QString wsInfoName = gettextFromC::tr(info->name);
if (wsInfoName.count() > biggerEntry.count())
biggerEntry = wsInfoName;
}
@ -99,7 +99,7 @@ void WSInfoModel::updateInfo()
endRemoveRows();
rows = -1;
for (info = ws_info; info->name; info++, rows++) {
QString wsInfoName = gettextFromC::instance()->tr(info->name);
QString wsInfoName = gettextFromC::tr(info->name);
if (wsInfoName.count() > biggerEntry.count())
biggerEntry = wsInfoName;
}