Skip to content

Commit 0288a72

Browse files
author
telwertowski
committed
Remove connections for no longer existing signals to eliminate warnings 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/qgis@5104 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 61e3f9f commit 0288a72

File tree

5 files changed

+2
-100
lines changed

5 files changed

+2
-100
lines changed

src/gui/qgisapp.cpp

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,15 +1074,13 @@ void QgisApp::setupConnections()
10741074
connect(mMapCanvas, SIGNAL(extentsChanged(QgsRect )),this,SLOT(showExtents(QgsRect )));
10751075
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(showScale(QString)));
10761076
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(updateMouseCoordinatePrecision()));
1077-
1078-
connect(mMapLegend, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(currentLayerChanged(Q3ListViewItem *)));
10791077

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

10881086
mMapCanvas->setMinimumWidth(10);
@@ -3777,81 +3775,6 @@ void QgisApp::zoomToLayerExtent()
37773775
} // QgisApp::zoomToLayerExtent()
37783776

37793777

3780-
3781-
void QgisApp::currentLayerChanged(Q3ListViewItem * lvi)
3782-
{
3783-
#ifdef QGISDEBUG
3784-
std::cout << "QgisApp::currentLayerChanged()" << std::endl;
3785-
#endif
3786-
if (lvi)
3787-
{
3788-
// disable/enable toolbar buttons as appropriate based on selected
3789-
// layer type
3790-
3791-
toolPopupCapture->setItemEnabled(0,FALSE);
3792-
toolPopupCapture->setItemEnabled(1,FALSE);
3793-
toolPopupCapture->setItemEnabled(2,FALSE);
3794-
toolPopupCapture->setItemEnabled(3,FALSE);
3795-
3796-
3797-
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>(lvi);
3798-
if(llf)
3799-
{
3800-
QgsMapLayer *layer = llf->layer();
3801-
if (layer->type() == QgsMapLayer::RASTER)
3802-
{
3803-
//actionIdentify->setEnabled(FALSE);
3804-
mActionSelect->setEnabled(FALSE);
3805-
mActionOpenTable->setEnabled(FALSE);
3806-
}
3807-
else
3808-
{
3809-
//vector layer editing buttons
3810-
QgsMapLayer* mlayer=llf->layer();
3811-
if(mlayer)
3812-
{
3813-
QgsVectorLayer* vlayer=dynamic_cast<QgsVectorLayer*>(mlayer);
3814-
if(vlayer)
3815-
{
3816-
const QgsVectorDataProvider* provider=vlayer->getDataProvider();
3817-
if(provider)
3818-
{
3819-
int cap=vlayer->getDataProvider()->capabilities();
3820-
if(cap&QgsVectorDataProvider::DeleteFeatures)
3821-
{
3822-
toolPopupCapture->setItemEnabled(3,TRUE);
3823-
}
3824-
if(cap&QgsVectorDataProvider::AddFeatures)
3825-
{
3826-
if(vlayer->vectorType()==QGis::Point)
3827-
{
3828-
toolPopupCapture->setItemEnabled(0,TRUE);
3829-
}
3830-
else if(vlayer->vectorType()==QGis::Line)
3831-
{
3832-
toolPopupCapture->setItemEnabled(1,TRUE);
3833-
}
3834-
else if(vlayer->vectorType()==QGis::Polygon)
3835-
{
3836-
toolPopupCapture->setItemEnabled(2,TRUE);
3837-
}
3838-
}
3839-
}
3840-
}
3841-
3842-
mActionIdentify->setEnabled(TRUE);
3843-
mActionSelect->setEnabled(TRUE);
3844-
mActionOpenTable->setEnabled(TRUE);
3845-
}
3846-
3847-
// notify the project we've made a change
3848-
QgsProject::instance()->dirty(true);
3849-
}
3850-
}
3851-
}
3852-
} // QgisApp::currentLayerChanged
3853-
3854-
38553778
QgisIface *QgisApp::getInterface()
38563779
{
38573780
return mQgisInterface;

src/gui/qgisapp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class QRect;
2323
class QStringList;
2424
class QCursor;
2525
class QLabel;
26-
class Q3ListViewItem;
2726
class QProgressBar;
2827
class QFileInfo;
2928
class QSettings;
@@ -185,8 +184,6 @@ public slots:
185184
void showCapturePointCoordinate(QgsPoint &);
186185
//! Slot to show current map scale;
187186
void showScale(QString theScale);
188-
//! Disable/enable toolbar buttons as appropriate for selected layer
189-
void currentLayerChanged(Q3ListViewItem *);
190187
//! Remove a layer from the map and legend
191188
void removeLayer();
192189
//! zoom to extent of layer

src/legend/qgslegend.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ const int AUTOSCROLL_MARGIN = 16;
5656
QgsLegend::QgsLegend(QgisApp* app, QWidget * parent, const char *name)
5757
: QTreeWidget(parent), mApp(app), mMousePressedFlag(false), mItemBeingMoved(0), mMapCanvas(0), mShowLegendLayerFiles(false)
5858
{
59-
connect( this, SIGNAL(selectionChanged(QTreeWidgetItem *)),
60-
this, SLOT(updateLegendItem(QTreeWidgetItem *)) );
61-
6259
connect( this, SIGNAL(itemChanged(QTreeWidgetItem*, int)),
6360
this, SLOT(handleItemChange(QTreeWidgetItem*, int)));
6461

@@ -107,18 +104,6 @@ void QgsLegend::addGroup()
107104
setExpanded(indexFromItem(group), true);
108105
}
109106

110-
void QgsLegend::updateLegendItem( QTreeWidgetItem * li )
111-
{
112-
QgsLegendItem * qli = dynamic_cast<QgsLegendItem*>(li);
113-
114-
if ( ! qli )
115-
{
116-
qDebug( "QgsLegend::updateLegendItem(): couldn't get QgsLegendItem" );
117-
return;
118-
}
119-
120-
}
121-
122107
void QgsLegend::removeAll()
123108
{
124109
mStateOfCheckBoxes.clear();

src/legend/qgslegend.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class QDomNode;
3434
class QMouseEvent;
3535
class QTreeWidgetItem;
3636
class Q3PopupMenu;
37-
class Q3ListViewItem;
3837

3938
/**
4039
\class QgsLegend
@@ -153,9 +152,6 @@ public slots:
153152

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

156-
157-
void updateLegendItem( QTreeWidgetItem* li );
158-
159155
/*!
160156
* Slot called to clear the tree of all items
161157
* @note Usually connected to a QgsMapCanvas that will ask its legend to clear itself.

src/plugins/grass/qgsgrasstools.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class QCloseEvent;
2222
class QString;
2323
class Q3ListView;
24+
class Q3ListViewItem;
2425
class QDomNode;
2526
class QDomElement;
2627

0 commit comments

Comments
 (0)