Skip to content

Commit 26810a3

Browse files
author
rblazek
committedMar 25, 2010
enabled toLocal8Bit for GISDBASE on win
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13158 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,13 @@ void QgsGrass::setLocation( QString gisdbase, QString location )
330330
init();
331331

332332
// Set principal GRASS variables (in memory)
333-
// #if defined(WIN32)
334-
// G__setenv(( char * ) "GISDBASE", shortPath( gisdbase ).toLocal8Bit().data() );
335-
//#else
333+
#if defined(WIN32)
334+
G__setenv(( char * ) "GISDBASE", shortPath( gisdbase ).toLocal8Bit().data() );
335+
#else
336+
// This does not work for GISBAS with non ascii chars on Windows XP,
337+
// gives error 'LOCATION ... not available':
336338
G__setenv(( char * ) "GISDBASE", gisdbase.toUtf8().constData() );
337-
//#endif
339+
#endif
338340
G__setenv(( char * ) "LOCATION_NAME", location.toUtf8().constData() );
339341
G__setenv(( char * ) "MAPSET", ( char * ) "PERMANENT" ); // PERMANENT must always exist
340342

@@ -349,11 +351,11 @@ void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
349351
init();
350352

351353
// Set principal GRASS variables (in memory)
352-
// #if defined(WIN32)
353-
// G__setenv(( char * ) "GISDBASE", shortPath( gisdbase ).toUtf8().data() );
354-
// #else
354+
#if defined(WIN32)
355+
G__setenv(( char * ) "GISDBASE", shortPath( gisdbase ).toUtf8().data() );
356+
#else
355357
G__setenv(( char * ) "GISDBASE", gisdbase.toUtf8().data() );
356-
// #endif
358+
#endif
357359
G__setenv(( char * ) "LOCATION_NAME", location.toUtf8().data() );
358360
G__setenv(( char * ) "MAPSET", mapset.toUtf8().data() );
359361

0 commit comments

Comments
 (0)
Please sign in to comment.