diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-04-25 21:10:05 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-25 21:10:05 -0700 |
commit | 1d0d42f861fc3a658eb22b99ba58616d716e095e (patch) | |
tree | 8c7f01bf5cdde01e6b9942740dcd547d43d0c06a /qt-ui | |
parent | 106659774ae83b7442f6cc749273248e07ff6c80 (diff) | |
download | subsurface-1d0d42f861fc3a658eb22b99ba58616d716e095e.tar.gz |
Remove the explicit UTF-8 conversions
Thanks to commit bdbfdcdfa0fb ('Ask Qt 4 to use the UTF-8 codec as the
"codec for C strings"') we no longer need the explicit UTF-8 conversion
when creating QStrings from char *.
Suggested-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/models.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 2fbfa9f88..5f803766f 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -301,7 +301,7 @@ public: ~DiveItem() { qDeleteAll(childlist); } int diveNumber() const { return dive->number; } - const QString diveDateTime() const { return QString::fromUtf8(get_dive_date_string(dive->when)); } + const QString diveDateTime() const { return get_dive_date_string(dive->when); } int diveDuration() const { return dive->duration.seconds; } int diveDepth() const { return dive->maxdepth.mm; } int diveSac() const { return dive->sac; } @@ -319,7 +319,7 @@ public: QString displayTemperature() const; QString displayWeight() const; QString displaySac() const; - const QString diveLocation() const { return QString::fromUtf8(dive->location); } + const QString diveLocation() const { return dive->location; } const QString diveSuit() const { return dive->suit; } DiveItem *parent() const { return parentItem; } const QList<DiveItem *>& children() const { return childlist; } @@ -511,7 +511,7 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int ret = tr("Date"); break; case RATING: - ret = QString::fromUtf8(UTF8_BLACKSTAR); + ret = UTF8_BLACKSTAR; break; case DEPTH: if (get_units()->length == units::METERS) @@ -524,9 +524,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int break; case TEMPERATURE: if (get_units()->temperature == units::CELSIUS) - ret = QString("%1%2").arg(QString::fromUtf8(UTF8_DEGREE)).arg("C"); + ret = QString("%1%2").arg(UTF8_DEGREE).arg("C"); else - ret = QString("%1%2").arg(QString::fromUtf8(UTF8_DEGREE)).arg("F"); + ret = QString("%1%2").arg(UTF8_DEGREE).arg("F"); break; case TOTALWEIGHT: if (get_units()->weight == units::KG) @@ -541,7 +541,7 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int ret = tr("Cyl"); break; case NITROX: - ret = QString("O%1%").arg(QString::fromUtf8(UTF8_SUBSCRIPT_2)); + ret = QString("O%1%").arg(UTF8_SUBSCRIPT_2); break; case SAC: ret = tr("SAC"); |