Fixed another incorrect QgsMessageViewer usage.

(QGIS was crashing on second WMS identify request)


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6922 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2007-05-01 10:07:27 +00:00
parent 9c49b9ecc1
commit a317d5489d
2 changed files with 4 additions and 19 deletions

View File

@ -40,7 +40,6 @@
QgsMapToolIdentify::QgsMapToolIdentify(QgsMapCanvas* canvas)
: QgsMapTool(canvas),
mResults(0),
mViewer(0),
mRubberBand(0)
{
// set cursor
@ -55,11 +54,6 @@ QgsMapToolIdentify::~QgsMapToolIdentify()
mResults->done(0);
}
if (mViewer)
{
delete mViewer;
}
delete mRubberBand;
}
@ -179,16 +173,11 @@ void QgsMapToolIdentify::identifyRasterWmsLayer(QgsRasterLayer* layer, const Qgs
return;
}
if (!mViewer)
{
mViewer = new QgsMessageViewer();
}
QgsMessageViewer* viewer = new QgsMessageViewer();
viewer->setCaption( layer->name() );
viewer->setMessageAsPlainText( text );
mViewer->setCaption( layer->name() );
mViewer->setMessageAsPlainText( text );
// mViewer->exec();
mViewer->show();
viewer->showMessage(); // deletes itself on close
}
void QgsMapToolIdentify::identifyVectorLayer(QgsVectorLayer* layer, const QgsPoint& point)

View File

@ -23,7 +23,6 @@
#include <QObject>
class QgsIdentifyResults;
class QgsMessageViewer;
class QgsMapLayer;
class QgsRasterLayer;
class QgsRubberBand;
@ -95,9 +94,6 @@ class QgsMapToolIdentify : public QgsMapTool
//! Pointer to the identify results dialog for name/value pairs
QgsIdentifyResults *mResults;
//! Pointer to the identify results dialog for WMS XML files
QgsMessageViewer * mViewer;
//! Rubber band for highlighting identified feature
QgsRubberBand* mRubberBand;