summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-07-31 09:22:00 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-07-31 09:22:00 (GMT)
commitbe65f00925d916ed794e5bdea9996446f2c8f537 (patch)
treec14481c08b067d526ef2f9e7a2be2ba715ab34d3
parent0696a4c5d3b665895b0c2c6db28b822bbd290b4d (diff)
Report tile count in progress
-rw-r--r--tools/mbtile-import/MbTileWriter.cpp11
-rw-r--r--tools/mbtile-import/MbTileWriter.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/tools/mbtile-import/MbTileWriter.cpp b/tools/mbtile-import/MbTileWriter.cpp
index c9112d9..0d2c3b0 100644
--- a/tools/mbtile-import/MbTileWriter.cpp
+++ b/tools/mbtile-import/MbTileWriter.cpp
@@ -16,13 +16,15 @@
#include <QSqlError>
#include <iostream>
+#include <iomanip>
namespace Marble
{
MbTileWriter::MbTileWriter(const QString &filename, const QString &extension) :
m_overwriteTiles(true),
- m_reportProgress(true)
+ m_reportProgress(true),
+ m_tileCounter(0)
{
bool const exists = QFileInfo(filename).exists();
@@ -69,9 +71,14 @@ void MbTileWriter::setReportProgress(bool report)
void MbTileWriter::addTile(const QFileInfo &file, qint32 x, qint32 y, qint32 z)
{
+ ++m_tileCounter;
+
+ if (m_reportProgress) {
+ std::cout << "Tile " << std::right << std::setw(10) << m_tileCounter << ": ";
+ }
if (!m_overwriteTiles && haveTile(x, y, z)) {
if (m_reportProgress) {
- std::cout << "Skipping existing " << z << '/' << x << '/' << y << '\r';
+ std::cout << " Skipping existing " << z << '/' << x << '/' << y << '\r';
std::cout.flush();
}
return;
diff --git a/tools/mbtile-import/MbTileWriter.h b/tools/mbtile-import/MbTileWriter.h
index 39e10f3..bc3d19a 100644
--- a/tools/mbtile-import/MbTileWriter.h
+++ b/tools/mbtile-import/MbTileWriter.h
@@ -36,6 +36,7 @@ private:
bool m_overwriteTiles;
bool m_reportProgress;
+ int m_tileCounter;
};
}