Skip to content
Permalink
Browse files

Partial revert of 70bff3f

Commit was causing crashes in browser. Refs #13738
  • Loading branch information
nyalldawson committed Nov 5, 2015
1 parent e0fc9a9 commit fe3417b5ef704d51ae583bce93f1032d4118e6f3
Showing with 122 additions and 123 deletions.
  1. +1 −1 python/core/qgsdataitem.sip
  2. +2 −2 python/core/qgspythonrunner.sip
  3. +1 −1 python/core/raster/qgsrasterdataprovider.sip
  4. +2 −2 src/app/qgisapp.cpp
  5. +1 −1 src/core/qgsdataitem.cpp
  6. +2 −2 src/core/qgsdataitem.h
  7. +1 −1 src/core/qgsproviderregistry.cpp
  8. +2 −2 src/core/qgspythonrunner.h
  9. +1 −1 src/core/qgsvectorlayer.cpp
  10. +1 −1 src/core/raster/qgsrasterdataprovider.h
  11. +2 −2 src/gui/qgsrasterformatsaveoptionswidget.cpp
  12. +2 −2 src/providers/gdal/qgsgdaldataitems.cpp
  13. +2 −2 src/providers/gdal/qgsgdaldataitems.h
  14. +8 −9 src/providers/gdal/qgsgdalprovider.cpp
  15. +2 −2 src/providers/gdal/qgsgdalprovider.h
  16. +1 −1 src/providers/grass/qgsgrassprovidermodule.h
  17. +5 −5 src/providers/mssql/qgsmssqldataitems.cpp
  18. +5 −5 src/providers/mssql/qgsmssqldataitems.h
  19. +1 −1 src/providers/mssql/qgsmssqlprovider.cpp
  20. +3 −3 src/providers/mssql/qgsmssqlsourceselect.cpp
  21. +3 −3 src/providers/mssql/qgsmssqlsourceselect.h
  22. +2 −2 src/providers/ogr/qgsogrconnpool.h
  23. +3 −3 src/providers/ogr/qgsogrdataitems.cpp
  24. +3 −3 src/providers/ogr/qgsogrdataitems.h
  25. +2 −2 src/providers/ogr/qgsogrprovider.cpp
  26. +1 −1 src/providers/ogr/qgsogrprovider.h
  27. +4 −4 src/providers/ows/qgsowsdataitems.cpp
  28. +3 −3 src/providers/ows/qgsowsdataitems.h
  29. +1 −1 src/providers/postgres/qgscolumntypethread.cpp
  30. +1 −1 src/providers/postgres/qgscolumntypethread.h
  31. +2 −2 src/providers/postgres/qgspostgresconn.cpp
  32. +2 −2 src/providers/postgres/qgspostgresconn.h
  33. +2 −2 src/providers/postgres/qgspostgresconnpool.h
  34. +6 −6 src/providers/postgres/qgspostgresdataitems.cpp
  35. +6 −6 src/providers/postgres/qgspostgresdataitems.h
  36. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  37. +2 −2 src/providers/spatialite/qgsspatialiteconnpool.h
  38. +5 −5 src/providers/spatialite/qgsspatialitedataitems.cpp
  39. +3 −3 src/providers/spatialite/qgsspatialitedataitems.h
  40. +1 −1 src/providers/spatialite/qgsspatialiteprovider.cpp
  41. +4 −4 src/providers/wcs/qgswcsdataitems.cpp
  42. +4 −4 src/providers/wcs/qgswcsdataitems.h
  43. +4 −4 src/providers/wfs/qgswfsdataitems.cpp
  44. +3 −3 src/providers/wfs/qgswfsdataitems.h
  45. +4 −4 src/providers/wms/qgswmsdataitems.cpp
  46. +4 −4 src/providers/wms/qgswmsdataitems.h
@@ -95,7 +95,7 @@ class QgsDataItem : QObject
typedef QFlags<QgsDataItem::Capability> Capabilities;

// This will _write_ selected crs in data source
virtual bool setCrs( const QgsCoordinateReferenceSystem& crs );
virtual bool setCrs( QgsCoordinateReferenceSystem crs );

