Skip to content

Commit 9d0ffc2

Browse files
committedMar 29, 2012
fix srs validation from threads
1 parent 9058059 commit 9d0ffc2

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,24 @@ static QgsMessageOutput *messageOutputViewer_()
317317
return new QgsMessageViewer( QgisApp::instance() );
318318
}
319319

320+
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
321+
{
322+
QgisApp::instance()->emitCustomSrsValidation( srs );
323+
}
324+
325+
void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
326+
{
327+
emit customSrsValidation( srs );
328+
}
329+
320330
/**
321331
* This function contains forced validation of CRS used in QGIS.
322332
* There are 3 options depending on the settings:
323333
* - ask for CRS using projection selecter
324334
* - use project's CRS
325335
* - use predefined global CRS
326336
*/
327-
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
337+
void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
328338
{
329339
static QString authid = QString::null;
330340
QSettings mySettings;
@@ -510,6 +520,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
510520
QgsMessageLog::logMessage( tr( "QGIS starting..." ) );
511521

512522
// set QGIS specific srs validation
523+
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem * ) ),
524+
this, SLOT( validateSrs( QgsCoordinateReferenceSystem * ) ) );
513525
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );
514526

515527
// set graphical message output

‎src/app/qgisapp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
372372
//! @note added in 1.6
373373
void completeInitialization();
374374

375+
void emitCustomSrsValidation( QgsCoordinateReferenceSystem *crs );
376+
375377
public slots:
376378
//! Zoom to full extent
377379
void zoomFull();
@@ -486,6 +488,9 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
486488
#endif
487489

488490
private slots:
491+
//! validate a SRS
492+
void validateSrs( QgsCoordinateReferenceSystem *crs );
493+
489494
//! QGis Sponsors
490495
void sponsors();
491496
//! About QGis
@@ -887,6 +892,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
887892
@note added in version 1.6*/
888893
void initializationCompleted();
889894

895+
void customSrsValidation( QgsCoordinateReferenceSystem *crs );
896+
890897
private:
891898
/** This method will open a dialog so the user can select the sublayers to load
892899
*/

0 commit comments

Comments
 (0)
Please sign in to comment.