mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
887f9e63c3
commit
e38595f684
2 changed files with 12 additions and 12 deletions
|
@ -455,8 +455,8 @@ weight_t string_to_weight(const char *str)
|
||||||
const char *end;
|
const char *end;
|
||||||
double value = strtod_flags(str, &end, 0);
|
double value = strtod_flags(str, &end, 0);
|
||||||
QString rest = QString(end).trimmed();
|
QString rest = QString(end).trimmed();
|
||||||
QString local_kg = WeightModel::tr("kg");
|
QString local_kg = QObject::tr("kg");
|
||||||
QString local_lbs = WeightModel::tr("lbs");
|
QString local_lbs = QObject::tr("lbs");
|
||||||
weight_t weight;
|
weight_t weight;
|
||||||
|
|
||||||
if (rest.startsWith("kg") || rest.startsWith(local_kg))
|
if (rest.startsWith("kg") || rest.startsWith(local_kg))
|
||||||
|
@ -480,8 +480,8 @@ depth_t string_to_depth(const char *str)
|
||||||
const char *end;
|
const char *end;
|
||||||
double value = strtod_flags(str, &end, 0);
|
double value = strtod_flags(str, &end, 0);
|
||||||
QString rest = QString(end).trimmed();
|
QString rest = QString(end).trimmed();
|
||||||
QString local_ft = WeightModel::tr("ft");
|
QString local_ft = QObject::tr("ft");
|
||||||
QString local_m = WeightModel::tr("m");
|
QString local_m = QObject::tr("m");
|
||||||
depth_t depth;
|
depth_t depth;
|
||||||
|
|
||||||
if (rest.startsWith("m") || rest.startsWith(local_m))
|
if (rest.startsWith("m") || rest.startsWith(local_m))
|
||||||
|
@ -504,8 +504,8 @@ pressure_t string_to_pressure(const char *str)
|
||||||
const char *end;
|
const char *end;
|
||||||
double value = strtod_flags(str, &end, 0);
|
double value = strtod_flags(str, &end, 0);
|
||||||
QString rest = QString(end).trimmed();
|
QString rest = QString(end).trimmed();
|
||||||
QString local_psi = CylindersModel::tr("psi");
|
QString local_psi = QObject::tr("psi");
|
||||||
QString local_bar = CylindersModel::tr("bar");
|
QString local_bar = QObject::tr("bar");
|
||||||
pressure_t pressure;
|
pressure_t pressure;
|
||||||
|
|
||||||
if (rest.startsWith("bar") || rest.startsWith(local_bar))
|
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;
|
const char *end;
|
||||||
double value = strtod_flags(str, &end, 0);
|
double value = strtod_flags(str, &end, 0);
|
||||||
QString rest = QString(end).trimmed();
|
QString rest = QString(end).trimmed();
|
||||||
QString local_l = CylindersModel::tr("l");
|
QString local_l = QObject::tr("l");
|
||||||
QString local_cuft = CylindersModel::tr("cuft");
|
QString local_cuft = QObject::tr("cuft");
|
||||||
volume_t volume;
|
volume_t volume;
|
||||||
|
|
||||||
if (rest.startsWith("l") || rest.startsWith("ℓ") || rest.startsWith(local_l))
|
if (rest.startsWith("l") || rest.startsWith("ℓ") || rest.startsWith(local_l))
|
||||||
|
|
|
@ -517,7 +517,7 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData)
|
||||||
* </DiveDateReader>
|
* </DiveDateReader>
|
||||||
*/
|
*/
|
||||||
QXmlStreamReader reader(xmlData);
|
QXmlStreamReader reader(xmlData);
|
||||||
const QString invalidXmlError = DivelogsDeWebServices::tr("Invalid response from server");
|
const QString invalidXmlError = QObject::tr("Invalid response from server");
|
||||||
bool seenDiveDates = false;
|
bool seenDiveDates = false;
|
||||||
DiveListResult result;
|
DiveListResult result;
|
||||||
result.idCount = 0;
|
result.idCount = 0;
|
||||||
|
@ -525,7 +525,7 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData)
|
||||||
if (reader.readNextStartElement() && reader.name() != "DiveDateReader") {
|
if (reader.readNextStartElement() && reader.name() != "DiveDateReader") {
|
||||||
result.errorCondition = invalidXmlError;
|
result.errorCondition = invalidXmlError;
|
||||||
result.errorDetails =
|
result.errorDetails =
|
||||||
DivelogsDeWebServices::tr("Expected XML tag 'DiveDateReader', got instead '%1")
|
QObject::tr("Expected XML tag 'DiveDateReader', got instead '%1")
|
||||||
.arg(reader.name().toString());
|
.arg(reader.name().toString());
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -571,14 +571,14 @@ static DiveListResult parseDiveLogsDeDiveList(const QByteArray &xmlData)
|
||||||
|
|
||||||
if (!seenDiveDates) {
|
if (!seenDiveDates) {
|
||||||
result.errorCondition = invalidXmlError;
|
result.errorCondition = invalidXmlError;
|
||||||
result.errorDetails = DivelogsDeWebServices::tr("Expected XML tag 'DiveDates' not found");
|
result.errorDetails = QObject::tr("Expected XML tag 'DiveDates' not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (reader.hasError()) {
|
if (reader.hasError()) {
|
||||||
// if there was an XML error, overwrite the result or other error conditions
|
// if there was an XML error, overwrite the result or other error conditions
|
||||||
result.errorCondition = invalidXmlError;
|
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.lineNumber())
|
||||||
.arg(reader.errorString());
|
.arg(reader.errorString());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue