diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2018-06-17 17:55:47 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2018-06-18 07:42:39 +0200 |
commit | c953aadcf82ee050102e228bf08bcff76886caaa (patch) | |
tree | 8587b76c9f1c2d81347c9afb5236a5f714ba8334 /qt-models/weightmodel.cpp | |
parent | 88e6ba2f61cb1cf92787d8bdd2be499744ac546d (diff) | |
download | subsurface-c953aadcf82ee050102e228bf08bcff76886caaa.tar.gz |
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>
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r-- | qt-models/weightmodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp index de2587adc..77114eaea 100644 --- a/qt-models/weightmodel.cpp +++ b/qt-models/weightmodel.cpp @@ -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); } |