Skip to content

Commit 026f0f7

Browse files
committedApr 24, 2012
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents 2978bfa + cd408bc commit 026f0f7

File tree

7 files changed

+9
-105
lines changed

7 files changed

+9
-105
lines changed
 

‎CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ FIND_PACKAGE(Proj)
159159
FIND_PACKAGE(GEOS)
160160
FIND_PACKAGE(GDAL)
161161
FIND_PACKAGE(Expat)
162-
163-
IF (NOT WITH_INTERNAL_SPATIALINDEX)
164-
FIND_PACKAGE(Spatialindex REQUIRED)
165-
ENDIF(NOT WITH_INTERNAL_SPATIALINDEX)
162+
FIND_PACKAGE(Spatialindex REQUIRED)
166163

167164
FIND_PACKAGE(Qwt REQUIRED)
168165
IF (NOT WITH_INTERNAL_QWTPOLAR)

‎src/gui/qgsnewvectorlayerdialog.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ QString QgsNewVectorLayerDialog::runAndCreateLayer( QWidget* parent, QString* pE
286286
if ( geometrytype != QGis::WKBUnknown )
287287
{
288288
QgsCoordinateReferenceSystem srs( crsId, QgsCoordinateReferenceSystem::InternalCrsId );
289-
createEmptyDataSource( fileName, fileformat, enc, geometrytype, attributes, &srs );
289+
if ( !createEmptyDataSource( fileName, fileformat, enc, geometrytype, attributes, &srs ) )
290+
{
291+
return QString();
292+
}
290293
}
291294
else
292295
{

‎src/plugins/georeferencer/qgsgeorefplugin.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include "qgsgeorefplugin.h"
5353

5454
#include <QFile>
55-
//#include <QDialog>
5655
#include <QMessageBox>
5756

5857
//
@@ -101,17 +100,13 @@ void QgsGeorefPlugin::initGui()
101100
// Connect the action to the run
102101
connect( mActionRunGeoref, SIGNAL( triggered() ), this, SLOT( run() ) );
103102

104-
mActionAbout = new QAction( QIcon(), tr( "&About" ), this );
105-
connect( mActionAbout, SIGNAL( triggered() ), this, SLOT( about() ) );
106-
107103
setCurrentTheme( "" );
108104
// this is called when the icon theme is changed
109105
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
110106

111107
// Add to the toolbar & menu
112108
mQGisIface->addRasterToolBarIcon( mActionRunGeoref );
113109
mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref );
114-
mQGisIface->addPluginToRasterMenu( tr( "&Georeferencer" ), mActionAbout );
115110
}
116111

117112
// Slot called when the buffer menu item is triggered
@@ -127,12 +122,10 @@ void QgsGeorefPlugin::run()
127122
void QgsGeorefPlugin::unload()
128123
{
129124
// remove the GUI
130-
mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionAbout );
131125
mQGisIface->removePluginRasterMenu( tr( "&Georeferencer" ), mActionRunGeoref );
132126
mQGisIface->removeRasterToolBarIcon( mActionRunGeoref );
133127

134128
delete mActionRunGeoref;
135-
delete mActionAbout;
136129

137130
delete mPluginGui;
138131
mPluginGui = NULL;
@@ -142,7 +135,6 @@ void QgsGeorefPlugin::unload()
142135
void QgsGeorefPlugin::setCurrentTheme( QString )
143136
{
144137
mActionRunGeoref->setIcon( getThemeIcon( "/mGeorefRun.png" ) );
145-
mActionAbout->setIcon( getThemeIcon( "/mActionAbout.png" ) );
146138
}
147139

148140
QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName )
@@ -161,39 +153,13 @@ QIcon QgsGeorefPlugin::getThemeIcon( const QString &theName )
161153
}
162154
}
163155

