Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 20, 2021
1 parent de40669 commit ae87751
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions src/providers/db2/qgsdb2provider.cpp
Expand Up @@ -1285,7 +1285,7 @@ bool QgsDb2Provider::changeGeometryValues( const QgsGeometryMap &geometry_map )
return true;
}

Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
QgsVectorLayerExporter::ExportError QgsDb2Provider::createEmptyLayer( const QString &uri,
const QgsFields &fields,
QgsWkbTypes::Type wkbType,
const QgsCoordinateReferenceSystem &srs,
Expand All @@ -1308,7 +1308,7 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
{
if ( errorMessage )
*errorMessage = errMsg;
return Qgis::VectorExportResult::ErrorConnectionFailed;
return QgsVectorLayerExporter::ErrConnectionFailed;
}

// Get the SRS name using srid, needed to register the spatial column
Expand Down Expand Up @@ -1433,7 +1433,7 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
{
*errorMessage = lastError;
}
return Qgis::VectorExportResult::ErrorCreatingLayer;
return QgsVectorLayerExporter::ErrCreateLayer;
}
}
}
Expand Down Expand Up @@ -1473,7 +1473,7 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
{
*errorMessage = QObject::tr( "Unsupported type for field %1" ).arg( fld.name() );
}
return Qgis::VectorExportResult::ErrorAttributeTypeUnsupported;
return QgsVectorLayerExporter::ErrAttributeTypeUnsupported;
}

if ( oldToNewAttrIdxMap )
Expand Down Expand Up @@ -1513,7 +1513,7 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,
{
*errorMessage = lastError;
}
return Qgis::VectorExportResult::ErrorCreatingLayer;
return QgsVectorLayerExporter::ErrCreateLayer;
}


Expand Down Expand Up @@ -1591,7 +1591,7 @@ Qgis::VectorExportResult QgsDb2Provider::createEmptyLayer( const QString &uri,

}
QgsDebugMsg( QStringLiteral( "successfully created empty layer" ) );
return Qgis::VectorExportResult::Success;
return QgsVectorLayerExporter::NoError;
}

QString QgsDb2Provider::qgsFieldToDb2Field( const QgsField &field )
Expand Down Expand Up @@ -1746,7 +1746,7 @@ QList< QgsDataItemProvider * > QgsDb2ProviderMetadata::dataItemProviders() const
return providers;
}

Qgis::VectorExportResult QgsDb2ProviderMetadata::createEmptyLayer(
QgsVectorLayerExporter::ExportError QgsDb2ProviderMetadata::createEmptyLayer(
const QString &uri,
const QgsFields &fields,
QgsWkbTypes::Type wkbType,
Expand Down
24 changes: 12 additions & 12 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -2821,7 +2821,7 @@ bool QgsOracleProvider::convertField( QgsField &field )
return true;
}

QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
Qgis::VectorExportResult QgsOracleProvider::createEmptyLayer(
const QString &uri,
const QgsFields &fields,
QgsWkbTypes::Type wkbType,
Expand All @@ -2845,7 +2845,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( !conn )
{
errorMessage = QObject::tr( "Connection to database failed" );
return QgsVectorLayerExporter::ErrConnectionFailed;
return Qgis::VectorExportResult::ErrorConnectionFailed;
}

if ( ownerName.isEmpty() )
Expand All @@ -2856,7 +2856,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( ownerName.isEmpty() )
{
errorMessage = QObject::tr( "No owner name found" );
return QgsVectorLayerExporter::ErrInvalidLayer;
return Qgis::VectorExportResult::ErrorInvalidLayer;
}

QString tableName = dsUri.table();
Expand All @@ -2874,7 +2874,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( geometryColumn.isEmpty() && fields.isEmpty() )
{
errorMessage = QObject::tr( "Cannot create a table with no columns" );
return QgsVectorLayerExporter::ErrCreateDataSource;
return Qgis::VectorExportResult::ErrorCreatingDataSource;
}

// get the pk's name and type
Expand Down Expand Up @@ -3001,7 +3001,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(

conn->disconnect();

return QgsVectorLayerExporter::ErrCreateLayer;
return Qgis::VectorExportResult::ErrorCreatingLayer;
}

conn->disconnect();
Expand All @@ -3019,7 +3019,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( !provider->isValid() )
{
errorMessage = QObject::tr( "Loading of the layer %1 failed" ).arg( ownerTableName );
return QgsVectorLayerExporter::ErrInvalidLayer;
return Qgis::VectorExportResult::ErrorInvalidLayer;
}

QgsDebugMsgLevel( QStringLiteral( "layer loaded" ), 2 );
Expand Down Expand Up @@ -3058,7 +3058,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( j == 3 )
{
errorMessage = QObject::tr( "Field name clash found (%1 not remappable)" ).arg( fld.name() );
return QgsVectorLayerExporter::ErrAttributeTypeUnsupported;
return Qgis::VectorExportResult::ErrorAttributeTypeUnsupported;
}
}

Expand Down Expand Up @@ -3091,7 +3091,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( !( options && options->value( QStringLiteral( "skipConvertFields" ), false ).toBool() ) && ! convertField( fld ) )
{
errorMessage = QObject::tr( "Unsupported type for field %1" ).arg( fld.name() );
return QgsVectorLayerExporter::ErrAttributeTypeUnsupported;
return Qgis::VectorExportResult::ErrorAttributeTypeUnsupported;
}

QgsDebugMsgLevel( QStringLiteral( "Field #%1 name %2 type %3 typename %4 width %5 precision %6" )
Expand All @@ -3106,7 +3106,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
if ( !provider->addAttributes( flist ) )
{
errorMessage = QObject::tr( "Creation of fields failed" );
return QgsVectorLayerExporter::ErrAttributeCreationFailed;
return Qgis::VectorExportResult::ErrorAttributeCreationFailed;
}

QgsDebugMsgLevel( QStringLiteral( "Done creating fields" ), 2 );
Expand All @@ -3120,10 +3120,10 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
&& !provider->deleteAttributes( QgsAttributeIds { provider->fields().indexOf( fakeColumn ) } ) )
{
errorMessage = QObject::tr( "Remove of temporary column '%1' failed" ).arg( fakeColumn );
return QgsVectorLayerExporter::ErrAttributeCreationFailed;
return Qgis::VectorExportResult::ErrorAttributeCreationFailed;
}

return QgsVectorLayerExporter::NoError;
return Qgis::VectorExportResult::Success;
}