//! @deprecated since 2.8, returned type this will changed to Capabilities
virtual Capability capabilities() /Deprecated/;
@@ -25,7 +25,7 @@ class QgsPythonRunner
QgsPythonRunner();
virtual ~QgsPythonRunner();

virtual bool runCommand( const QString& command, const QString& messageOnError = QString() ) = 0;
virtual bool runCommand( QString command, QString messageOnError = QString() ) = 0;

virtual bool evalCommand( const QString& command, QString& result ) = 0;
virtual bool evalCommand( QString command, QString& result ) = 0;
};
@@ -159,7 +159,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
* ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
* list.
*/
virtual QList<QgsRasterPyramid> buildPyramidList( const QList<int>& overviewList = QList<int>() );
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() );

/** \brief Returns true if raster has at least one populated histogram. */
bool hasPyramids();
@@ -7883,7 +7883,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
public:
explicit QgsPythonRunnerImpl( QgsPythonUtils* pythonUtils ) : mPythonUtils( pythonUtils ) {}

virtual bool runCommand( const QString& command, const QString& messageOnError = QString() ) override
virtual bool runCommand( QString command, QString messageOnError = QString() ) override
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
{
@@ -7892,7 +7892,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
return false;
}

virtual bool evalCommand( const QString& command, QString &result ) override
virtual bool evalCommand( QString command, QString &result ) override
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
{
@@ -470,7 +470,7 @@ void QgsDataItem::refresh()
}
}

void QgsDataItem::refresh( const QVector<QgsDataItem*>& children )
void QgsDataItem::refresh( QVector<QgsDataItem*> children )
{
QgsDebugMsgLevel( "mPath = " + mPath, 2 );

@@ -152,7 +152,7 @@ class CORE_EXPORT QgsDataItem : public QObject
Q_DECLARE_FLAGS( Capabilities, Capability )

// This will _write_ selected crs in data source
virtual bool setCrs( const QgsCoordinateReferenceSystem& crs )
virtual bool setCrs( QgsCoordinateReferenceSystem crs )
{ Q_UNUSED( crs ); return false; }

//! @deprecated since 2.8, returned type this will changed to Capabilities
@@ -203,7 +203,7 @@ class CORE_EXPORT QgsDataItem : public QObject

protected:
virtual void populate( const QVector<QgsDataItem*>& children );
virtual void refresh( const QVector<QgsDataItem*>& children );
virtual void refresh( QVector<QgsDataItem*> children );
/** The item is scheduled to be deleted. E.g. if deleteLater() is called when
* item is in Populating state (createChildren() running in another thread),
* the deferredDelete() returns true and item will be deleted once Populating finished.
@@ -42,7 +42,7 @@ typedef QString databaseDrivers_t();
typedef QString directoryDrivers_t();
typedef QString protocolDrivers_t();
//typedef int dataCapabilities_t();
//typedef QgsDataItem * dataItem_t(const QString&);
//typedef QgsDataItem * dataItem_t(QString);



@@ -50,9 +50,9 @@ class CORE_EXPORT QgsPythonRunner
QgsPythonRunner();
virtual ~QgsPythonRunner();

virtual bool runCommand( const QString& command, const QString& messageOnError = QString() ) = 0;
virtual bool runCommand( QString command, QString messageOnError = QString() ) = 0;

virtual bool evalCommand( const QString& command, QString& result ) = 0;
virtual bool evalCommand( QString command, QString& result ) = 0;

static QgsPythonRunner* mInstance;
};
@@ -116,7 +116,7 @@ typedef int listStyles_t(

typedef QString getStyleById_t(
const QString& uri,
const QString& styleID,
QString styleID,
QString& errCause
);

@@ -281,7 +281,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
* ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
* list.
*/
virtual QList<QgsRasterPyramid> buildPyramidList( const QList<int>& overviewList = QList<int>() )
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
{ Q_UNUSED( overviewList ); return QList<QgsRasterPyramid>(); }

/** \brief Returns true if raster has at least one populated histogram. */
@@ -234,8 +234,8 @@ void QgsRasterFormatSaveOptionsWidget::apply()
}