164-
void QgsGeorefPlugin::about( )
165-
{
166-
QString title = QString( "About Georeferencer" );
167-
// sort by date of contribution
168-
QString text = QString( "<center><b>Georeferencer GDAL</b></center>"
169-
"<center>%1</center>"
170-
"<p>Adding projection info to rasters using GDAL<br>"
171-
"<b>Developers:</b>"
172-
"<ol type=disc>"
173-
"<li>Jack R"
174-
"<li>Maxim Dubinin"
175-
"<li>Manuel Massing"
176-
"<li>Lars Luthman"
177-
"</ol>"
178-
"<p><b>Homepage:</b><br>"
179-
"<a href=\"http://gis-lab.info/qa/qgis-georef-new-eng.html\">http://gis-lab.info/qa/qgis-georef-new-eng.html</a>" ).arg( sPluginVersion );
180-
181-
// this is required for adding georef icon in to left side of dialog
182-
// create dynamicaly because on Mac this dialog is modeless
183-
QWidget *w = new QWidget;
184-
w->setAttribute( Qt::WA_DeleteOnClose );
185-
w->setWindowIcon( getThemeIcon( "/mGeorefRun.png" ) );
186-
QMessageBox::about( w, title, text );
187-
}
188-
189156
//////////////////////////////////////////////////////////////////////
190157
//
191158
// END OF MANDATORY PLUGIN METHODS
192159
//
193160
//////////////////////////////////////////////////////////////////////
194161

195162

196-
197163
//////////////////////////////////////////////////////////////////////////
198164
//
199165
//

‎src/plugins/georeferencer/qgsgeorefplugin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class QgsGeorefPlugin: public QObject, public QgisPlugin
8888
//! update the plugins theme when the app tells us its theme is changed
8989
void setCurrentTheme( QString theThemeName );
9090
QIcon getThemeIcon( const QString &theThemeName );
91-
void about();
9291

9392
//////////////////////////////////////////////////////////////////////
9493
//
@@ -109,7 +108,6 @@ class QgsGeorefPlugin: public QObject, public QgisPlugin
109108
QgisInterface *mQGisIface;
110109
//!pointer to the qaction for this plugin
111110
QAction * mActionRunGeoref;
112-
QAction *mActionAbout;
113111
////////////////////////////////////////////////////////////////////
114112
//
115113
// ADD YOUR OWN MEMBER DECLARATIONS AFTER THIS POINT.....

‎src/plugins/roadgraph/roadgraphplugin.cpp

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,17 @@ void RoadGraphPlugin::initGui()
101101
mQGisIface->addDockWidget( Qt::LeftDockWidgetArea, mQShortestPathDock );
102102

103103
// Create the action for tool
104-
mQSettingsAction = new QAction( QIcon( ":/roadgraph/road.png" ), tr( "Road graph settings" ), this );
105-
mInfoAction = new QAction( QIcon( ":/roadgraph/about.png" ), tr( "About" ), this );
104+
mQSettingsAction = new QAction( QIcon( ":/roadgraph/road.png" ), tr( "Settings" ), this );
106105

107106
// Set the what's this text
108107
mQSettingsAction->setWhatsThis( tr( "Road graph plugin settings" ) );
109-
mInfoAction->setWhatsThis( tr( "About Road graph plugin" ) );
110108

111109
setGuiElementsToDefault();
112110

113111
// Connect the action to slots
114112
connect( mQSettingsAction, SIGNAL( triggered() ), this, SLOT( property() ) );
115-
connect( mInfoAction, SIGNAL( triggered() ), SLOT( about() ) );
116113

117114
mQGisIface->addPluginToVectorMenu( tr( "Road graph" ), mQSettingsAction );
118-
mQGisIface->addPluginToVectorMenu( tr( "Road graph" ), mInfoAction );
119115

120116
connect( mQGisIface, SIGNAL( projectRead() ), this, SLOT( projectRead() ) );
121117
connect( mQGisIface, SIGNAL( newProjectCreated() ), this, SLOT( newProject() ) );
@@ -131,7 +127,6 @@ void RoadGraphPlugin::unload()
131127
{
132128
// remove the GUI
133129
mQGisIface->removePluginVectorMenu( tr( "Road graph" ), mQSettingsAction );
134-
mQGisIface->removePluginVectorMenu( tr( "Road graph" ), mInfoAction );
135130

136131
// disconnect
137132
disconnect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this, SLOT( projectRead() ) );
@@ -185,57 +180,6 @@ void RoadGraphPlugin::property()
185180
setGuiElementsToDefault();
186181
} //RoadGraphPlugin::property()
187182

