QString aDbfFileName = thePyScriptPath;
aDbfFileName.replace( ".py", ".dbf" );
- //TODO: export shape file
ExportSHP( aShpFileName );
QString anAttr = "CODE_06"; //TODO: some custom choice
SHPClose( hSHPHandle );
QString aFN = aFileName.simplified();
remove (aFN.toStdString().c_str());
- remove (aFN.replace( ".shp", ".shx", Qt::CaseInsensitive).toStdString().c_str());
+ remove ((aFN.simplified().replace( aFN.simplified().size() - 4, 4, ".shx")).toStdString().c_str());
}
}
SHPClose( hSHPHandle );
QString aFN = aFileName.simplified();
remove (aFN.toStdString().c_str());
- remove (aFN.replace( ".shp", ".shx", Qt::CaseInsensitive).toStdString().c_str());
+ remove ((aFN.simplified().replace( aFN.simplified().size() - 4, 4, ".shx")).toStdString().c_str());
}
}
int HYDROData_ShapeFile::TryOpenShapeFile(QString theFileName)
{
QString aSHPfile = theFileName.simplified();
- QString aSHXfile = theFileName.simplified().replace( ".shp", ".shx", Qt::CaseInsensitive);
+ QString aSHXfile = theFileName.simplified().replace( theFileName.simplified().size() - 4, 4, ".shx");
FILE* pFileSHP = NULL;
pFileSHP = fopen (aSHPfile.toAscii().data(), "r");
FILE* pFileSHX = NULL;
bool HYDROData_ShapeFile::CheckDBFFileExisting(const QString& theSHPFilePath, QString& thePathToDBFFile)
{
QString aSHPfile = theSHPFilePath.simplified();
- QString aDBFfile = theSHPFilePath.simplified().replace( ".shp", ".dbf", Qt::CaseInsensitive);
+ QString aDBFfile = theSHPFilePath.simplified().replace( theSHPFilePath.simplified().size() - 4, 4, ".dbf");
FILE* pFileDBF = NULL;
pFileDBF = fopen (aDBFfile.toAscii().data(), "r");
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- myFileNameGroup = new QGroupBox( tr( "IMPORT_LANDCOVERMAP_FROM_FILE" ) );
+ myFileNameGroup = new QGroupBox( tr( "IMPORT_LANDCOVER_MAP_FROM_FILE" ) );
QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), myFileNameGroup );
void HYDROGUI_ImportLandCoverMapDlg::onBrowse()
{
QString aFilter( tr( "LANDCOVERMAP_FILTER" ) );
- QString aFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_LANDCOVERMAP_FROM_FILE" ), true );
+ QString aFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_LANDCOVER_MAP_FROM_FILE" ), true );
if( !aFileName.isEmpty() )
{
HYDROGUI_ImportLandCoverMapOp::HYDROGUI_ImportLandCoverMapOp( HYDROGUI_Module* theModule )
: HYDROGUI_Operation( theModule )
{
- setName( tr( "IMPORT_LANDCOVERMAP" ) );
+ setName( tr( "IMPORT_LANDCOVER_MAP" ) );
}
HYDROGUI_ImportLandCoverMapOp::~HYDROGUI_ImportLandCoverMapOp()
//
//Try to load DBF-database...
QString aDBFFileName;
- aDBFFileName = myFileName.simplified().replace( ".shp", ".dbf", Qt::CaseInsensitive);
+ aDBFFileName = myFileName.simplified().replace( myFileName.simplified().size() - 4, 4, ".dbf");
bool DBF_Stat = myImporter.DBF_OpenDBF(aDBFFileName);
// TODO:
// add MSG BOX if stat is bad
aMess += tr( "CANNT_OPEN_SHX" );
else
aMess += tr ("SHP_TYPEFORMAT_MESS") + myImporter.GetShapeTypeName(aShapeTypeOfFile);
- SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), aMess);
+ SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER_MAP" ), aMess);
commitDocOperation();
myImporter.Free();
//abort();
<translation>Shape files (*.shp)</translation>
</message>
<message>
- <source>IMPORT_LANDCOVERMAP_FROM_FILE</source>
+ <source>IMPORT_LANDCOVER_MAP_FROM_FILE</source>
<translation>Import land cover map from file</translation>
</message>
<message>
#endif
#include <cppunit/extensions/HelperMacros.h>
-//#define SHP_TESTS
+#define SHP_TESTS
class test_HYDROData_LandCoverMap : public CppUnit::TestFixture
{