1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 03:29:16 +02:00

qPrintable() -> qUtf8Printable()

This commit is contained in:
2025-01-04 00:18:27 +01:00
parent 2b967ce05e
commit ad13a5b0cf
40 changed files with 148 additions and 140 deletions

View File

@ -127,11 +127,11 @@ Data::Data(const QString &fileName, bool tryUnknown)
++it;
}
qWarning("%s:", qPrintable(fileName));
qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.find(suffix); it != _parsers.end()
&& it.key() == suffix; it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString()));
qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
} else if (tryUnknown) {
for (it = _parsers.begin(); it != _parsers.end(); it++) {
@ -144,10 +144,10 @@ Data::Data(const QString &fileName, bool tryUnknown)
file.reset();
}
qWarning("%s:", qPrintable(fileName));
qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.begin(); it != _parsers.end(); it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString()));
qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
_errorLine = 0;
_errorString = "Unknown format";

View File

@ -245,7 +245,7 @@ bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
/* The date H header is mandatory, but XCSOAR generates
files without it, so add a dummy date in such case */
qWarning("%s: Missing date header",
qPrintable(file->fileName()));
qUtf8Printable(file->fileName()));
ctx.date = QDate(1970, 1, 1);
}
if (!track) {

View File

@ -28,11 +28,12 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
char buffer[60];
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false;
}
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid OMH file", qPrintable(path));
qWarning("%s: invalid OMH file", qUtf8Printable(path));
return false;
}
@ -48,7 +49,7 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), QTimeZone::utc());
if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path));
qWarning("%s: invalid date", qUtf8Printable(path));
return false;
}
@ -183,11 +184,12 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
char buffer[96];
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false;
}
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid GHT file", qPrintable(path));
qWarning("%s: invalid GHT file", qUtf8Printable(path));
return false;
}
@ -202,7 +204,7 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), QTimeZone::utc());
if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path));
qWarning("%s: invalid date", qUtf8Printable(path));
return false;
}

View File

@ -108,8 +108,8 @@ TreeNode<QString> POI::loadDir(const QString &path)
if (loadFile(fi.absoluteFilePath()))
tree.addItem(fi.absoluteFilePath());
else
qWarning("%s: %s", qPrintable(fi.absoluteFilePath()),
qPrintable(_errorString));
qWarning("%s: %s", qUtf8Printable(fi.absoluteFilePath()),
qUtf8Printable(_errorString));
}
}

View File

@ -3,7 +3,7 @@
void SLFParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text);
}

View File

@ -4,7 +4,7 @@
void TCXParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text);
}

View File

@ -140,8 +140,7 @@ Track::Track(const TrackData &data) : _pause(0)
bool hasTime = !std::isnan(seg.time.first());
for (int j = 1; j < sd.size(); j++) {
ds = sd.at(j).coordinates().distanceTo(
sd.at(j-1).coordinates());
ds = sd.at(j).coordinates().distanceTo(sd.at(j-1).coordinates());
seg.distance.append(seg.distance.last() + ds);
if (hasTime && sd.at(j).timestamp().isValid()) {
@ -149,16 +148,16 @@ Track::Track(const TrackData &data) : _pause(0)
dt = sd.at(j-1).timestamp().msecsTo(
sd.at(j).timestamp()) / 1000.0;
else {
qWarning("%s: %s: time skew detected", qPrintable(
_data.name()), qPrintable(sd.at(j).timestamp().toString(
Qt::ISODate)));
qWarning("%s: %s: time skew detected",
qUtf8Printable(_data.name()),
qUtf8Printable(sd.at(j).timestamp().toString(Qt::ISODate)));
dt = 0;
}
} else {
dt = NAN;
if (hasTime) {
qWarning("%s: missing timestamp(s), time graphs disabled",
qPrintable(_data.name()));
qUtf8Printable(_data.name()));
hasTime = false;
for (int i = 0; i < seg.time.size(); i++)
seg.time[i] = NAN;

View File

@ -37,7 +37,7 @@ void Waypoint::loadSymbolIcons(const QString &dir)
QPixmap pm(files.at(i).absoluteFilePath());
if (pm.isNull())
qWarning("%s: error loading image",
qPrintable(files.at(i).absoluteFilePath()));
qUtf8Printable(files.at(i).absoluteFilePath()));
else
_symbolIcons.insert(files.at(i).baseName(), pm);
}