1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

qWarning() mesage formating cleanup

This commit is contained in:
Martin Tůma 2018-09-24 23:07:11 +02:00
parent 351fc0309a
commit 9bae94f30d
8 changed files with 14 additions and 14 deletions

View File

@ -98,9 +98,9 @@ bool Data::loadFile(const QString &fileName)
file.reset(); file.reset();
} }
qWarning("Error loading data file: %s:\n", qPrintable(fileName)); qWarning("Error loading data file: %s:", qPrintable(fileName));
for (it = _parsers.begin(); it != _parsers.end(); it++) for (it = _parsers.begin(); it != _parsers.end(); it++)
qWarning("%s: line %d: %s\n", qPrintable(it.key()), qWarning("%s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString())); it.value()->errorLine(), qPrintable(it.value()->errorString()));
_errorLine = 0; _errorLine = 0;

View File

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

View File

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

View File

@ -90,7 +90,7 @@ bool Downloader::doDownload(const Download &dl,
QUrl url(dl.url()); QUrl url(dl.url());
if (!url.isValid() || !(url.scheme() == "http" || url.scheme() == "https")) { if (!url.isValid() || !(url.scheme() == "http" || url.scheme() == "https")) {
qWarning("%s: Invalid URL\n", qPrintable(url.toString())); qWarning("%s: Invalid URL", qPrintable(url.toString()));
if (redirect) if (redirect)
_errorDownloads.insert(redirect->origin(), RETRIES); _errorDownloads.insert(redirect->origin(), RETRIES);
return false; return false;
@ -138,7 +138,7 @@ bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
qWarning("Error writing file: %s: %s\n", qWarning("Error writing file: %s: %s",
qPrintable(filename), qPrintable(file.errorString())); qPrintable(filename), qPrintable(file.errorString()));
return false; return false;
} }
@ -166,11 +166,11 @@ void Downloader::downloadFinished(QNetworkReply *reply)
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl(); QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
if (origin.isEmpty()) { if (origin.isEmpty()) {
insertError(url, error); insertError(url, error);
qWarning("Error downloading file: %s: %s\n", qWarning("Error downloading file: %s: %s",
url.toEncoded().constData(), qPrintable(reply->errorString())); url.toEncoded().constData(), qPrintable(reply->errorString()));
} else { } else {
insertError(origin, error); insertError(origin, error);
qWarning("Error downloading file: %s -> %s: %s\n", qWarning("Error downloading file: %s -> %s: %s",
origin.toEncoded().constData(), url.toEncoded().constData(), origin.toEncoded().constData(), url.toEncoded().constData(),
qPrintable(reply->errorString())); qPrintable(reply->errorString()));
} }
@ -186,7 +186,7 @@ void Downloader::downloadFinished(QNetworkReply *reply)
if (level >= MAX_REDIRECT_LEVEL) { if (level >= MAX_REDIRECT_LEVEL) {
_errorDownloads.insert(origin, RETRIES); _errorDownloads.insert(origin, RETRIES);
qWarning("Error downloading file: %s: " qWarning("Error downloading file: %s: "
"redirect level limit reached (redirect loop?)\n", "redirect level limit reached (redirect loop?)",
origin.toEncoded().constData()); origin.toEncoded().constData());
} else { } else {
QUrl redirectUrl; QUrl redirectUrl;

View File

@ -96,7 +96,7 @@ bool Tar::loadTmi(const QString &path)
QByteArray line = file.readLine(); QByteArray line = file.readLine();
int pos = line.indexOf(':'); int pos = line.indexOf(':');
if (line.size() < 10 || pos < 7 || !line.startsWith("block")) { if (line.size() < 10 || pos < 7 || !line.startsWith("block")) {
qWarning("%s:%d: syntax error\n", qPrintable(path), ln); qWarning("%s:%d: syntax error", qPrintable(path), ln);
_index.clear(); _index.clear();
return false; return false;
} }

View File

@ -7,7 +7,7 @@
static bool loadTileFile(Tile &tile, const QString &file) static bool loadTileFile(Tile &tile, const QString &file)
{ {
if (!tile.pixmap().load(file)) { if (!tile.pixmap().load(file)) {
qWarning("%s: error loading tile file\n", qPrintable(file)); qWarning("%s: error loading tile file", qPrintable(file));
return false; return false;
} }
@ -18,7 +18,7 @@ TileLoader::TileLoader(const QString &dir, QObject *parent)
: QObject(parent), _dir(dir) : QObject(parent), _dir(dir)
{ {
if (!QDir().mkpath(_dir)) if (!QDir().mkpath(_dir))
qWarning("%s: %s\n", qPrintable(_dir), "Error creating tiles directory"); qWarning("%s: %s", qPrintable(_dir), "Error creating tiles directory");
_downloader = new Downloader(this); _downloader = new Downloader(this);
connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished())); connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished()));

View File

@ -118,7 +118,7 @@ void WMSMap::clearCache()
_zoom = 0; _zoom = 0;
if (!loadWMS()) if (!loadWMS())
qWarning("%s: %s\n", qPrintable(_name), qPrintable(_errorString)); qWarning("%s: %s", qPrintable(_name), qPrintable(_errorString));
} }
QRectF WMSMap::bounds() QRectF WMSMap::bounds()

View File

@ -52,7 +52,7 @@ void WMTSMap::clearCache()
_zoom = 0; _zoom = 0;
if (!loadWMTS()) if (!loadWMTS())
qWarning("%s: %s\n", qPrintable(_name), qPrintable(_errorString)); qWarning("%s: %s", qPrintable(_name), qPrintable(_errorString));
} }
QString WMTSMap::tilesDir() const QString WMTSMap::tilesDir() const