Skip to content

Commit

Permalink
fix windows build including some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Aug 17, 2019
1 parent 8b4cecb commit 19220b9
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 22 deletions.
Expand Up @@ -384,7 +384,7 @@ Raises a QgsProviderConnectionException if any errors are encountered.



virtual QStringList schemas( ) const throw( QgsProviderConnectionException );
virtual QStringList schemas() const throw( QgsProviderConnectionException );
%Docstring
Returns information about the existing schemas.
Raises a QgsProviderConnectionException if any errors are encountered.
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout/qgsreportsectionmodel.cpp
Expand Up @@ -110,7 +110,9 @@ QVariant QgsReportSectionModel::data( const QModelIndex &index, int role ) const
return QVariant();
}

#ifndef _MSC_VER
return QVariant();
#endif
}

QVariant QgsReportSectionModel::headerData( int section, Qt::Orientation orientation, int role ) const
Expand Down
2 changes: 2 additions & 0 deletions src/core/providers/gdal/qgsgdaldataitems.h
Expand Up @@ -25,6 +25,7 @@
///@cond PRIVATE
#define SIP_NO_FILE

Q_NOWARN_DEPRECATED_PUSH // setCrs is deprecated
class CORE_EXPORT QgsGdalLayerItem : public QgsLayerItem
{
Q_OBJECT
Expand All @@ -44,6 +45,7 @@ class CORE_EXPORT QgsGdalLayerItem : public QgsLayerItem

QString layerName() const override;
};
Q_NOWARN_DEPRECATED_POP

