File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6546,7 +6546,7 @@ void QgisApp::runPythonString( const QString &expr )
65466546{
65476547 if ( mPythonUtils && mPythonUtils ->isEnabled () )
65486548 {
6549- mPythonUtils ->runStringUnsafe ( expr );
6549+ mPythonUtils ->runString ( expr );
65506550 }
65516551}
65526552
Original file line number Diff line number Diff line change @@ -331,7 +331,8 @@ void QgsAttributeDialog::dialogDestroyed()
331331 mLayer->setProperty( "featureForm.dialog", QVariant() );
332332 mLayer->setProperty( "featureForm.id", QVariant() );
333333#endif
334- QgisApp::instance ()->runPythonString ( QString ( " del _qgis_featureform_%1" ).arg ( mLayer ->getLayerID () ) );
334+ QString expr = QString ( " if locals().has_key('_qgis_featureform_%1'): del _qgis_featureform_%1\n " ).arg ( mLayer ->getLayerID () );
335+ QgisApp::instance ()->runPythonString ( expr );
335336
336337 mDialog = NULL ;
337338 deleteLater ();
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ class PYTHON_EXPORT QgsPythonUtils
5050
5151 /* console */
5252
53+ // ! run a statement, show an error message on error
54+ // ! @return true if no error occured
55+ virtual bool runString ( const QString& command, QString msgOnError = QString() ) = 0;
56+
5357 // ! run a statement, error reporting is not done
5458 // ! @return true if no error occured
5559 virtual bool runStringUnsafe ( const QString& command, bool single = true ) = 0;
You can’t perform that action at this time.
0 commit comments