Skip to content

Commit 2624cde

Browse files
author
telwertowski
committed
Addendum to r9288. Header adjustments for Linux and removal of const for GRASS 6.2 compatibility.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9291 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 98c3309 commit 2624cde

8 files changed

+31
-30
lines changed

src/plugins/grass/qgsgrassattributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <QHeaderView>
2424
#include <QKeyEvent>
25-
#include <QMessagebox>
25+
#include <QMessageBox>
2626
#include <QSettings>
2727
#include <QTableWidget>
2828

src/plugins/grass/qgsgrassnewmapset.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,13 +1256,13 @@ void QgsGrassNewMapset::createMapset()
12561256
// database path
12571257
QgsGrass::activeMode(); // because it calls private gsGrass::init()
12581258
#if defined(WIN32)
1259-
G__setenv( "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii() );
1259+
G__setenv( "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
12601260
#else
1261-
G__setenv( "GISDBASE", mDatabaseLineEdit->text().toAscii() );
1261+
G__setenv( "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
12621262
#endif
12631263

12641264
QgsGrass::resetError();
1265-
int ret = G_make_location( location.toAscii(), &mCellHead,
1265+
int ret = G_make_location( location.toAscii().data(), &mCellHead,
12661266
mProjInfo, mProjUnits, stdout );
12671267

12681268
if ( ret != 0 )

src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void QgsGrassPlugin::displayRegion()
548548
QgsGrass::setLocation( gisdbase, location );
549549

550550
struct Cell_head window;
551-
char *err = G__get_window( &window, "", "WIND", mapset.toLatin1().constData() );
551+
char *err = G__get_window( &window, "", "WIND", mapset.toLatin1().data() );
552552

553553
if ( err )
554554
{

src/plugins/grass/qgsgrassplugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class QgsRubberBand;
2929

3030
class QAction;
3131
class QIcon;
32+
class QPainter;
3233
class QToolBar;
3334

3435
/**

src/plugins/grass/qgsgrassregion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ QgsGrassRegion::QgsGrassRegion( QgsGrassPlugin *plugin, QgisInterface *iface,
165165
}
166166

167167
QgsGrass::setLocation( gisdbase, location );
168-
char *err = G__get_window( &mWindow, "", "WIND", mapset.toLatin1() );
168+
char *err = G__get_window( &mWindow, "", "WIND", mapset.toLatin1().data() );
169169

170170
if ( err )
171171
{
@@ -426,7 +426,7 @@ void QgsGrassRegion::accept()
426426
}
427427

428428
QgsGrass::setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
429-
G__setenv( "MAPSET", QgsGrass::getDefaultMapset().toLatin1() );
429+
G__setenv( "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
430430

431431
if ( G_put_window( &mWindow ) == -1 )
432432
{

src/plugins/grass/qgsgrassselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "qgslogger.h"
2121

2222
#include <QFileDialog>
23-
#include <QMessagebox>
23+
#include <QMessageBox>
2424
#include <QSettings>
2525

2626
extern "C"

src/providers/grass/qgsgrass.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ void QgsGrass::setLocation( QString gisdbase, QString location )
314314

315315
// Set principal GRASS variables (in memory)
316316
#if defined(WIN32)
317-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().constData() );
317+
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
318318
#else
319-
G__setenv( "GISDBASE", gisdbase.toAscii().constData() );
319+
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
320320
#endif
321-
G__setenv( "LOCATION_NAME", location.toAscii().constData() );
321+
G__setenv( "LOCATION_NAME", location.toAscii().data() );
322322
G__setenv( "MAPSET", "PERMANENT" ); // PERMANENT must always exist
323323

324324
// Add all available mapsets to search path
@@ -333,12 +333,12 @@ void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
333333

334334
// Set principal GRASS variables (in memory)
335335
#if defined(WIN32)
336-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().constData() );
336+
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
337337
#else
338-
G__setenv( "GISDBASE", gisdbase.toAscii().constData() );
338+
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
339339
#endif
340-
G__setenv( "LOCATION_NAME", location.toAscii().constData() );
341-
G__setenv( "MAPSET", mapset.toAscii().constData() );
340+
G__setenv( "LOCATION_NAME", location.toAscii().data() );
341+
G__setenv( "MAPSET", mapset.toAscii().data() );
342342

343343
// Add all available mapsets to search path
344344
char **ms = G_available_mapsets();
@@ -557,14 +557,14 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
557557
putenv( gisrcEnvChar );
558558

559559
// Reinitialize GRASS
560-
G__setenv( "GISRC", gisrcEnv.toAscii().constData() );
560+
G__setenv( "GISRC", gisrcEnv.toAscii().data() );
561561
#if defined(WIN32)
562-
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().constData() );
562+
G__setenv( "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
563563
#else
564-
G__setenv( "GISDBASE", gisdbase.toAscii().constData() );
564+
G__setenv( "GISDBASE", gisdbase.toAscii().data() );
565565
#endif
566-
G__setenv( "LOCATION_NAME", location.toAscii().constData() );
567-
G__setenv( "MAPSET", mapset.toAscii().constData() );
566+
G__setenv( "LOCATION_NAME", location.toAscii().data() );
567+
G__setenv( "MAPSET", mapset.toAscii().data() );
568568
defaultGisdbase = gisdbase;
569569
defaultLocation = location;
570570
defaultMapset = mapset;
@@ -876,7 +876,7 @@ bool GRASS_EXPORT QgsGrass::region( QString gisbase,
876876
{
877877
QgsGrass::setLocation( gisbase, location );
878878

879-
if ( G__get_window( window, "", "WIND", mapset.toLocal8Bit().constData() ) )
879+
if ( G__get_window( window, "", "WIND", mapset.toLocal8Bit().data() ) )
880880
{
881881
return false;
882882
}
@@ -957,8 +957,8 @@ bool GRASS_EXPORT QgsGrass::mapRegion( int type, QString gisbase,
957957
if ( type == Raster )
958958
{
959959

960-
if ( G_get_cellhd( map.toLocal8Bit().constData(),
961-
mapset.toLocal8Bit().constData(), window ) < 0 )
960+
if ( G_get_cellhd( map.toLocal8Bit().data(),
961+
mapset.toLocal8Bit().data(), window ) < 0 )
962962
{
963963
QMessageBox::warning( 0, QObject::tr( "Warning" ),
964964
QObject::tr( "Cannot read raster map region" ) );
@@ -1010,8 +1010,8 @@ bool GRASS_EXPORT QgsGrass::mapRegion( int type, QString gisbase,
10101010
else if ( type == Region )
10111011
{
10121012
if ( G__get_window( window, "windows",
1013-
map.toLocal8Bit().constData(),
1014-
mapset.toLocal8Bit().constData() ) != NULL )
1013+
map.toLocal8Bit().data(),
1014+
mapset.toLocal8Bit().data() ) != NULL )
10151015
{
10161016
QMessageBox::warning( 0, QObject::tr( "Warning" ),
10171017
QObject::tr( "Cannot read region" ) );

src/providers/grass/qgsgrassprovider.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ int QgsGrassProvider::openMap( QString gisdbase, QString location, QString mapse
985985
QgsDebugMsg( QString( "Setting gisdbase, location: %1, %2" ).arg( gisdbase ).arg( location ) );
986986

987987
// Find the vector
988-
char *ms = G_find_vector2( mapName.toAscii().constData(), mapset.toAscii().constData() ) ;
988+
char *ms = G_find_vector2( mapName.toAscii().data(), mapset.toAscii().data() ) ;
989989

990990
if ( ms == NULL )
991991
{
@@ -1074,7 +1074,7 @@ void QgsGrassProvider::updateMap( int mapId )
10741074

10751075
// TODO: Should be done better / in other place ?
10761076
// TODO: Is it necessary for close ?
1077-
G__setenv( "MAPSET", map->mapset.toAscii().constData() );
1077+
G__setenv( "MAPSET", map->mapset.toAscii().data() );
10781078

10791079
if ( closeMap ) Vect_close( map->map );
10801080

@@ -1345,7 +1345,7 @@ bool QgsGrassProvider::isGrassEditable( void )
13451345
return false;
13461346

13471347
/* Check if current user is owner of mapset */
1348-
if ( G__mapset_permissions2( mGisdbase.toAscii().constData(), mLocation.toAscii().constData(), mMapset.toAscii().constData() ) != 1 )
1348+
if ( G__mapset_permissions2( mGisdbase.toAscii().data(), mLocation.toAscii().data(), mMapset.toAscii().data() ) != 1 )
13491349
return false;
13501350

13511351
// TODO: check format? (cannot edit OGR layers)
@@ -1423,7 +1423,7 @@ bool QgsGrassProvider::startEdit( void )
14231423

14241424
// Set current mapset (mapset was previously checked by isGrassEditable() )
14251425
// TODO: Should be done better / in other place ?
1426-
G__setenv( "MAPSET", map->mapset.toAscii().constData() );
1426+
G__setenv( "MAPSET", map->mapset.toAscii().data() );
14271427

14281428
Vect_close( map->map );
14291429

@@ -1499,7 +1499,7 @@ bool QgsGrassProvider::closeEdit( bool newMap )
14991499
// Set current mapset (mapset was previously checked by isGrassEditable() )
15001500
// TODO: Should be done better / in other place ?
15011501
// TODO: Is it necessary for build/close ?
1502-
G__setenv( "MAPSET", map->mapset.toAscii().constData() );
1502+
G__setenv( "MAPSET", map->mapset.toAscii().data() );
15031503

15041504
Vect_build_partial( map->map, GV_BUILD_NONE, NULL );
15051505
Vect_build( map->map, stderr );

0 commit comments

Comments
 (0)