42
42
#include " qgsanimatedicon.h"
43
43
44
44
// use GDAL VSI mechanism
45
+ #define CPL_SUPRESS_CPLUSPLUS
45
46
#include " cpl_vsi.h"
46
47
#include " cpl_string.h"
47
48
@@ -1329,7 +1330,7 @@ char **VSIReadDirRecursive1( const char *pszPath )
1329
1330
char **papszFiles1 = nullptr ;
1330
1331
char **papszFiles2 = nullptr ;
1331
1332
VSIStatBufL psStatBuf;
1332
- CPLString osTemp1, osTemp2 ;
1333
+ QString temp1, temp2 ;
1333
1334
int i, j;
1334
1335
int nCount1, nCount2;
1335
1336
@@ -1343,41 +1344,35 @@ char **VSIReadDirRecursive1( const char *pszPath )
1343
1344
for ( i = 0 ; i < nCount1; i++ )
1344
1345
{
1345
1346
// build complete file name for stat
1346
- osTemp1.clear ();
1347
- osTemp1.append ( pszPath );
1348
- osTemp1.append ( " /" );
1349
- osTemp1.append ( papszFiles1[i] );
1347
+ temp1 = QString ( " %1/%2" ).arg ( pszPath, papszFiles1[i] );
1350
1348
1351
1349
// if is file, add it
1352
- if ( VSIStatL ( osTemp1. c_str (), &psStatBuf ) == 0 &&
1350
+ if ( VSIStatL ( temp1. toUtf8 (), &psStatBuf ) == 0 &&
1353
1351
VSI_ISREG ( psStatBuf.st_mode ) )
1354
1352
{
1355
1353
// oFiles.AddString( papszFiles1[i] );
1356
1354
papszOFiles = CSLAddString ( papszOFiles, papszFiles1[i] );
1357
1355
}
1358
- else if ( VSIStatL ( osTemp1. c_str (), &psStatBuf ) == 0 &&
1356
+ else if ( VSIStatL ( temp1. toUtf8 (), &psStatBuf ) == 0 &&
1359
1357
VSI_ISDIR ( psStatBuf.st_mode ) )
1360
1358
{
1361
1359
// add directory entry
1362
- osTemp2.clear ();
1363
- osTemp2.append ( papszFiles1[i] );
1364
- osTemp2.append ( " /" );
1365
- // oFiles.AddString( osTemp2.c_str() );
1366
- papszOFiles = CSLAddString ( papszOFiles, osTemp2.c_str () );
1360
+ temp2 = QString ( " %1/" ).arg ( papszFiles1[i] );
1361
+
1362
+ // oFiles.AddString( temp2.toUtf8() );
1363
+ papszOFiles = CSLAddString ( papszOFiles, temp2.toUtf8 () );
1367
1364
1368
1365
// recursively add files inside directory
1369
- papszFiles2 = VSIReadDirRecursive1 ( osTemp1. c_str () );
1366
+ papszFiles2 = VSIReadDirRecursive1 ( temp1. toUtf8 () );
1370
1367
if ( papszFiles2 )
1371
1368
{
1372
1369
nCount2 = CSLCount ( papszFiles2 );
1373
1370
for ( j = 0 ; j < nCount2; j++ )
1374
1371
{
1375
- osTemp2.clear ();
1376
- osTemp2.append ( papszFiles1[i] );
1377
- osTemp2.append ( " /" );
1378
- osTemp2.append ( papszFiles2[j] );
1379
- // oFiles.AddString( osTemp2.c_str() );
1380
- papszOFiles = CSLAddString ( papszOFiles, osTemp2.c_str () );
1372
+ temp2 = QString ( " %1/%2" ).arg ( papszFiles1[i], papszFiles2[j] );
1373
+
1374
+ // oFiles.AddString( temp2.toUtf8() );
1375
+ papszOFiles = CSLAddString ( papszOFiles, temp2.toUtf8 () );
1381
1376
}
1382
1377
CSLDestroy ( papszFiles2 );
1383
1378
}
0 commit comments