Skip to content
Permalink
Browse files
fix srs validation from threads
  • Loading branch information
jef-n committed Mar 29, 2012
1 parent 9058059 commit 9d0ffc20da9eb2538fbd33518ce80d9b05e31757
Showing with 20 additions and 1 deletion.
  1. +13 −1 src/app/qgisapp.cpp
  2. +7 −0 src/app/qgisapp.h
@@ -317,14 +317,24 @@ static QgsMessageOutput *messageOutputViewer_()
return new QgsMessageViewer( QgisApp::instance() );
}

static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
{
QgisApp::instance()->emitCustomSrsValidation( srs );
}

void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
{
emit customSrsValidation( srs );
}

/**
* This function contains forced validation of CRS used in QGIS.
* There are 3 options depending on the settings:
* - ask for CRS using projection selecter
* - use project's CRS
* - use predefined global CRS
*/
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
{
static QString authid = QString::null;
QSettings mySettings;
@@ -510,6 +520,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
QgsMessageLog::logMessage( tr( "QGIS starting..." ) );

// set QGIS specific srs validation
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem * ) ),
this, SLOT( validateSrs( QgsCoordinateReferenceSystem * ) ) );
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );

// set graphical message output
@@ -372,6 +372,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//! @note added in 1.6
void completeInitialization();

void emitCustomSrsValidation( QgsCoordinateReferenceSystem *crs );

public slots:
//! Zoom to full extent
void zoomFull();
@@ -486,6 +488,9 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
#endif

private slots:
//! validate a SRS
void validateSrs( QgsCoordinateReferenceSystem *crs );

//! QGis Sponsors
void sponsors();
//! About QGis
@@ -887,6 +892,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
@note added in version 1.6*/
void initializationCompleted();

void customSrsValidation( QgsCoordinateReferenceSystem *crs );

private:
/** This method will open a dialog so the user can select the sublayers to load
*/

0 comments on commit 9d0ffc2

Please sign in to comment.