Skip to content

Commit cd04da4

Browse files
author
jef
committedMar 1, 2010
fix crash
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12987 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed
 

‎src/app/qgsidentifyresults.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ static void _runPythonString( const QString &expr )
4747
QgisApp::instance()->runPythonString( expr );
4848
}
4949

50-
void QgsFeatureAction::execute()
50+
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem )
51+
: QAction( name, results )
52+
, mLayer( vl )
53+
, mAction( action )
5154
{
52-
int idx;
5355
QList< QPair<QString, QString> > attributes;
54-
mResults->retrieveAttributes( mFeatItem, attributes, idx );
55-
mLayer->actions()->doAction( mAction, attributes, idx, _runPythonString );
56+
results->retrieveAttributes( featItem, mAttributes, mIdx );
57+
}
58+
59+
void QgsFeatureAction::execute()
60+
{
61+
mLayer->actions()->doAction( mAction, mAttributes, mIdx, _runPythonString );
5662
}
5763

5864
class QgsIdentifyResultsDock : public QDockWidget

‎src/app/qgsidentifyresults.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,16 @@ class QgsFeatureAction : public QAction
137137
Q_OBJECT
138138

139139
public:
140-
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem ) :
141-
QAction( name, results ), mResults( results ), mLayer( vl ), mAction( action ), mFeatItem( featItem )
142-
{}
140+
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem );
143141

144142
public slots:
145143
void execute();
146144

147145
private:
148-
QgsIdentifyResults *mResults;
149146
QgsVectorLayer *mLayer;
150147
int mAction;
151-
QTreeWidgetItem *mFeatItem;
148+
int mIdx;
149+
QList< QPair<QString, QString> > mAttributes;
152150
};
153151

154152
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.