From 79aba2e52d67d9fc8c15797d7468432389704cd2 Mon Sep 17 00:00:00 2001 From: mcoletti Date: Wed, 17 Nov 2004 16:27:02 +0000 Subject: [PATCH] The interface class now allows QgisApp access via app(). This was necessary to allow plug-ins to connect() to various QgisApp slots and signals. Since this somewhat short-circuits the need for the QgisInterface classes, this might indicate the need for design refactoring. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2267 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgisiface.cpp | 7 +++++++ src/qgisiface.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/qgisiface.cpp b/src/qgisiface.cpp index 300038cc953..2f0b855d8b3 100644 --- a/src/qgisiface.cpp +++ b/src/qgisiface.cpp @@ -133,3 +133,10 @@ QgsMapLayerRegistry * QgisIface::getLayerRegistry() { return qgis->getLayerRegistry(); } + + +QgisApp * +QgisIface::app() +{ + return qgis; +} // QgisIface::app() diff --git a/src/qgisiface.h b/src/qgisiface.h index b5c8b8a9cdb..bc607c36753 100644 --- a/src/qgisiface.h +++ b/src/qgisiface.h @@ -85,6 +85,21 @@ class QgisIface : public QgisInterface{ QgsMapCanvas * getMapCanvas(); /** Return a pointer to the map layer registry */ QgsMapLayerRegistry * getLayerRegistry(); + + + /** Gives access to main QgisApp object + + Even though this class is supposed to act as a Facade for the + QgisApp, the plug-ins need direct access to the application object + for their connect() calls. + + @todo XXX this may call into question the current need for this + interface? Maybe these connect() calls can be done in some other + less intrusive way? + + */ + QgisApp * app(); + private: /// QgisIface aren't copied