// typedefs for gdal provider function pointers
typedef QString validateCreationOptionsFormat_t( const QStringList& createOptions, const QString& format );
typedef QString helpCreationOptionsFormat_t( const QString& format );
typedef QString validateCreationOptionsFormat_t( const QStringList& createOptions, QString format );
typedef QString helpCreationOptionsFormat_t( QString format );

void QgsRasterFormatSaveOptionsWidget::helpOptions()
{
@@ -24,7 +24,7 @@ void buildSupportedRasterFileFilterAndExtensions( QString & theFileFiltersString


QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem* parent,
const QString& name, const QString& path, const QString& uri,
QString name, QString path, QString uri,
QStringList *theSublayers )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::Raster, "gdal" )
{
@@ -58,7 +58,7 @@ QgsLayerItem::Capability QgsGdalLayerItem::capabilities()
return mCapabilities & SetCrs ? SetCrs : NoCapabilities;
}

bool QgsGdalLayerItem::setCrs( const QgsCoordinateReferenceSystem& crs )
bool QgsGdalLayerItem::setCrs( QgsCoordinateReferenceSystem crs )
{
GDALDatasetH hDS = GDALOpen( TO8F( mPath ), GA_Update );
if ( !hDS )
@@ -25,11 +25,11 @@ class QgsGdalLayerItem : public QgsLayerItem

public:
QgsGdalLayerItem( QgsDataItem* parent,
const QString& name, const QString& path, const QString& uri,
QString name, QString path, QString uri,
QStringList *theSublayers = NULL );
~QgsGdalLayerItem();

bool setCrs( const QgsCoordinateReferenceSystem& crs ) override;
bool setCrs( QgsCoordinateReferenceSystem crs ) override;
Capability capabilities() override;

QVector<QgsDataItem*> createChildren() override;
@@ -1781,7 +1781,7 @@ QList<QgsRasterPyramid> QgsGdalProvider::buildPyramidList()
}
#endif

