Skip to content
Permalink
Browse files

fixed setting error rutin

git-svn-id: http://svn.osgeo.org/qgis/trunk@5093 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 24, 2006
1 parent a4904a7 commit e1ee8d403faaee022a3b526c62cfd5ff10e4f240
Showing with 15 additions and 4 deletions.
  1. +11 −3 src/providers/grass/qgsgrass.cpp
  2. +2 −1 src/providers/grass/qgsgrass.h
  3. +2 −0 src/providers/grass/qgsgrassprovider.cpp
@@ -38,6 +38,13 @@ extern "C" {

void QgsGrass::init( void )
{
// Warning!!!
// G_set_error_routine() once called from plugin
// is not valid in provider -> call it always

// Set error function
G_set_error_routine ( &error_routine );

if ( initialized ) return;

QSettings settings("QuantumGIS", "qgis");
@@ -59,9 +66,6 @@ void QgsGrass::init( void )
// Init GRASS libraries (required)
G_no_gisinit(); // Doesn't check write permissions for mapset compare to G_gisinit("libgrass++");

// Set error function
G_set_error_routine ( &error_routine );

// Set program name
G_set_program_name ("QGIS");

@@ -258,6 +262,10 @@ QString QgsGrass::defaultGisdbase;
QString QgsGrass::defaultLocation;
QString QgsGrass::defaultMapset;

QString QgsGrass::mMapsetLock;
QString QgsGrass::mGisrc;
QString QgsGrass::mTmp;

int QgsGrass::error_routine ( char *msg, int fatal) {
std::cerr << "error_routine (fatal = " << fatal << "): " << msg << std::endl;

@@ -161,12 +161,13 @@ class QgsGrass {
static QString error_message;

static int error_routine ( char *msg, int fatal); // static because pointer to this function is set later
};

// Current mapset lock file path
static QString mMapsetLock;
// Current mapset GISRC file path
static QString mGisrc;
// Temporary directory where GISRC and sockets are stored
static QString mTmp;
};

#endif // QGSGRASS_H
@@ -62,6 +62,8 @@ QgsGrassProvider::QgsGrassProvider(QString const & uri)
std::cerr << "QgsGrassProvider URI: " << uri.toLocal8Bit().data() << std::endl;
#endif

QgsGrass::init();

QTime time;
time.start();

0 comments on commit e1ee8d4

Please sign in to comment.
You can’t perform that action at this time.