//! Provider for GDAL root data item
class QgsGdalDataItemProvider : public QgsDataItemProvider
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsabstractdatabaseproviderconnection.cpp
Expand Up @@ -37,7 +37,7 @@ QgsAbstractDatabaseProviderConnection::Capabilities QgsAbstractDatabaseProviderC
///@cond PRIVATE
void QgsAbstractDatabaseProviderConnection::checkCapability( QgsAbstractDatabaseProviderConnection::Capability capability ) const
{
if ( ! mCapabilities & capability )
if ( ! mCapabilities.testFlag( capability ) )
{
static QMetaEnum metaEnum = QMetaEnum::fromType<QgsAbstractDatabaseProviderConnection::Capability>();
const QString capName { metaEnum.valueToKey( capability ) };
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsabstractdatabaseproviderconnection.h
Expand Up @@ -74,7 +74,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv
* can contain multiple geometry types and/or CRSs, a clone of the property
* for the individual geometry type/CRS can be retrieved with at(i)
*/
struct TableProperty
struct CORE_EXPORT TableProperty
{

#ifdef SIP_RUN
Expand All @@ -89,7 +89,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv
* The GeometryColumnType struct represents the combination
* of geometry type and CRS for the table geometry column.
*/
struct GeometryColumnType
struct CORE_EXPORT GeometryColumnType
{
#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
Expand Down Expand Up @@ -428,7 +428,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv
* Raises a QgsProviderConnectionException if any errors are encountered.
* \throws QgsProviderConnectionException
*/
virtual QStringList schemas( ) const SIP_THROW( QgsProviderConnectionException );
virtual QStringList schemas() const SIP_THROW( QgsProviderConnectionException );

protected:

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsattributes.cpp
Expand Up @@ -33,7 +33,7 @@ QgsAttributeMap QgsAttributes::toMap() const
uint qHash( const QgsAttributes &attributes )
{
if ( attributes.isEmpty() )
return ~0;
return std::numeric_limits<uint>::max();
else
return qHash( attributes.at( 0 ) );
}
2 changes: 2 additions & 0 deletions src/core/qgsdataitem.h
Expand Up @@ -821,6 +821,7 @@ class CORE_EXPORT QgsProjectHomeItem : public QgsDirectoryItem
* A directory item showing the a single favorite directory.
* \since QGIS 3.0
*/
Q_NOWARN_DEPRECATED_PUSH // rename is deprecated
class CORE_EXPORT QgsFavoriteItem : public QgsDirectoryItem
{
Q_OBJECT
Expand All @@ -835,6 +836,7 @@ class CORE_EXPORT QgsFavoriteItem : public QgsDirectoryItem

QgsFavoritesItem *mFavorites = nullptr;
};
Q_NOWARN_DEPRECATED_POP

#endif
///@endcond
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgslabelingengine.cpp
Expand Up @@ -223,7 +223,7 @@ void QgsLabelingEngine::processProvider( QgsAbstractLabelProvider *provider, Qgs
l->setCentroidInside( flags.testFlag( QgsAbstractLabelProvider::CentroidMustBeInside ) );

// set how to show upside-down labels
pal::Layer::UpsideDownLabels upsdnlabels;
pal::Layer::UpsideDownLabels upsdnlabels = pal::Layer::ShowAll;
switch ( provider->upsidedownLabels() )
{
case QgsPalLayerSettings::Upright:
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssettings.h
Expand Up @@ -329,7 +329,7 @@ class CORE_EXPORT QgsSettings : public QObject
QgsDebugMsg( QStringLiteral( "Invalid metaenum. Enum probably misses Q_ENUM or Q_FLAG declaration." ) );
}

T v;
T v = defaultValue;
bool ok = false;

if ( metaEnum.isValid() )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp
Expand Up @@ -904,7 +904,7 @@ void QgsGraduatedSymbolRendererWidget::classifyGraduated()
return;
}

QgsGraduatedSymbolRenderer::Mode mode;
QgsGraduatedSymbolRenderer::Mode mode = QgsGraduatedSymbolRenderer::Quantile;
bool useSymmetricMode = false;
bool astride = false;

Expand Down
2 changes: 2 additions & 0 deletions src/providers/oracle/qgsoracledataitems.h
Expand Up @@ -103,6 +103,7 @@ class QgsOracleOwnerItem : public QgsDataCollectionItem
void addLayer( const QgsOracleLayerProperty &layerProperty );
};

Q_NOWARN_DEPRECATED_PUSH // deleteLayer deprecated
class QgsOracleLayerItem : public QgsLayerItem
{
Q_OBJECT
Expand All @@ -120,6 +121,7 @@ class QgsOracleLayerItem : public QgsLayerItem
private:
QgsOracleLayerProperty mLayerProperty;
};
Q_NOWARN_DEPRECATED_POP

//! Provider for ORACLE root data item
class QgsOracleDataItemProvider : public QgsDataItemProvider
Expand Down
26 changes: 13 additions & 13 deletions src/providers/postgres/qgspostgresconn.h
Expand Up @@ -88,33 +88,33 @@ struct QgsPostgresLayerProperty
// TODO: rename this !
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }

QString defaultName() const
QString defaultName() const
{
QString n = tableName;
if ( nSpCols > 1 ) n += '.' + geometryColName;
return n;
}

QgsPostgresLayerProperty at( unsigned int i ) const
QgsPostgresLayerProperty at( int i ) const
{
QgsPostgresLayerProperty property;

Q_ASSERT( i >= 0 && i < size() );

property.types << types[ i ];
property.srids << srids[ i ];
property.schemaName = schemaName;
property.tableName = tableName;
property.geometryColName = geometryColName;
property.geometryColType = geometryColType;
property.pkCols = pkCols;
property.nSpCols = nSpCols;
property.sql = sql;
property.relKind = relKind;
property.isView = isView;
property.isRaster = isRaster;
property.schemaName = schemaName;
property.tableName = tableName;
property.geometryColName = geometryColName;
property.geometryColType = geometryColType;
property.pkCols = pkCols;
property.nSpCols = nSpCols;
property.sql = sql;
property.relKind = relKind;
property.isView = isView;
property.isRaster = isRaster;
property.isMaterializedView = isMaterializedView;
property.tableComment = tableComment;
property.tableComment = tableComment;

return property;
}
Expand Down

0 comments on commit 19220b9

Please sign in to comment.