Skip to content

Commit bc63fcd

Browse files
committedAug 28, 2013
correctly unload Globe plugin (fix #4185)
1 parent 6a9a58f commit bc63fcd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed
 

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,25 @@ void GlobePlugin::initGui()
194194
// Create the action for tool
195195
mQActionPointer = new QAction( QIcon( ":/globe/globe.png" ), tr( "Launch Globe" ), this );
196196
mQActionSettingsPointer = new QAction( QIcon( ":/globe/globe.png" ), tr( "Globe Settings" ), this );
197-
QAction* actionUnload = new QAction( tr( "Unload Globe" ), this );
197+
mQActionUnload = new QAction( tr( "Unload Globe" ), this );
198198

199199
// Set the what's this text
200200
mQActionPointer->setWhatsThis( tr( "Overlay data on a 3D globe" ) );
201201
mQActionSettingsPointer->setWhatsThis( tr( "Settings for 3D globe" ) );
202-
actionUnload->setWhatsThis( tr( "Unload globe" ) );
202+
mQActionUnload->setWhatsThis( tr( "Unload globe" ) );
203203

204204
// Connect actions
205205
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
206206
connect( mQActionSettingsPointer, SIGNAL( triggered() ), this, SLOT( settings() ) );
207-
connect( actionUnload, SIGNAL( triggered() ), this, SLOT( reset() ) );
207+
connect( mQActionUnload, SIGNAL( triggered() ), this, SLOT( reset() ) );
208208

209209
// Add the icon to the toolbar
210210
mQGisIface->addToolBarIcon( mQActionPointer );
211211

212212
//Add menu
213213
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionPointer );
214214
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionSettingsPointer );
215-
mQGisIface->addPluginToMenu( tr( "&Globe" ), actionUnload );
215+
mQGisIface->addPluginToMenu( tr( "&Globe" ), mQActionUnload );
216216

217217
connect( mQGisIface->mapCanvas() , SIGNAL( extentsChanged() ),
218218
this, SLOT( extentsChanged() ) );
@@ -778,8 +778,12 @@ void GlobePlugin::unload()
778778
{
779779
reset();
780780
// remove the GUI
781-
mQGisIface->removePluginMenu( "&Globe", mQActionPointer );
781+
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionPointer );
782+
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionSettingsPointer );
783+
mQGisIface->removePluginMenu( tr( "&Globe" ), mQActionUnload );
784+
782785
mQGisIface->removeToolBarIcon( mQActionPointer );
786+
783787
delete mQActionPointer;
784788
}
785789

‎src/plugins/globe/globe_plugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class GlobePlugin : public QObject, public QgisPlugin
125125
QAction * mQActionPointer;
126126
//!pointer to the qaction for this plugin
127127
QAction * mQActionSettingsPointer;
128+
QAction * mQActionUnload;
128129
//! OSG Viewer
129130
osgViewer::Viewer* mOsgViewer;
130131
//! QT viewer widget

0 commit comments

Comments
 (0)
Please sign in to comment.