mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Translate GDAL error codes
This commit is contained in:
parent
da6049ea38
commit
2ffa7ba3a1
@ -4332,41 +4332,41 @@ QGISEXTERN bool deleteLayer( const QString &uri, QString &errCause )
|
|||||||
switch ( error )
|
switch ( error )
|
||||||
{
|
{
|
||||||
case OGRERR_NOT_ENOUGH_DATA:
|
case OGRERR_NOT_ENOUGH_DATA:
|
||||||
errCause = QStringLiteral( "Not enough data to deserialize" );
|
errCause = QObject::tr( "Not enough data to deserialize" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_NOT_ENOUGH_MEMORY:
|
case OGRERR_NOT_ENOUGH_MEMORY:
|
||||||
errCause = QStringLiteral( "Not enough memory" );
|
errCause = QObject::tr( "Not enough memory" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
|
case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
|
||||||
errCause = QStringLiteral( "Unsupported geometry type" );
|
errCause = QObject::tr( "Unsupported geometry type" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_UNSUPPORTED_OPERATION:
|
case OGRERR_UNSUPPORTED_OPERATION:
|
||||||
errCause = QStringLiteral( "Unsupported operation" );
|
errCause = QObject::tr( "Unsupported operation" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_CORRUPT_DATA:
|
case OGRERR_CORRUPT_DATA:
|
||||||
errCause = QStringLiteral( "Corrupt data" );
|
errCause = QObject::tr( "Corrupt data" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_FAILURE:
|
case OGRERR_FAILURE:
|
||||||
errCause = QStringLiteral( "Failure" );
|
errCause = QObject::tr( "Failure" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_UNSUPPORTED_SRS:
|
case OGRERR_UNSUPPORTED_SRS:
|
||||||
errCause = QStringLiteral( "Unsupported SRS" );
|
errCause = QObject::tr( "Unsupported SRS" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_INVALID_HANDLE:
|
case OGRERR_INVALID_HANDLE:
|
||||||
errCause = QStringLiteral( "Invalid handle" );
|
errCause = QObject::tr( "Invalid handle" );
|
||||||
break;
|
break;
|
||||||
case OGRERR_NON_EXISTING_FEATURE:
|
case OGRERR_NON_EXISTING_FEATURE:
|
||||||
errCause = QStringLiteral( "Non existing feature" );
|
errCause = QObject::tr( "Non existing feature" );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case OGRERR_NONE:
|
case OGRERR_NONE:
|
||||||
errCause = QStringLiteral( "Success" );
|
errCause = QObject::tr( "Success" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
errCause = QStringLiteral( "OGR result code: %s" ).arg( errCause );
|
errCause = QObject::tr( "GDAL result code: %s" ).arg( errCause );
|
||||||
return error == OGRERR_NONE;
|
return error == OGRERR_NONE;
|
||||||
}
|
}
|
||||||
// This should never happen:
|
// This should never happen:
|
||||||
errCause = QStringLiteral( "Layer not found: %s" ).arg( uri );
|
errCause = QObject::tr( "Layer not found: %s" ).arg( uri );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user