Skip to content

Commit

Permalink
Fixed another incorrect QgsMessageViewer usage.
Browse files Browse the repository at this point in the history
(QGIS was crashing on second WMS identify request)


git-svn-id: http://svn.osgeo.org/qgis/trunk@6922 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 1, 2007
1 parent 5340f7e commit 147876d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
19 changes: 4 additions & 15 deletions src/app/qgsmaptoolidentify.cpp
Expand Up @@ -40,7 +40,6 @@
QgsMapToolIdentify::QgsMapToolIdentify(QgsMapCanvas* canvas)
: QgsMapTool(canvas),
mResults(0),
mViewer(0),
mRubberBand(0)
{
// set cursor
Expand All @@ -55,11 +54,6 @@ QgsMapToolIdentify::~QgsMapToolIdentify()
mResults->done(0);
}

if (mViewer)
{
delete mViewer;
}

delete mRubberBand;
}

Expand Down Expand Up @@ -179,16 +173,11 @@ void QgsMapToolIdentify::identifyRasterWmsLayer(QgsRasterLayer* layer, const Qgs
return;
}

if (!mViewer)
{
mViewer = new QgsMessageViewer();
}

mViewer->setCaption( layer->name() );
mViewer->setMessageAsPlainText( text );
QgsMessageViewer* viewer = new QgsMessageViewer();
viewer->setCaption( layer->name() );
viewer->setMessageAsPlainText( text );

// mViewer->exec();
mViewer->show();
viewer->showMessage(); // deletes itself on close
}

void QgsMapToolIdentify::identifyVectorLayer(QgsVectorLayer* layer, const QgsPoint& point)
Expand Down
4 changes: 0 additions & 4 deletions src/app/qgsmaptoolidentify.h
Expand Up @@ -23,7 +23,6 @@
#include <QObject>

class QgsIdentifyResults;
class QgsMessageViewer;
class QgsMapLayer;
class QgsRasterLayer;
class QgsRubberBand;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 147876d

Please sign in to comment.