Skip to content
Permalink
Browse files

fix crash

git-svn-id: http://svn.osgeo.org/qgis/trunk@12987 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 1, 2010
1 parent 81e691e commit d7ee538ef29102bc23f0ad9d401cb153ba80dc45
Showing with 13 additions and 9 deletions.
  1. +10 −4 src/app/qgsidentifyresults.cpp
  2. +3 −5 src/app/qgsidentifyresults.h
@@ -47,12 +47,18 @@ static void _runPythonString( const QString &expr )
QgisApp::instance()->runPythonString( expr );
}

void QgsFeatureAction::execute()
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem )
: QAction( name, results )
, mLayer( vl )
, mAction( action )
{
int idx;
QList< QPair<QString, QString> > attributes;
mResults->retrieveAttributes( mFeatItem, attributes, idx );
mLayer->actions()->doAction( mAction, attributes, idx, _runPythonString );
results->retrieveAttributes( featItem, mAttributes, mIdx );
}

void QgsFeatureAction::execute()
{
mLayer->actions()->doAction( mAction, mAttributes, mIdx, _runPythonString );
}

class QgsIdentifyResultsDock : public QDockWidget
@@ -137,18 +137,16 @@ class QgsFeatureAction : public QAction
Q_OBJECT

public:
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem ) :
QAction( name, results ), mResults( results ), mLayer( vl ), mAction( action ), mFeatItem( featItem )
{}
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem );

public slots:
void execute();

private:
QgsIdentifyResults *mResults;
QgsVectorLayer *mLayer;
int mAction;
QTreeWidgetItem *mFeatItem;
int mIdx;
QList< QPair<QString, QString> > mAttributes;
};

#endif

0 comments on commit d7ee538

Please sign in to comment.
You can’t perform that action at this time.