188-
void RoadGraphPlugin::about()
189-
{
190-
QDialog dlg( mQGisIface->mainWindow() );
191-
dlg.setWindowFlags( dlg.windowFlags() | Qt::MSWindowsFixedSizeDialogHint );
192-
dlg.setWindowFlags( dlg.windowFlags() &~ Qt::WindowContextHelpButtonHint );
193-
dlg.setWindowTitle( tr( "About RoadGraph" ) );
194-
QVBoxLayout *lines = new QVBoxLayout( &dlg );
195-
QLabel *title = new QLabel( "<b>RoadGraph plugin</b>" );
196-
title->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
197-
QLabel *version = new QLabel( sPluginVersion );
198-
version->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
199-
lines->addWidget( title );
200-
lines->addWidget( version );
201-
lines->addWidget( new QLabel( tr( "Find shortest path on road's graph" ) ) );
202-
lines->addWidget( new QLabel( tr( "<b>Developers:</b>" ) ) );
203-
lines->addWidget( new QLabel( " Sergey Yakushev" ) );
204-
lines->addWidget( new QLabel( tr( "<b>Homepage:</b>" ) ) );
205-
206-
QSettings settings;
207-
QString localeFullName, localeShortName;
208-
bool overrideLocale = settings.value( "locale/overrideFlag", QVariant( false ) ).toBool();
209-
if ( !overrideLocale )
210-
{
211-
localeFullName = QLocale().system().name();
212-
}
213-
else
214-
{
215-
localeFullName = settings.value( "locale/userLocale", QVariant( "" ) ).toString();
216-
}
217-
218-
localeShortName = localeFullName.left( 2 );
219-
QLabel *link = new QLabel();
220-
if ( localeShortName == "ru" || localeShortName == "uk" )
221-
{
222-
link->setText( "<a href=\"http://gis-lab.info/qa/road-graph.html\">http://gis-lab.info/qa/road-graph.html</a>" );
223-
}
224-
else
225-
{
226-
link->setText( "<a href=\"http://gis-lab.info/qa/road-graph-eng.html\">http://gis-lab.info/qa/road-graph-eng.html</a>" );
227-
}
228-
229-
link->setOpenExternalLinks( true );
230-
lines->addWidget( link );
231-
232-
QPushButton *btnClose = new QPushButton( tr( "Close" ) );
233-
lines->addWidget( btnClose );
234-
QObject::connect( btnClose, SIGNAL( clicked() ), &dlg, SLOT( close() ) );
235-
236-
dlg.exec();
237-
} //RoadGraphPlugin::about()
238-
239183
void RoadGraphPlugin::projectRead()
240184
{
241185
mSettings->read( QgsProject::instance() );

‎src/plugins/roadgraph/roadgraphplugin.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ class RoadGraphPlugin: public QObject, public QgisPlugin
9595
//! show the help document
9696
void help();
9797

98-
//! show about window
99-
void about();
10098
private slots:
10199
/**
102100
* set show roads direction
@@ -130,10 +128,6 @@ class RoadGraphPlugin: public QObject, public QgisPlugin
130128
*/
131129
QAction * mQSettingsAction;
132130

133-
/**
134-
* pointer ot the about action
135-
*/
136-
QAction * mInfoAction;
137131
/**
138132
* GUI for use shortest path finder
139133
*/

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
19431943
{
19441944
if ( !uri.endsWith( ".shp", Qt::CaseInsensitive ) )
19451945
{
1946+
QgsDebugMsg( QString( "uri %1 doesn't end with .shp" ).arg( uri ) );
19461947
return false;
19471948
}
19481949

@@ -1971,6 +1972,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
19711972
dataSource = OGR_Dr_CreateDataSource( driver, TO8F( uri ), NULL );
19721973
if ( !dataSource )
19731974
{
1975+
QgsMessageLog::logMessage( QObject::tr( "Creating the data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) );
19741976
return false;
19751977
}
19761978

@@ -2028,6 +2030,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
20282030
layer = OGR_DS_CreateLayer( dataSource, TO8F( QFileInfo( uri ).completeBaseName() ), reference, OGRvectortype, NULL );
20292031
if ( !layer )
20302032
{
2033+
QgsMessageLog::logMessage( QObject::tr( "Creation of OGR data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) );
20312034
return false;
20322035
}
20332036

@@ -2041,7 +2044,6 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
20412044
Q_ASSERT( codec );
20422045
}
20432046

2044-
20452047
for ( std::list<std::pair<QString, QString> >::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
20462048
{
20472049
QStringList fields = it->second.split( ";" );

0 commit comments

Comments
 (0)
Please sign in to comment.