summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-01 16:34:51 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-01 18:19:52 +0000
commite589217bbf671a738a055652a1b19cfaa6f32099 (patch)
tree2fc5fc717b6776650245ef0f544d90ad9d45ced6
parent2d467627ea371af16ef39498b748fe1843d8d89a (diff)
downloadqtlocation-e589217bbf671a738a055652a1b19cfaa6f32099.tar.gz
Use QDebugStateSaver to restore space setting in stream operators.
Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I1ced3c46e18aba788298b6d9f60737b1004c6e9c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--src/positioning/qdoublevector2d.cpp3
-rw-r--r--src/positioning/qdoublevector3d.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/positioning/qdoublevector2d.cpp b/src/positioning/qdoublevector2d.cpp
index 0aaec56c..b2ed2e68 100644
--- a/src/positioning/qdoublevector2d.cpp
+++ b/src/positioning/qdoublevector2d.cpp
@@ -85,8 +85,9 @@ QDoubleVector3D QDoubleVector2D::toVector3D() const
QDebug operator<<(QDebug dbg, const QDoubleVector2D &vector)
{
+ QDebugStateSaver saver(dbg);
dbg.nospace() << "QDoubleVector2D(" << vector.x() << ", " << vector.y() << ')';
- return dbg.space();
+ return dbg;
}
#endif
diff --git a/src/positioning/qdoublevector3d.cpp b/src/positioning/qdoublevector3d.cpp
index 1c7066db..5e7ca936 100644
--- a/src/positioning/qdoublevector3d.cpp
+++ b/src/positioning/qdoublevector3d.cpp
@@ -104,9 +104,10 @@ double QDoubleVector3D::length() const
QDebug operator<<(QDebug dbg, const QDoubleVector3D &vector)
{
+ QDebugStateSaver saver(dbg);
dbg.nospace() << "QDoubleVector3D("
<< vector.x() << ", " << vector.y() << ", " << vector.z() << ')';
- return dbg.space();
+ return dbg;
}
#endif