diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-15 20:27:32 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-15 17:05:46 -0700 |
commit | e38595f68450011f24f45e45900dbb2119ce8355 (patch) | |
tree | d7df85ed05856129a676935f360a6057e43be009 /qt-ui | |
parent | 887f9e63c3705df52b802420e72f5854d75c8ca6 (diff) | |
download | subsurface-e38595f68450011f24f45e45900dbb2119ce8355.tar.gz |
Use QObject::tr instead of OurClasses::tr for functions
This will make more easy to move code around in the future.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/models.cpp | 16 | ||||
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index a0bb97aa7..4defd72d2 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -455,8 +455,8 @@ weight_t string_to_weight(const char *str) const char *end; double value = strtod_flags(str, &end, 0); QString rest = QString(end).trimmed(); - QString local_kg = WeightModel::tr("kg"); - QString local_lbs = WeightModel::tr("lbs"); + QString local_kg = QObject::tr("kg"); + QString local_lbs = QObject::tr("lbs"); weight_t weight; if (rest.startsWith("kg") || rest.startsWith(local_kg)) @@ -480,8 +480,8 @@ depth_t string_to_depth(const char *str) const char *end; double value = strtod_flags(str, &end, 0); QString rest = QString(end).trimmed(); - QString local_ft = WeightModel::tr("ft"); - QString local_m = WeightModel::tr("m"); + QString local_ft = QObject::tr("ft"); + QString local_m = QObject::tr("m"); depth_t depth; if (rest.startsWith("m") || rest.startsWith(local_m)) @@ -504,8 +504,8 @@ pressure_t string_to_pressure(const char *str) const char *end; double value = strtod_flags(str, &end, 0); QString rest = QString(end).trimmed(); - QString local_psi = CylindersModel::tr("psi"); - QString local_bar = CylindersModel::tr("bar"); + QString local_psi = QObject::tr("psi"); + QString local_bar = QObject::tr("bar"); pressure_t pressure; if (rest.startsWith("bar") || rest.startsWith(local_bar)) @@ -529,8 +529,8 @@ volume_t string_to_volume(const char *str, pressure_t workp) const char *end; double value = strtod_flags(str, &end, 0); QString rest = QString(end).trimmed(); - QString local_l = CylindersModel::tr("l"); - QString local_cuft = CylindersModel::tr("cuft"); + QString local_l = QObject::tr("l"); + QString local_cuft = QObject::tr("cuft"); volume_t volume; if (rest.startsWith("l") || rest.startsWith("ℓ") || rest.startsWith(local_l)) diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 219d10d8c..0514d89a9 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -517,7 +517,7 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData) * </DiveDateReader> */ QXmlStreamReader reader(xmlData); - const QString invalidXmlError = DivelogsDeWebServices::tr("Invalid response from server"); + const QString invalidXmlError = QObject::tr("Invalid response from server"); bool seenDiveDates = false; DiveListResult result; result.idCount = 0; @@ -525,7 +525,7 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData) if (reader.readNextStartElement() && reader.name() != "DiveDateReader") { result.errorCondition = invalidXmlError; result.errorDetails = - DivelogsDeWebServices::tr("Expected XML tag 'DiveDateReader', got instead '%1") + QObject::tr("Expected XML tag 'DiveDateReader', got instead '%1") .arg(reader.name().toString()); goto out; } @@ -571,14 +571,14 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData) if (!seenDiveDates) { result.errorCondition = invalidXmlError; - result.errorDetails = DivelogsDeWebServices::tr("Expected XML tag 'DiveDates' not found"); + result.errorDetails = QObject::tr("Expected XML tag 'DiveDates' not found"); } out: if (reader.hasError()) { // if there was an XML error, overwrite the result or other error conditions result.errorCondition = invalidXmlError; - result.errorDetails = DivelogsDeWebServices::tr("Malformed XML response. Line %1: %2") + result.errorDetails = QObject::tr("Malformed XML response. Line %1: %2") .arg(reader.lineNumber()) .arg(reader.errorString()); } |