Skip to content

Commit

Permalink
An enhanced fix for the r5084 fix that was a fix for r5080.
Browse files Browse the repository at this point in the history
Yes, there needed to be a check for the returned value of the data provider (not so much the QgsMapLayer) - this has been adjusted.  The same check is now also applied to the processing of vector layers - after all that's where I copy/pasted the code from.



git-svn-id: http://svn.osgeo.org/qgis/trunk@5098 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
morb_au committed Mar 24, 2006
1 parent d794c38 commit 587b77e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gui/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4867,7 +4867,8 @@ void QgisApp::activateDeactivateLayerRelatedActions(const QgsMapLayer* layer)

const QgsVectorLayer* vlayer = dynamic_cast<const QgsVectorLayer*>(layer);
const QgsVectorDataProvider* dprovider = vlayer->getDataProvider();
if(vlayer)

if (dprovider)
{
//does provider allow deleting of features?
if(dprovider->capabilities() & QgsVectorDataProvider::DeleteFeatures)
Expand Down Expand Up @@ -4954,11 +4955,11 @@ void QgisApp::activateDeactivateLayerRelatedActions(const QgsMapLayer* layer)
mActionMoveVertex->setEnabled(false);

const QgsRasterLayer* vlayer = dynamic_cast<const QgsRasterLayer*> (layer);
if (vlayer)
const QgsRasterDataProvider* dprovider = vlayer->getDataProvider();
if (dprovider)
{
const QgsRasterDataProvider* dprovider = vlayer->getDataProvider();
// does provider allow the identify map tool?
if ( dprovider && (dprovider->capabilities() & QgsRasterDataProvider::Identify))
if (dprovider->capabilities() & QgsRasterDataProvider::Identify)
{
mActionIdentify->setEnabled(TRUE);
}
Expand Down

0 comments on commit 587b77e

Please sign in to comment.