Skip to content
Permalink
Browse files

Remove connections for no longer existing signals to eliminate warnin…

…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/qgis@5104 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Mar 27, 2006
1 parent 61e3f9f commit 0288a72cc37cb5556217a28b967db42a62e05927
Showing with 2 additions and 100 deletions.
  1. +1 −78 src/gui/qgisapp.cpp
  2. +0 −3 src/gui/qgisapp.h
  3. +0 −15 src/legend/qgslegend.cpp
  4. +0 −4 src/legend/qgslegend.h
  5. +1 −0 src/plugins/grass/qgsgrasstools.h
@@ -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);
@@ -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;
@@ -23,7 +23,6 @@ class QRect;
class QStringList;
class QCursor;
class QLabel;
class Q3ListViewItem;
class QProgressBar;
class QFileInfo;
class QSettings;
@@ -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
@@ -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)));

@@ -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();
@@ -34,7 +34,6 @@ class QDomNode;
class QMouseEvent;
class QTreeWidgetItem;
class Q3PopupMenu;
class Q3ListViewItem;

/**
\class QgsLegend
@@ -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.
@@ -21,6 +21,7 @@
class QCloseEvent;
class QString;
class Q3ListView;
class Q3ListViewItem;
class QDomNode;
class QDomElement;

0 comments on commit 0288a72

Please sign in to comment.
You can’t perform that action at this time.