mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 01:13:24 +00:00
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>
This commit is contained in:
parent
106659774a
commit
1d0d42f861
2 changed files with 8 additions and 8 deletions
|
@ -60,7 +60,7 @@ Translator::Translator(QObject *parent):
|
||||||
QString Translator::translate(const char *context, const char *sourceText,
|
QString Translator::translate(const char *context, const char *sourceText,
|
||||||
const char *disambiguation) const
|
const char *disambiguation) const
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(gettext(sourceText));
|
return gettext(sourceText);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GdkPixdata subsurface_icon_pixbuf = {};
|
static const GdkPixdata subsurface_icon_pixbuf = {};
|
||||||
|
@ -1795,7 +1795,7 @@ void MainWindow::setCurrentFileName(const QString &fileName)
|
||||||
|
|
||||||
void MainWindow::on_actionOpen_triggered()
|
void MainWindow::on_actionOpen_triggered()
|
||||||
{
|
{
|
||||||
QString defaultFileName = QString::fromUtf8(prefs.default_filename);
|
QString defaultFileName = prefs.default_filename;
|
||||||
QFileInfo fileInfo(defaultFileName);
|
QFileInfo fileInfo(defaultFileName);
|
||||||
|
|
||||||
QFileDialog dialog(this, tr("Open File"), fileInfo.path());
|
QFileDialog dialog(this, tr("Open File"), fileInfo.path());
|
||||||
|
|
|
@ -301,7 +301,7 @@ public:
|
||||||
~DiveItem() { qDeleteAll(childlist); }
|
~DiveItem() { qDeleteAll(childlist); }
|
||||||
|
|
||||||
int diveNumber() const { return dive->number; }
|
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 diveDuration() const { return dive->duration.seconds; }
|
||||||
int diveDepth() const { return dive->maxdepth.mm; }
|
int diveDepth() const { return dive->maxdepth.mm; }
|
||||||
int diveSac() const { return dive->sac; }
|
int diveSac() const { return dive->sac; }
|
||||||
|
@ -319,7 +319,7 @@ public:
|
||||||
QString displayTemperature() const;
|
QString displayTemperature() const;
|
||||||
QString displayWeight() const;
|
QString displayWeight() const;
|
||||||
QString displaySac() 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; }
|
const QString diveSuit() const { return dive->suit; }
|
||||||
DiveItem *parent() const { return parentItem; }
|
DiveItem *parent() const { return parentItem; }
|
||||||
const QList<DiveItem *>& children() const { return childlist; }
|
const QList<DiveItem *>& children() const { return childlist; }
|
||||||
|
@ -511,7 +511,7 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
ret = tr("Date");
|
ret = tr("Date");
|
||||||
break;
|
break;
|
||||||
case RATING:
|
case RATING:
|
||||||
ret = QString::fromUtf8(UTF8_BLACKSTAR);
|
ret = UTF8_BLACKSTAR;
|
||||||
break;
|
break;
|
||||||
case DEPTH:
|
case DEPTH:
|
||||||
if (get_units()->length == units::METERS)
|
if (get_units()->length == units::METERS)
|
||||||
|
@ -524,9 +524,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
break;
|
break;
|
||||||
case TEMPERATURE:
|
case TEMPERATURE:
|
||||||
if (get_units()->temperature == units::CELSIUS)
|
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
|
else
|
||||||
ret = QString("%1%2").arg(QString::fromUtf8(UTF8_DEGREE)).arg("F");
|
ret = QString("%1%2").arg(UTF8_DEGREE).arg("F");
|
||||||
break;
|
break;
|
||||||
case TOTALWEIGHT:
|
case TOTALWEIGHT:
|
||||||
if (get_units()->weight == units::KG)
|
if (get_units()->weight == units::KG)
|
||||||
|
@ -541,7 +541,7 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
ret = tr("Cyl");
|
ret = tr("Cyl");
|
||||||
break;
|
break;
|
||||||
case NITROX:
|
case NITROX:
|
||||||
ret = QString("O%1%").arg(QString::fromUtf8(UTF8_SUBSCRIPT_2));
|
ret = QString("O%1%").arg(UTF8_SUBSCRIPT_2);
|
||||||
break;
|
break;
|
||||||
case SAC:
|
case SAC:
|
||||||
ret = tr("SAC");
|
ret = tr("SAC");
|
||||||
|
|
Loading…
Add table
Reference in a new issue