Skip to content

Commit

Permalink
close tools when mapset changed
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5197 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Apr 6, 2006
1 parent 47ce15f commit e204157
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -1264,6 +1264,10 @@ QgsGrassModule::~QgsGrassModule()
#ifdef QGISDEBUG
std::cerr << "QgsGrassModule::~QgsGrassModule()" << std::endl;
#endif
if ( mProcess.state() == QProcess::Running )
{
mProcess.kill();
}
}

QDomNode QgsGrassModule::nodeByKey ( QDomElement elem, QString key )
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -96,6 +96,7 @@ QgsGrassPlugin::QgsGrassPlugin(QgisApp * theQGisApp, QgisIface * theQgisInterFac

QgsGrassPlugin::~QgsGrassPlugin()
{
if ( mTools ) mTools->closeTools();
QString err = QgsGrass::closeMapset();
}

Expand Down Expand Up @@ -238,6 +239,8 @@ void QgsGrassPlugin::initGui()

void QgsGrassPlugin::mapsetChanged ()
{
if ( mTools ) mTools->closeTools();

if ( !QgsGrass::activeMode() ) {
mOpenToolsAction->setEnabled(false);
mRegionAction->setEnabled(false);
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -454,5 +454,6 @@ void QgsGrassTools::closeTools()
for ( int i = mTabWidget->count()-1; i > 1; i-- )
{
delete mTabWidget->widget(i);
mTabWidget->removeTab(i);
}
}

0 comments on commit e204157

Please sign in to comment.