void QgsOracleProvider::insertGeomMetadata( QgsOracleConn *conn, const QString &tableName, const QString &geometryColumn, const QgsCoordinateReferenceSystem &srs )
Expand Down Expand Up @@ -3295,7 +3295,7 @@ QgsTransaction *QgsOracleProviderMetadata::createTransaction( const QString &con

// ---------------------------------------------------------------------------

QgsVectorLayerExporter::ExportError QgsOracleProviderMetadata::createEmptyLayer( const QString &uri,
Qgis::VectorExportResult QgsOracleProviderMetadata::createEmptyLayer( const QString &uri,
const QgsFields &fields,
QgsWkbTypes::Type wkbType,
const QgsCoordinateReferenceSystem &srs,
Expand Down
4 changes: 2 additions & 2 deletions src/providers/oracle/qgsoracleprovider.h
Expand Up @@ -66,7 +66,7 @@ class QgsOracleProvider final: public QgsVectorDataProvider
public:

//! Import a vector layer into the database
static QgsVectorLayerExporter::ExportError createEmptyLayer(
static Qgis::VectorExportResult createEmptyLayer(
const QString &uri,
const QgsFields &fields,
QgsWkbTypes::Type wkbType,
Expand Down Expand Up @@ -420,7 +420,7 @@ class QgsOracleProviderMetadata final: public QgsProviderMetadata
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle, const QString &styleName,
const QString &styleDescription, const QString &uiFileContent, bool useAsDefault, QString &errCause ) override;
void cleanupProvider() override;
QgsVectorLayerExporter::ExportError createEmptyLayer( const QString &uri,
Qgis::VectorExportResult createEmptyLayer( const QString &uri,
const QgsFields &fields, QgsWkbTypes::Type wkbType,
const QgsCoordinateReferenceSystem &srs, bool overwrite,
QMap<int, int> &oldToNewAttrIdxMap, QString &errorMessage,
Expand Down
2 changes: 1 addition & 1 deletion tests/code_layout/sipifyheader.expected.sip
Expand Up @@ -91,7 +91,7 @@ typedef QtClass<QVariant> QtClassQVariantBase;
ImaginarySuccess,
RecursiveSuccess,
SuccessCombination,
PythonName /PyName=DifferentName/,
PythonName,
};
typedef QFlags<QgsSipifyHeader::MyEnum> Flags;

Expand Down

0 comments on commit ae87751

Please sign in to comment.