Skip to content

Commit

Permalink
Remove connections for no longer existing signals to eliminate warnin…
Browse files Browse the repository at this point in the history
…gs from the Qt debug libraries. (The currentLayerChanged slot has been replaced by activateDeactivateLayerRelatedActions and the updateLegendItem slot did nothing.)

git-svn-id: http://svn.osgeo.org/qgis/trunk@5104 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Mar 27, 2006
1 parent 14f574a commit b8e54a4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 100 deletions.
79 changes: 1 addition & 78 deletions src/gui/qgisapp.cpp
Expand Up @@ -1074,15 +1074,13 @@ void QgisApp::setupConnections()
connect(mMapCanvas, SIGNAL(extentsChanged(QgsRect )),this,SLOT(showExtents(QgsRect )));
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(showScale(QString)));
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(updateMouseCoordinatePrecision()));

connect(mMapLegend, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(currentLayerChanged(Q3ListViewItem *)));

connect(mRenderSuppressionCBox, SIGNAL(toggled(bool )), mMapCanvas, SLOT(setRenderFlag(bool)));
}
void QgisApp::createCanvas()
{
// "theMapCanvas" used to find this canonical instance later
mMapCanvas = new QgsMapCanvas(this, "theMapCanvas" );
mMapCanvas = new QgsMapCanvas(NULL, "theMapCanvas" );
QWhatsThis::add(mMapCanvas, tr("Map canvas. This is where raster and vector layers are displayed when added to the map"));

mMapCanvas->setMinimumWidth(10);
Expand Down Expand Up @@ -3777,81 +3775,6 @@ void QgisApp::zoomToLayerExtent()
} // QgisApp::zoomToLayerExtent()



void QgisApp::currentLayerChanged(Q3ListViewItem * lvi)
{
#ifdef QGISDEBUG
std::cout << "QgisApp::currentLayerChanged()" << std::endl;
#endif
if (lvi)
{
// disable/enable toolbar buttons as appropriate based on selected
// layer type

toolPopupCapture->setItemEnabled(0,FALSE);
toolPopupCapture->setItemEnabled(1,FALSE);
toolPopupCapture->setItemEnabled(2,FALSE);
toolPopupCapture->setItemEnabled(3,FALSE);


QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>(lvi);
if(llf)
{
QgsMapLayer *layer = llf->layer();
if (layer->type() == QgsMapLayer::RASTER)
{
//actionIdentify->setEnabled(FALSE);
mActionSelect->setEnabled(FALSE);
mActionOpenTable->setEnabled(FALSE);
}
else
{
//vector layer editing buttons
QgsMapLayer* mlayer=llf->layer();
if(mlayer)
{
QgsVectorLayer* vlayer=dynamic_cast<QgsVectorLayer*>(mlayer);
if(vlayer)
{
const QgsVectorDataProvider* provider=vlayer->getDataProvider();
if(provider)
{
int cap=vlayer->getDataProvider()->capabilities();
if(cap&QgsVectorDataProvider::DeleteFeatures)
{
toolPopupCapture->setItemEnabled(3,TRUE);
}
if(cap&QgsVectorDataProvider::AddFeatures)
{
if(vlayer->vectorType()==QGis::Point)
{
toolPopupCapture->setItemEnabled(0,TRUE);
}
else if(vlayer->vectorType()==QGis::Line)
{
toolPopupCapture->setItemEnabled(1,TRUE);
}
else if(vlayer->vectorType()==QGis::Polygon)
{
toolPopupCapture->setItemEnabled(2,TRUE);
}
}
}
}

mActionIdentify->setEnabled(TRUE);
mActionSelect->setEnabled(TRUE);
mActionOpenTable->setEnabled(TRUE);
}

// notify the project we've made a change
QgsProject::instance()->dirty(true);
}
}
}
} // QgisApp::currentLayerChanged


QgisIface *QgisApp::getInterface()
{
return mQgisInterface;
Expand Down
3 changes: 0 additions & 3 deletions src/gui/qgisapp.h
Expand Up @@ -23,7 +23,6 @@ class QRect;
class QStringList;
class QCursor;
class QLabel;
class Q3ListViewItem;
class QProgressBar;
class QFileInfo;
class QSettings;
Expand Down Expand Up @@ -185,8 +184,6 @@ public slots:
void showCapturePointCoordinate(QgsPoint &);
//! Slot to show current map scale;
void showScale(QString theScale);
//! Disable/enable toolbar buttons as appropriate for selected layer
void currentLayerChanged(Q3ListViewItem *);
//! Remove a layer from the map and legend
void removeLayer();
//! zoom to extent of layer
Expand Down
15 changes: 0 additions & 15 deletions src/legend/qgslegend.cpp
Expand Up @@ -56,9 +56,6 @@ const int AUTOSCROLL_MARGIN = 16;
QgsLegend::QgsLegend(QgisApp* app, QWidget * parent, const char *name)
: QTreeWidget(parent), mApp(app), mMousePressedFlag(false), mItemBeingMoved(0), mMapCanvas(0), mShowLegendLayerFiles(false)
{
connect( this, SIGNAL(selectionChanged(QTreeWidgetItem *)),
this, SLOT(updateLegendItem(QTreeWidgetItem *)) );

connect( this, SIGNAL(itemChanged(QTreeWidgetItem*, int)),
this, SLOT(handleItemChange(QTreeWidgetItem*, int)));

Expand Down Expand Up @@ -107,18 +104,6 @@ void QgsLegend::addGroup()
setExpanded(indexFromItem(group), true);
}

void QgsLegend::updateLegendItem( QTreeWidgetItem * li )
{
QgsLegendItem * qli = dynamic_cast<QgsLegendItem*>(li);

if ( ! qli )
{
qDebug( "QgsLegend::updateLegendItem(): couldn't get QgsLegendItem" );
return;
}

}

void QgsLegend::removeAll()
{
mStateOfCheckBoxes.clear();
Expand Down
4 changes: 0 additions & 4 deletions src/legend/qgslegend.h
Expand Up @@ -34,7 +34,6 @@ class QDomNode;
class QMouseEvent;
class QTreeWidgetItem;
class Q3PopupMenu;
class Q3ListViewItem;

/**
\class QgsLegend
Expand Down Expand Up @@ -153,9 +152,6 @@ public slots:

void setMapCanvas(QgsMapCanvas * canvas){mMapCanvas = canvas;}


void updateLegendItem( QTreeWidgetItem* li );

/*!
* Slot called to clear the tree of all items
* @note Usually connected to a QgsMapCanvas that will ask its legend to clear itself.
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrasstools.h
Expand Up @@ -21,6 +21,7 @@
class QCloseEvent;
class QString;
class Q3ListView;
class Q3ListViewItem;
class QDomNode;
class QDomElement;

Expand Down

0 comments on commit b8e54a4

Please sign in to comment.