Skip to content
Permalink
Browse files
fix #5251
  • Loading branch information
jef-n committed Dec 29, 2012
1 parent e2f7adf commit ce6aab704faeefeb14b301f463363371bfb0f475
Showing with 20 additions and 14 deletions.
  1. +4 −0 python/plugins/fTools/tools/doMergeShapes.py
  2. +11 −9 src/app/qgisapp.cpp
  3. +3 −3 src/app/qgisapp.h
  4. +1 −1 src/core/qgscoordinatereferencesystem.cpp
  5. +1 −1 src/core/qgscoordinatereferencesystem.h
@@ -139,6 +139,10 @@ def accept( self ):
baseDir = self.leInputDir.text()
# look for shapes with specified geometry type
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
if self.inputFiles is None:
QMessageBox.warning( self, self.tr( "No shapefiles found" ),
self.tr( "There are no shapefiles with the given geometry type. Please select an available geometry type." ) )
return
self.progressFiles.setRange( 0, self.inputFiles.count() )

outFile = QFile( self.outFileName )
@@ -344,12 +344,12 @@ static QgsMessageOutput *messageOutputViewer_()
return new QgsMessageOutputConsole();
}

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

void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem &srs )
{
emit customSrsValidation( srs );
}
@@ -361,7 +361,7 @@ void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
* - use project's CRS
* - use predefined global CRS
*/
void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs )
{
static QString authid = QString::null;
QSettings mySettings;
@@ -372,9 +372,10 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
//it in the ctor of the layer projection selector

QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector();
mySelector->setMessage( srs->validationHint() ); //shows a generic message, if not specified
mySelector->setMessage( srs.validationHint() ); //shows a generic message, if not specified
if ( authid.isNull() )
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();

QgsCoordinateReferenceSystem defaultCrs;
if ( defaultCrs.createFromOgcWmsCrs( authid ) )
{
@@ -389,7 +390,7 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
{
QgsDebugMsg( "Layer srs set from dialog: " + QString::number( mySelector->selectedCrsId() ) );
authid = mySelector->selectedAuthId();
srs->createFromOgcWmsCrs( mySelector->selectedAuthId() );
srs.createFromOgcWmsCrs( mySelector->selectedAuthId() );
}

//QApplication::restoreOverrideCursor();
@@ -402,12 +403,12 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();
QgsDebugMsg( "Layer srs set from project: " + authid );
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to project CRS" ) );
srs->createFromOgcWmsCrs( authid );
srs.createFromOgcWmsCrs( authid );
}
else ///Projections/defaultBehaviour==useGlobal
{
authid = mySettings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
srs->createFromOgcWmsCrs( authid );
srs.createFromOgcWmsCrs( authid );
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to default CRS: %1" ).arg( authid ) );
}
}
@@ -566,8 +567,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 * ) ) );
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem& ) ),
this, SLOT( validateSrs( QgsCoordinateReferenceSystem& ) ) );
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );

// set graphical message output
@@ -7020,6 +7021,7 @@ void QgisApp::markDirty()
// notify the project that there was a change
QgsProject::instance()->dirty( true );
}

//changed from layerWasAdded to layersWereAdded in 1.8
void QgisApp::layersWereAdded( QList<QgsMapLayer *> theLayers )
{
@@ -404,7 +404,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//! @note added in 1.6
void completeInitialization();

void emitCustomSrsValidation( QgsCoordinateReferenceSystem *crs );
void emitCustomSrsValidation( QgsCoordinateReferenceSystem &crs );

QList<QgsDecorationItem*> decorationItems() { return mDecorationItems; }
void addDecorationItem( QgsDecorationItem* item ) { mDecorationItems.append( item ); }
@@ -533,7 +533,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

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

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

void customSrsValidation( QgsCoordinateReferenceSystem *crs );
void customSrsValidation( QgsCoordinateReferenceSystem &crs );

private:
/** This method will open a dialog so the user can select GDAL sublayers to load
@@ -283,7 +283,7 @@ void QgsCoordinateReferenceSystem::validate()

// try to validate using custom validation routines
if ( mCustomSrsValidation )
mCustomSrsValidation( this );
mCustomSrsValidation( *this );

if ( !mIsValidFlag )
{
@@ -42,7 +42,7 @@ typedef void *OGRSpatialReferenceH;
#endif

class QgsCoordinateReferenceSystem;
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem* );
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem& );

/** \ingroup core
* Class for storing a coordinate reference system (CRS)

0 comments on commit ce6aab7

Please sign in to comment.