@@ -63,7 +63,7 @@ void QgsMeasureTool::activate()
63
63
mRightMouseClicked = false ;
64
64
65
65
// ensure that we have correct settings
66
- updateProjection ();
66
+ updateSettings ();
67
67
68
68
// If we suspect that they have data that is projected, yet the
69
69
// map CRS is set to a geographic one, warn them.
@@ -93,17 +93,11 @@ void QgsMeasureTool::deactivate()
93
93
94
94
void QgsMeasureTool::restart ()
95
95
{
96
- updateProjection ();
97
96
mPoints .clear ();
98
-
99
97
mRubberBand ->reset ( mMeasureArea );
100
98
101
- // re-read color settings
102
- QSettings settings;
103
- int myRed = settings.value ( " /qgis/default_measure_color_red" , 180 ).toInt ();
104
- int myGreen = settings.value ( " /qgis/default_measure_color_green" , 180 ).toInt ();
105
- int myBlue = settings.value ( " /qgis/default_measure_color_blue" , 180 ).toInt ();
106
- mRubberBand ->setColor ( QColor ( myRed, myGreen, myBlue ) );
99
+ // re-read settings
100
+ updateSettings ();
107
101
108
102
mRightMouseClicked = false ;
109
103
mWrongProjectProjection = false ;
@@ -114,18 +108,9 @@ void QgsMeasureTool::restart()
114
108
115
109
116
110
117
- void QgsMeasureTool::updateProjection ()
111
+ void QgsMeasureTool::updateSettings ()
118
112
{
119
- // set ellipsoid
120
113
QSettings settings;
121
- // QString ellipsoid = settings.readEntry("/qgis/measure/ellipsoid", "WGS84");
122
- // mCalc->setEllipsoid(ellipsoid);
123
-
124
- // set source CRS and projections enabled flag
125
- // QgsMapRenderer* mapRender = mCanvas->mapRenderer();
126
- // mCalc->setProjectionsEnabled(mapRender->hasCrsTransformEnabled());
127
- // int srsid = mapRender->destinationSrs().srsid();
128
- // mCalc->setSourceCrs(srsid);
129
114
130
115
int myRed = settings.value ( " /qgis/default_measure_color_red" , 180 ).toInt ();
131
116
int myGreen = settings.value ( " /qgis/default_measure_color_green" , 180 ).toInt ();
@@ -184,12 +169,6 @@ void QgsMeasureTool::addPoint( QgsPoint &point )
184
169
{
185
170
QgsDebugMsg ( " point=" + point.toString () );
186
171
187
- if ( mWrongProjectProjection )
188
- {
189
- updateProjection ();
190
- mWrongProjectProjection = false ;
191
- }
192
-
193
172
// don't add points with the same coordinates
194
173
if ( mPoints .size () > 0 && point == mPoints [0 ] )
195
174
return ;
0 commit comments