Skip to content

Commit 147876d

Browse files
author
wonder
committedMay 1, 2007
Fixed another incorrect QgsMessageViewer usage.
(QGIS was crashing on second WMS identify request) git-svn-id: http://svn.osgeo.org/qgis/trunk@6922 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 5340f7e commit 147876d

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed
 

‎src/app/qgsmaptoolidentify.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
QgsMapToolIdentify::QgsMapToolIdentify(QgsMapCanvas* canvas)
4141
: QgsMapTool(canvas),
4242
mResults(0),
43-
mViewer(0),
4443
mRubberBand(0)
4544
{
4645
// set cursor
@@ -55,11 +54,6 @@ QgsMapToolIdentify::~QgsMapToolIdentify()
5554
mResults->done(0);
5655
}
5756

58-
if (mViewer)
59-
{
60-
delete mViewer;
61-
}
62-
6357
delete mRubberBand;
6458
}
6559

@@ -179,16 +173,11 @@ void QgsMapToolIdentify::identifyRasterWmsLayer(QgsRasterLayer* layer, const Qgs
179173
return;
180174
}
181175

182-
if (!mViewer)
183-
{
184-
mViewer = new QgsMessageViewer();
185-
}
186-
187-
mViewer->setCaption( layer->name() );
188-
mViewer->setMessageAsPlainText( text );
176+
QgsMessageViewer* viewer = new QgsMessageViewer();
177+
viewer->setCaption( layer->name() );
178+
viewer->setMessageAsPlainText( text );
189179

190-
// mViewer->exec();
191-
mViewer->show();
180+
viewer->showMessage(); // deletes itself on close
192181
}
193182

194183
void QgsMapToolIdentify::identifyVectorLayer(QgsVectorLayer* layer, const QgsPoint& point)

‎src/app/qgsmaptoolidentify.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <QObject>
2424

2525
class QgsIdentifyResults;
26-
class QgsMessageViewer;
2726
class QgsMapLayer;
2827
class QgsRasterLayer;
2928
class QgsRubberBand;
@@ -95,9 +94,6 @@ class QgsMapToolIdentify : public QgsMapTool
9594
//! Pointer to the identify results dialog for name/value pairs
9695
QgsIdentifyResults *mResults;
9796

98-
//! Pointer to the identify results dialog for WMS XML files
99-
QgsMessageViewer * mViewer;
100-
10197
//! Rubber band for highlighting identified feature
10298
QgsRubberBand* mRubberBand;
10399

0 commit comments

Comments
 (0)
Please sign in to comment.