~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to providers/grass/qgsgrass.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2005-11-05 16:04:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051105160445-l0g4isz5bc9yehet
Tags: 0.7.4-1
* New upstream release
* Build GRASS support in qgis-plugin-grass package (Closes: #248649)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        // Set error function
41
41
        G_set_error_routine ( &error_routine );
42
42
 
 
43
        // Set program name
 
44
        G_set_program_name ("QGIS");
 
45
 
43
46
        initialized = 1;
44
47
    }
45
48
}
83
86
    for ( int i = 0; ms[i]; i++ )  G_add_mapset_to_search_path ( ms[i] );
84
87
}
85
88
 
 
89
void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
 
90
{
 
91
    #ifdef QGISDEBUG
 
92
    std::cerr << "QgsGrass::setLocation(): gisdbase = " << gisdbase << " location = "
 
93
              << location << " mapset = " << mapset << std::endl;
 
94
    #endif
 
95
    init();
 
96
 
 
97
    // Set principal GRASS variables (in memory)
 
98
    G__setenv( "GISDBASE", (char *) gisdbase.ascii() );        
 
99
    G__setenv( "LOCATION_NAME", (char *) location.ascii() );
 
100
    G__setenv( "MAPSET", (char *) mapset.ascii() ); 
 
101
 
 
102
    // Add all available mapsets to search path
 
103
    char **ms = G_available_mapsets();
 
104
    for ( int i = 0; ms[i]; i++ )  G_add_mapset_to_search_path ( ms[i] );
 
105
}
 
106
 
86
107
int QgsGrass::initialized = 0;
87
108
 
88
109
bool QgsGrass::active = 0;