fix srs validation from threads

This commit is contained in:
Juergen E. Fischer 2012-03-29 17:16:39 +02:00
parent 90580592d9
commit 9d0ffc20da
2 changed files with 20 additions and 1 deletions

View File

@ -317,6 +317,16 @@ 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:
@ -324,7 +334,7 @@ static QgsMessageOutput *messageOutputViewer_()
* - 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

View File

@ -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
*/