QList<QgsRasterPyramid> QgsGdalProvider::buildPyramidList( const QList<int>& overviewList )
QList<QgsRasterPyramid> QgsGdalProvider::buildPyramidList( QList<int> overviewList )
{
int myWidth = mWidth;
int myHeight = mHeight;
@@ -1790,23 +1790,22 @@ QList<QgsRasterPyramid> QgsGdalProvider::buildPyramidList( const QList<int>& ove
mPyramidList.clear();

// if overviewList is empty (default) build the pyramid list
QList<int> nonEmptyList = overviewList;
if ( nonEmptyList.isEmpty() )
if ( overviewList.isEmpty() )
{
int myDivisor = 2;

QgsDebugMsg( "Building initial pyramid list" );

while (( myWidth / myDivisor > 32 ) && (( myHeight / myDivisor ) > 32 ) )
{
nonEmptyList.append( myDivisor );
overviewList.append( myDivisor );
//sqare the divisor each step
myDivisor = ( myDivisor * 2 );
}
}

// loop over pyramid list
Q_FOREACH ( int myDivisor, nonEmptyList )
Q_FOREACH ( int myDivisor, overviewList )
{
//
// First we build up a list of potential pyramid layers
@@ -1875,7 +1874,7 @@ QStringList QgsGdalProvider::subLayers() const
return mSubLayers;
}

void QgsGdalProvider::emitProgress( int theType, double theProgress, const QString& theMessage )
void QgsGdalProvider::emitProgress( int theType, double theProgress, QString theMessage )
{
emit progress( theType, theProgress, theMessage );
}
@@ -2708,7 +2707,7 @@ QGISEXTERN QgsGdalProvider * create(
QGis::DataType type,
int width, int height, double* geoTransform,
const QgsCoordinateReferenceSystem& crs,
const QStringList& createOptions )
QStringList createOptions )
{
//get driver
GDALDriverH driver = GDALGetDriverByName( format.toLocal8Bit().data() );
@@ -2817,7 +2816,7 @@ QGISEXTERN void buildSupportedRasterFileFilter( QString & theFileFiltersString )
/**
Gets creation options metadata for a given format
*/
QGISEXTERN QString helpCreationOptionsFormat( const QString& format )
QGISEXTERN QString helpCreationOptionsFormat( QString format )
{
QString message;
GDALDriverH myGdalDriver = GDALGetDriverByName( format.toLocal8Bit().constData() );
@@ -2849,7 +2848,7 @@ QGISEXTERN QString helpCreationOptionsFormat( const QString& format )
/**
Validates creation options for a given format, regardless of layer.
*/
QGISEXTERN QString validateCreationOptionsFormat( const QStringList& createOptions, const QString& format )
QGISEXTERN QString validateCreationOptionsFormat( const QStringList& createOptions, QString format )
{
GDALDriverH myGdalDriver = GDALGetDriverByName( format.toLocal8Bit().constData() );
if ( ! myGdalDriver )
@@ -224,13 +224,13 @@ class QgsGdalProvider : public QgsRasterDataProvider, QgsGdalProviderBase
const QString & theResamplingMethod = "NEAREST",
QgsRaster::RasterPyramidsFormat theFormat = QgsRaster::PyramidsGTiff,
const QStringList & theCreateOptions = QStringList() ) override;
QList<QgsRasterPyramid> buildPyramidList( const QList<int>& overviewList = QList<int>() ) override;
QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() ) override;

/** \brief Close data set and release related data */
void closeDataset();

/** Emit a signal to notify of the progress event. */
void emitProgress( int theType, double theProgress, const QString& theMessage );
void emitProgress( int theType, double theProgress, QString theMessage );
void emitProgressUpdate( int theProgress );

static QMap<QString, QString> supportedMimes();
@@ -227,7 +227,7 @@ class QgsGrassImportItem : public QgsDataItem, public QgsGrassObjectItemBase

protected:
// override refresh to keep Populating state
virtual void refresh( const QVector<QgsDataItem*>& children ) override { Q_UNUSED( children ); }
virtual void refresh( QVector<QgsDataItem*> children ) override { Q_UNUSED( children ); }
//bool mDeleteAction;
QgsGrassImport* mImport;

@@ -33,7 +33,7 @@
#include <QtSql/QSqlError>

// ---------------------------------------------------------------------------
QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, const QString& name, const QString& path )
QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
, mUseGeometryColumns( false )
, mUseEstimatedMetadata( false )
@@ -406,7 +406,7 @@ bool QgsMssqlConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction


// ---------------------------------------------------------------------------
QgsMssqlLayerItem::QgsMssqlLayerItem( QgsDataItem* parent, const QString& name, const QString& path, QgsLayerItem::LayerType layerType, const QgsMssqlLayerProperty& layerProperty )
QgsMssqlLayerItem::QgsMssqlLayerItem( QgsDataItem* parent, QString name, QString path, QgsLayerItem::LayerType layerType, QgsMssqlLayerProperty layerProperty )
: QgsLayerItem( parent, name, path, QString(), layerType, "mssql" )
, mLayerProperty( layerProperty )
{
@@ -443,7 +443,7 @@ QString QgsMssqlLayerItem::createUri()
}

// ---------------------------------------------------------------------------
QgsMssqlSchemaItem::QgsMssqlSchemaItem( QgsDataItem* parent, const QString& name, const QString& path )
QgsMssqlSchemaItem::QgsMssqlSchemaItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIconName = "mIconDbSchema.png";
@@ -474,7 +474,7 @@ void QgsMssqlSchemaItem::addLayers( QgsDataItem* newLayers )
}
}

QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( const QgsMssqlLayerProperty& layerProperty, bool refresh )
QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( QgsMssqlLayerProperty layerProperty, bool refresh )
{
QGis::WkbType wkbType = QgsMssqlTableModel::wkbTypeFromMssql( layerProperty.type );
QString tip = tr( "%1 as %2 in %3" ).arg( layerProperty.geometryColName, QgsMssqlTableModel::displayStringForWkbType( wkbType ), layerProperty.srid );
@@ -523,7 +523,7 @@ QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( const QgsMssqlLayerProperty& la
}

// ---------------------------------------------------------------------------
QgsMssqlRootItem::QgsMssqlRootItem( QgsDataItem* parent, const QString& name, const QString& path )
QgsMssqlRootItem::QgsMssqlRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIconName = "mIconMssql.svg";
@@ -33,7 +33,7 @@ class QgsMssqlRootItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsMssqlRootItem( QgsDataItem* parent, const QString& name, const QString& path );
QgsMssqlRootItem( QgsDataItem* parent, QString name, QString path );
~QgsMssqlRootItem();

QVector<QgsDataItem*> createChildren() override;
@@ -51,7 +51,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsMssqlConnectionItem( QgsDataItem* parent, const QString& name, const QString& path );
QgsMssqlConnectionItem( QgsDataItem* parent, QString name, QString path );
~QgsMssqlConnectionItem();

QVector<QgsDataItem*> createChildren() override;
@@ -92,12 +92,12 @@ class QgsMssqlSchemaItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsMssqlSchemaItem( QgsDataItem* parent, const QString& name, const QString& path );
QgsMssqlSchemaItem( QgsDataItem* parent, QString name, QString path );
~QgsMssqlSchemaItem();

QVector<QgsDataItem*> createChildren() override;

QgsMssqlLayerItem* addLayer( const QgsMssqlLayerProperty& layerProperty, bool refresh );
QgsMssqlLayerItem* addLayer( QgsMssqlLayerProperty layerProperty, bool refresh );
void refresh() override {} // do not refresh directly
void addLayers( QgsDataItem* newLayers );
};
@@ -107,7 +107,7 @@ class QgsMssqlLayerItem : public QgsLayerItem
Q_OBJECT

public:
QgsMssqlLayerItem( QgsDataItem* parent, const QString& name, const QString& path, QgsLayerItem::LayerType layerType, const QgsMssqlLayerProperty& layerProperties );
QgsMssqlLayerItem( QgsDataItem* parent, QString name, QString path, QgsLayerItem::LayerType layerType, QgsMssqlLayerProperty layerProperties );
~QgsMssqlLayerItem();

QString createUri();
@@ -1865,7 +1865,7 @@ QGISEXTERN int dataCapabilities()
return QgsDataProvider::Database;
}

QGISEXTERN QgsDataItem *dataItem( const QString& thePath, QgsDataItem *parentItem )
QGISEXTERN QgsDataItem *dataItem( QString thePath, QgsDataItem *parentItem )
{
Q_UNUSED( thePath );
return new QgsMssqlRootItem( parentItem, "MSSQL", "mssql:" );
@@ -688,7 +688,7 @@ void QgsMssqlSourceSelect::setSql( const QModelIndex &index )
delete vlayer;
}

void QgsMssqlSourceSelect::addSearchGeometryColumn( const QString& connectionName, const QgsMssqlLayerProperty& layerProperty, bool estimateMetadata )
void QgsMssqlSourceSelect::addSearchGeometryColumn( QString connectionName, QgsMssqlLayerProperty layerProperty, bool estimateMetadata )
{
// store the column details and do the query in a thread
if ( !mColumnTypeThread )
@@ -738,7 +738,7 @@ void QgsMssqlSourceSelect::setSearchExpression( const QString& regexp )
}


QgsMssqlGeomColumnTypeThread::QgsMssqlGeomColumnTypeThread( const QString& connectionName, bool useEstimatedMetadata )
QgsMssqlGeomColumnTypeThread::QgsMssqlGeomColumnTypeThread( QString connectionName, bool useEstimatedMetadata )
: QThread()
, mConnectionName( connectionName )
, mUseEstimatedMetadata( useEstimatedMetadata )
@@ -747,7 +747,7 @@ QgsMssqlGeomColumnTypeThread::QgsMssqlGeomColumnTypeThread( const QString& conne
qRegisterMetaType<QgsMssqlLayerProperty>( "QgsMssqlLayerProperty" );
}

void QgsMssqlGeomColumnTypeThread::addGeometryColumn( const QgsMssqlLayerProperty& layerProperty )
void QgsMssqlGeomColumnTypeThread::addGeometryColumn( QgsMssqlLayerProperty layerProperty )
{
layerProperties << layerProperty;
}

0 comments on commit fe3417b

Please sign in to comment.
You can’t perform that action at this time.