@@ -64,20 +64,20 @@ void QgsMapToolIdentify::canvasPressEvent( QMouseEvent *e )
64
64
65
65
void QgsMapToolIdentify::canvasReleaseEvent ( QMouseEvent *e )
66
66
{
67
- Q_UNUSED ( e );
67
+ Q_UNUSED ( e );
68
68
}
69
69
70
- bool QgsMapToolIdentify::identify (int x, int y, QList<QgsMapLayer *> layerList, IdentifyMode mode)
70
+ bool QgsMapToolIdentify::identify ( int x, int y, QList<QgsMapLayer *> layerList, IdentifyMode mode )
71
71
{
72
- return identify (x, y, mode, layerList, AllLayers);
72
+ return identify ( x, y, mode, layerList, AllLayers );
73
73
}
74
74
75
- bool QgsMapToolIdentify::identify (int x, int y, IdentifyMode mode, LayerType layerType)
75
+ bool QgsMapToolIdentify::identify ( int x, int y, IdentifyMode mode, LayerType layerType )
76
76
{
77
- return identify (x, y, mode, QList<QgsMapLayer*>(), layerType);
77
+ return identify ( x, y, mode, QList<QgsMapLayer*>(), layerType );
78
78
}
79
79
80
- bool QgsMapToolIdentify::identify (int x, int y, IdentifyMode mode, QList<QgsMapLayer*> layerList, LayerType layerType )
80
+ bool QgsMapToolIdentify::identify ( int x, int y, IdentifyMode mode, QList<QgsMapLayer*> layerList, LayerType layerType )
81
81
{
82
82
bool res = false ;
83
83
@@ -89,13 +89,13 @@ bool QgsMapToolIdentify::identify(int x, int y, IdentifyMode mode, QList<QgsMapL
89
89
mResultData .mVectorResults .clear ();
90
90
mResultData .mRasterResults .clear ();
91
91
92
- if (mode == DefaultQgsSetting)
92
+ if ( mode == DefaultQgsSetting )
93
93
{
94
94
QSettings settings;
95
95
mode = static_cast <IdentifyMode>( settings.value ( " /Map/identifyMode" , 0 ).toInt () );
96
96
}
97
97
98
- if ( mode == ActiveLayer && ~ layerList.isEmpty ())
98
+ if ( mode == ActiveLayer && ! layerList.isEmpty () )
99
99
{
100
100
QgsMapLayer *layer = mCanvas ->currentLayer ();
101
101
@@ -116,20 +116,20 @@ bool QgsMapToolIdentify::identify(int x, int y, IdentifyMode mode, QList<QgsMapL
116
116
QStringList noIdentifyLayerIdList = QgsProject::instance ()->readListEntry ( " Identify" , " /disabledLayers" );
117
117
118
118
int layerCount;
119
- if (layerList.isEmpty ())
120
- layerCount = mCanvas ->layerCount ();
119
+ if ( layerList.isEmpty () )
120
+ layerCount = mCanvas ->layerCount ();
121
121
else
122
- layerCount = layerList.count ();
122
+ layerCount = layerList.count ();
123
123
124
124
125
125
for ( int i = 0 ; i < layerCount; i++ )
126
126
{
127
127
128
128
QgsMapLayer *layer ;
129
- if (layerList.isEmpty ())
130
- layer = mCanvas ->layer ( i );
129
+ if ( layerList.isEmpty () )
130
+ layer = mCanvas ->layer ( i );
131
131
else
132
- layer = layerList.value ( i );
132
+ layer = layerList.value ( i );
133
133
134
134
emit identifyProgress ( i, mCanvas ->layerCount () );
135
135
emit identifyMessage ( tr ( " Identifying on %1..." ).arg ( layer->name () ) );
@@ -166,11 +166,11 @@ void QgsMapToolIdentify::deactivate()
166
166
167
167
bool QgsMapToolIdentify::identifyLayer ( QgsMapLayer *layer, int x, int y, LayerType layerType )
168
168
{
169
- if ( layer->type () == QgsMapLayer::RasterLayer && (layerType== AllLayers || layerType== RasterLayer) )
169
+ if ( layer->type () == QgsMapLayer::RasterLayer && ( layerType == AllLayers || layerType == RasterLayer ) )
170
170
{
171
171
return identifyRasterLayer ( qobject_cast<QgsRasterLayer *>( layer ), x, y );
172
172
}
173
- else if ( layer->type () == QgsMapLayer::VectorLayer && (layerType== AllLayers || layerType== VectorLayer) )
173
+ else if ( layer->type () == QgsMapLayer::VectorLayer && ( layerType == AllLayers || layerType == VectorLayer ) )
174
174
{
175
175
return identifyVectorLayer ( qobject_cast<QgsVectorLayer *>( layer ), x, y );
176
176
}
@@ -322,7 +322,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
322
322
323
323
derivedAttributes.insert ( tr ( " feature id" ), fid < 0 ? tr ( " new feature" ) : FID_TO_STRING ( fid ) );
324
324
325
- mResultData .mVectorResults .append ( VectorResult (layer, *f_it, derivedAttributes) );
325
+ mResultData .mVectorResults .append ( VectorResult ( layer, *f_it, derivedAttributes ) );
326
326
}
327
327
328
328
if ( renderer && renderer->capabilities () & QgsFeatureRendererV2::ScaleDependent )
@@ -404,7 +404,7 @@ bool QgsMapToolIdentify::identifyRasterLayer( QgsRasterLayer *layer, int x, int
404
404
if ( attributes.size () > 0 )
405
405
{
406
406
derivedAttributes.insert ( tr ( " (clicked coordinate)" ), idPoint.toString () );
407
- mResultData .mRasterResults .append ( RasterResult (layer, type, attributes, derivedAttributes) );
407
+ mResultData .mRasterResults .append ( RasterResult ( layer, type, attributes, derivedAttributes ) );
408
408
}
409
409
410
410
return res;
@@ -424,10 +424,10 @@ void QgsMapToolIdentify::convertMeasurement( QgsDistanceArea &calc, double &meas
424
424
425
425
QGis::UnitType QgsMapToolIdentify::displayUnits ()
426
426
{
427
- return mCanvas ->mapUnits ();
427
+ return mCanvas ->mapUnits ();
428
428
}
429
429
430
430
QgsMapToolIdentify::IdentifyResults &QgsMapToolIdentify::results ()
431
431
{
432
- return mResultData ;
432
+ return mResultData ;
433
433
}
0 commit comments