diff --git a/CMakeLists.txt b/CMakeLists.txt index b00ccfb25ffe..6f26f3edc120 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,10 +159,7 @@ FIND_PACKAGE(Proj) FIND_PACKAGE(GEOS) FIND_PACKAGE(GDAL) FIND_PACKAGE(Expat) - -IF (NOT WITH_INTERNAL_SPATIALINDEX) - FIND_PACKAGE(Spatialindex REQUIRED) -ENDIF(NOT WITH_INTERNAL_SPATIALINDEX) +FIND_PACKAGE(Spatialindex REQUIRED) FIND_PACKAGE(Qwt REQUIRED) IF (NOT WITH_INTERNAL_QWTPOLAR) diff --git a/src/gui/qgsnewvectorlayerdialog.cpp b/src/gui/qgsnewvectorlayerdialog.cpp index ba91e5800cf6..a452495137fa 100644 --- a/src/gui/qgsnewvectorlayerdialog.cpp +++ b/src/gui/qgsnewvectorlayerdialog.cpp @@ -286,7 +286,10 @@ QString QgsNewVectorLayerDialog::runAndCreateLayer( QWidget* parent, QString* pE if ( geometrytype != QGis::WKBUnknown ) { QgsCoordinateReferenceSystem srs( crsId, QgsCoordinateReferenceSystem::InternalCrsId ); - createEmptyDataSource( fileName, fileformat, enc, geometrytype, attributes, &srs ); + if ( !createEmptyDataSource( fileName, fileformat, enc, geometrytype, attributes, &srs ) ) + { + return QString(); + } } else { diff --git a/src/plugins/georeferencer/qgsgeorefplugin.cpp b/src/plugins/georeferencer/qgsgeorefplugin.cpp index ff9fef3e5863..636e60d4ae7b 100644 --- a/src/plugins/georeferencer/qgsgeorefplugin.cpp +++ b/src/plugins/georeferencer/qgsgeorefplugin.cpp @@ -52,7 +52,6 @@ #include "qgsgeorefplugin.h" #include -//#include #include // @@ -101,9 +100,6 @@ void QgsGeorefPlugin::initGui() // Connect the action to the run connect( mActionRunGeoref, SIGNAL( triggered() ), this, SLOT( run() ) ); - mActionAbout = new QAction( QIcon(), tr( "&About" ), this ); - connect( mActionAbout, SIGNAL( triggered() ), this, SLOT( about() ) ); - setCurrentTheme( "" ); // this is called when the icon theme is changed connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) ); @@ -111,7 +107,6 @@ void QgsGeorefPlugin::initGui() // Add to the toolbar & menu mQGisIface->addRasterToolBarIcon( mActionRunGeoref ); mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref ); - mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionAbout ); } // Slot called when the buffer menu item is triggered @@ -127,12 +122,10 @@ void QgsGeorefPlugin::run() void QgsGeorefPlugin::unload() { // remove the GUI - mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionAbout ); mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref ); mQGisIface->removeRasterToolBarIcon( mActionRunGeoref ); delete mActionRunGeoref; - delete mActionAbout; delete mPluginGui; mPluginGui = NULL; @@ -142,7 +135,6 @@ void QgsGeorefPlugin::unload() void QgsGeorefPlugin::setCurrentTheme( QString ) { mActionRunGeoref->setIcon( getThemeIcon( "/mGeorefRun.png" ) ); - mActionAbout->setIcon( getThemeIcon( "/mActionAbout.png" ) ); } QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName ) @@ -161,31 +153,6 @@ QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName ) } } -void QgsGeorefPlugin::about( ) -{ - QString title = QString( "About Georeferencer" ); - // sort by date of contribution - QString text = QString( "
Georeferencer GDAL
" - "
%1
" - "

Adding projection info to rasters using GDAL
" - "Developers:" - "

    " - "
  1. Jack R" - "
  2. Maxim Dubinin" - "
  3. Manuel Massing" - "
  4. Lars Luthman" - "
" - "

Homepage:
" - "http://gis-lab.info/qa/qgis-georef-new-eng.html" ).arg( sPluginVersion ); - - // this is required for adding georef icon in to left side of dialog - // create dynamicaly because on Mac this dialog is modeless - QWidget *w = new QWidget; - w->setAttribute( Qt::WA_DeleteOnClose ); - w->setWindowIcon( getThemeIcon( "/mGeorefRun.png" ) ); - QMessageBox::about( w, title, text ); -} - ////////////////////////////////////////////////////////////////////// // // END OF MANDATORY PLUGIN METHODS @@ -193,7 +160,6 @@ void QgsGeorefPlugin::about( ) ////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// // // diff --git a/src/plugins/georeferencer/qgsgeorefplugin.h b/src/plugins/georeferencer/qgsgeorefplugin.h index 4cfe835d898d..f6fa71a656f2 100644 --- a/src/plugins/georeferencer/qgsgeorefplugin.h +++ b/src/plugins/georeferencer/qgsgeorefplugin.h @@ -88,7 +88,6 @@ class QgsGeorefPlugin: public QObject, public QgisPlugin //! update the plugins theme when the app tells us its theme is changed void setCurrentTheme( QString theThemeName ); QIcon getThemeIcon( const QString &theThemeName ); - void about(); ////////////////////////////////////////////////////////////////////// // @@ -109,7 +108,6 @@ class QgsGeorefPlugin: public QObject, public QgisPlugin QgisInterface *mQGisIface; //!pointer to the qaction for this plugin QAction * mActionRunGeoref; - QAction *mActionAbout; //////////////////////////////////////////////////////////////////// // // ADD YOUR OWN MEMBER DECLARATIONS AFTER THIS POINT..... diff --git a/src/plugins/roadgraph/roadgraphplugin.cpp b/src/plugins/roadgraph/roadgraphplugin.cpp index 543e05f89465..d04dd84df8b7 100644 --- a/src/plugins/roadgraph/roadgraphplugin.cpp +++ b/src/plugins/roadgraph/roadgraphplugin.cpp @@ -101,21 +101,17 @@ void RoadGraphPlugin::initGui() mQGisIface->addDockWidget( Qt::LeftDockWidgetArea, mQShortestPathDock ); // Create the action for tool - mQSettingsAction = new QAction( QIcon( ":/roadgraph/road.png" ), tr( "Road graph settings" ), this ); - mInfoAction = new QAction( QIcon( ":/roadgraph/about.png" ), tr( "About" ), this ); + mQSettingsAction = new QAction( QIcon( ":/roadgraph/road.png" ), tr( "Settings" ), this ); // Set the what's this text mQSettingsAction->setWhatsThis( tr( "Road graph plugin settings" ) ); - mInfoAction->setWhatsThis( tr( "About Road graph plugin" ) ); setGuiElementsToDefault(); // Connect the action to slots connect( mQSettingsAction, SIGNAL( triggered() ), this, SLOT( property() ) ); - connect( mInfoAction, SIGNAL( triggered() ), SLOT( about() ) ); mQGisIface->addPluginToVectorMenu( tr( "Road graph" ), mQSettingsAction ); - mQGisIface->addPluginToVectorMenu( tr( "Road graph" ), mInfoAction ); connect( mQGisIface, SIGNAL( projectRead() ), this, SLOT( projectRead() ) ); connect( mQGisIface, SIGNAL( newProjectCreated() ), this, SLOT( newProject() ) ); @@ -131,7 +127,6 @@ void RoadGraphPlugin::unload() { // remove the GUI mQGisIface->removePluginVectorMenu( tr( "Road graph" ), mQSettingsAction ); - mQGisIface->removePluginVectorMenu( tr( "Road graph" ), mInfoAction ); // disconnect disconnect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this, SLOT( projectRead() ) ); @@ -185,57 +180,6 @@ void RoadGraphPlugin::property() setGuiElementsToDefault(); } //RoadGraphPlugin::property() -void RoadGraphPlugin::about() -{ - QDialog dlg( mQGisIface->mainWindow() ); - dlg.setWindowFlags( dlg.windowFlags() | Qt::MSWindowsFixedSizeDialogHint ); - dlg.setWindowFlags( dlg.windowFlags() &~ Qt::WindowContextHelpButtonHint ); - dlg.setWindowTitle( tr( "About RoadGraph" ) ); - QVBoxLayout *lines = new QVBoxLayout( &dlg ); - QLabel *title = new QLabel( "RoadGraph plugin" ); - title->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); - QLabel *version = new QLabel( sPluginVersion ); - version->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter ); - lines->addWidget( title ); - lines->addWidget( version ); - lines->addWidget( new QLabel( tr( "Find shortest path on road's graph" ) ) ); - lines->addWidget( new QLabel( tr( "Developers:" ) ) ); - lines->addWidget( new QLabel( " Sergey Yakushev" ) ); - lines->addWidget( new QLabel( tr( "Homepage:" ) ) ); - - QSettings settings; - QString localeFullName, localeShortName; - bool overrideLocale = settings.value( "locale/overrideFlag", QVariant( false ) ).toBool(); - if ( !overrideLocale ) - { - localeFullName = QLocale().system().name(); - } - else - { - localeFullName = settings.value( "locale/userLocale", QVariant( "" ) ).toString(); - } - - localeShortName = localeFullName.left( 2 ); - QLabel *link = new QLabel(); - if ( localeShortName == "ru" || localeShortName == "uk" ) - { - link->setText( "http://gis-lab.info/qa/road-graph.html" ); - } - else - { - link->setText( "http://gis-lab.info/qa/road-graph-eng.html" ); - } - - link->setOpenExternalLinks( true ); - lines->addWidget( link ); - - QPushButton *btnClose = new QPushButton( tr( "Close" ) ); - lines->addWidget( btnClose ); - QObject::connect( btnClose, SIGNAL( clicked() ), &dlg, SLOT( close() ) ); - - dlg.exec(); -} //RoadGraphPlugin::about() - void RoadGraphPlugin::projectRead() { mSettings->read( QgsProject::instance() ); diff --git a/src/plugins/roadgraph/roadgraphplugin.h b/src/plugins/roadgraph/roadgraphplugin.h index 3d4d2dd8759d..9477f3d5476a 100644 --- a/src/plugins/roadgraph/roadgraphplugin.h +++ b/src/plugins/roadgraph/roadgraphplugin.h @@ -95,8 +95,6 @@ class RoadGraphPlugin: public QObject, public QgisPlugin //! show the help document void help(); - //! show about window - void about(); private slots: /** * set show roads direction @@ -130,10 +128,6 @@ class RoadGraphPlugin: public QObject, public QgisPlugin */ QAction * mQSettingsAction; - /** - * pointer ot the about action - */ - QAction * mInfoAction; /** * GUI for use shortest path finder */ diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp index 5aa5dcd1f833..3c0f99dfe499 100644 --- a/src/providers/ogr/qgsogrprovider.cpp +++ b/src/providers/ogr/qgsogrprovider.cpp @@ -1943,6 +1943,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, { if ( !uri.endsWith( ".shp", Qt::CaseInsensitive ) ) { + QgsDebugMsg( QString( "uri %1 doesn't end with .shp" ).arg( uri ) ); return false; } @@ -1971,6 +1972,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, dataSource = OGR_Dr_CreateDataSource( driver, TO8F( uri ), NULL ); if ( !dataSource ) { + QgsMessageLog::logMessage( QObject::tr( "Creating the data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); return false; } @@ -2028,6 +2030,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, layer = OGR_DS_CreateLayer( dataSource, TO8F( QFileInfo( uri ).completeBaseName() ), reference, OGRvectortype, NULL ); if ( !layer ) { + QgsMessageLog::logMessage( QObject::tr( "Creation of OGR data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); return false; } @@ -2041,7 +2044,6 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, Q_ASSERT( codec ); } - for ( std::list >::const_iterator it = attributes.begin(); it != attributes.end(); ++it ) { QStringList fields = it->second.split( ";" );