aResList << QString( "%1.SetAltitudesInverted( %2 );" )
.arg( aBathymetryName ).arg( IsAltitudesInverted() );
- QString aFilePath = GetFilePath();
- if ( !aFilePath.isEmpty() )
+ TCollection_AsciiString aFilePath = GetFilePath();
+ if ( !aFilePath.IsEmpty() )
{
aResList << QString( "%1.ImportFromFile( \"%2\" );" )
- .arg( aBathymetryName ).arg( aFilePath );
+ .arg( aBathymetryName ).arg( aFilePath.ToCString() );
}
else
{
return aResAltitude;
}
-void HYDROData_Bathymetry::SetFilePath(const QString& theFilePath)
+void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath )
{
- TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() );
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+ TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
}
-QString HYDROData_Bathymetry::GetFilePath() const
+TCollection_AsciiString HYDROData_Bathymetry::GetFilePath() const
{
- QString aRes;
+ TCollection_AsciiString aRes;
TDF_Label aLabel = myLab.FindChild( DataTag_FilePath, false );
if ( !aLabel.IsNull() )
{
Handle(TDataStd_AsciiString) anAsciiStr;
if ( aLabel.FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) )
- aRes = QString( anAsciiStr->Get().ToCString() );
+ aRes = anAsciiStr->Get();
}
return aRes;
return aRes;
}
-bool HYDROData_Bathymetry::ImportFromFile( const QString& theFileName )
+bool HYDROData_Bathymetry::ImportFromFile( const TCollection_AsciiString& theFileName )
{
// Try to open the file
- QFile aFile( theFileName );
+ QFile aFile( theFileName.ToCString() );
if ( !aFile.exists() || !aFile.open( QIODevice::ReadOnly ) )
return false;
* Stores the bathymetry file path
* \param theFilePath image file path
*/
- HYDRODATA_EXPORT void SetFilePath( const QString& theFilePath );
+ HYDRODATA_EXPORT void SetFilePath( const TCollection_AsciiString& theFilePath );
/**
* Returns uploaded bathymetry file path
*/
- HYDRODATA_EXPORT QString GetFilePath() const;
+ HYDRODATA_EXPORT TCollection_AsciiString GetFilePath() const;
/**
* Set flag indicating needs to invert altitude values
* \param theFileName the path to file
* \return \c true if file has been successfully read
*/
- HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFileName );
+ HYDRODATA_EXPORT virtual bool ImportFromFile( const TCollection_AsciiString& theFileName );
HYDRODATA_EXPORT bool CreateBoundaryPolyline() const;
if ( !createTestFile( aFileName ) )
return; // No file has been created
- CPPUNIT_ASSERT( aBathymetry->ImportFromFile( aFileName ) );
+ CPPUNIT_ASSERT( aBathymetry->ImportFromFile( aFileName.toStdString().c_str() ) );
HYDROData_Bathymetry::AltitudePoints anAltitudePoints = aBathymetry->GetAltitudePoints();
CPPUNIT_ASSERT( anAltitudePoints.Length() == 20 );
if ( anIsFileCreated )
{
- CPPUNIT_ASSERT( aBathymetry1->ImportFromFile( aFileName ) );
+ CPPUNIT_ASSERT( aBathymetry1->ImportFromFile( aFileName.toStdString().c_str() ) );
HYDROData_Bathymetry::AltitudePoints anAltitudePoints = aBathymetry1->GetAltitudePoints();
CPPUNIT_ASSERT( anAltitudePoints.Length() == 20 );
if( !myEditedObject.IsNull() )
{
QString aName = myEditedObject->GetName();
- QString aFileName = myEditedObject->GetFilePath();
+ QString aFileName = HYDROGUI_Tool::ToQString( myEditedObject->GetFilePath() );
bool anIsAltitudesInverted = myEditedObject->IsAltitudesInverted();
aPanel->setObjectName( aName );
if ( aBathymetryObj.IsNull() )
return false;
- QString anOldFileName = aBathymetryObj->GetFilePath();
+ QString anOldFileName = HYDROGUI_Tool::ToQString( aBathymetryObj->GetFilePath() );
if ( aFileName != anOldFileName )
{
aBathymetryObj->SetAltitudesInverted( anIsInvertAltitudes, false );
- if ( !aBathymetryObj->ImportFromFile( aFileName ) )
+ if ( !aBathymetryObj->ImportFromFile( HYDROGUI_Tool::ToAsciiString( aFileName ) ) )
{
theErrorMsg = tr( "BAD_IMPORTED_BATHYMETRY_FILE" ).arg( aFileName );
return false;