Skip to content

Commit

Permalink
Removed keyPressed() slot from QgsMapLayer and removed connections ma…
Browse files Browse the repository at this point in the history
…de in QgisApp.

(it doesn't make much sense to have it there)


git-svn-id: http://svn.osgeo.org/qgis/trunk@6665 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 22, 2007
1 parent f6eca1e commit ff4a1e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
51 changes: 0 additions & 51 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,15 +1872,6 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this,
SIGNAL(keyPressed(QKeyEvent *)),
layer,
SLOT(keyPressed(QKeyEvent* )));

}
else
{
Expand Down Expand Up @@ -1963,14 +1954,6 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this,
SIGNAL(keyPressed(QKeyEvent *)),
layer,
SLOT(keyPressed(QKeyEvent* )));
}
else
{
Expand Down Expand Up @@ -2062,14 +2045,6 @@ void QgisApp::addDatabaseLayer()
// register this layer with the central layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this,
SIGNAL(keyPressed(QKeyEvent *)),
layer,
SLOT(keyPressed(QKeyEvent* )));
}
else
{
Expand Down Expand Up @@ -4275,15 +4250,6 @@ void QgisApp::addVectorLayer(QString vectorLayerPath, QString baseName, QString
// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this,
SIGNAL(keyPressed(QKeyEvent * )),
layer,
SLOT(keyPressed(QKeyEvent* )));

QgsProject::instance()->dirty(false); // XXX this might be redundant

statusBar()->message(mMapCanvas->extent().stringRep(2));
Expand Down Expand Up @@ -4947,14 +4913,6 @@ bool QgisApp::addRasterLayer(QgsRasterLayer * theRasterLayer, bool theForceRedra
SIGNAL(setStatus(QString)),
this,
SLOT(showStatusMessage(QString)));
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this ,
SIGNAL(keyPressed(QKeyEvent * )),
theRasterLayer,
SLOT(keyPressed(QKeyEvent* )));

// add it to the mapcanvas collection
// no longer necessary since adding to registry automatically adds to canvas
Expand Down Expand Up @@ -5099,15 +5057,6 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
this,
SLOT(showStatusMessage(QString)));

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
#endif
QObject::connect(this,
SIGNAL(keyPressed(QKeyEvent * )),
layer,
SLOT(keyPressed(QKeyEvent* )));

QgsProject::instance()->dirty(false); // XXX this might be redundant

statusBar()->message(mMapCanvas->extent().stringRep(2));
Expand Down
3 changes: 0 additions & 3 deletions src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ public slots:
void setScaleBasedVisibility( bool theVisibilityFlag);
bool scaleBasedVisibility();

/** Layer can be informed when a key is pressed. */
virtual void keyPressed (QKeyEvent *e) {};

signals:

/** Emit a signal to notify of a progress event */
Expand Down

0 comments on commit ff4a1e2

Please sign in to comment.