Skip to content

Commit

Permalink
new vector fix for win
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4846 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Feb 14, 2006
1 parent 3cb946c commit 8d8841d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -1375,7 +1375,7 @@ bool QgsGrassProvider::startEdit ( void )
return true;
}

bool QgsGrassProvider::closeEdit ( void )
bool QgsGrassProvider::closeEdit ( bool newMap )
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassProvider::closeEdit" << std::endl;
Expand All @@ -1402,6 +1402,16 @@ bool QgsGrassProvider::closeEdit ( void )

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

// If a new map was created close the map and return
if ( newMap )
{
std::cerr << "mLayers.size() = " << mLayers.size() << std::endl;
map->update = false;
closeLayer( mLayerId );
return true;
}

Vect_close ( map->map );

QFileInfo di ( mGisdbase + "/" + mLocation + "/" + mMapset + "/vector/" + mMapName );
Expand All @@ -1413,6 +1423,7 @@ bool QgsGrassProvider::closeEdit ( void )
// Reopen vector
QgsGrass::resetError(); // to "catch" error after Vect_open_old()
Vect_set_open_level (2);

Vect_open_old ( map->map, (char *) map->mapName.ascii(), (char *) map->mapset.ascii());

if ( QgsGrass::getError() == QgsGrass::FATAL ) {
Expand Down
4 changes: 3 additions & 1 deletion src/providers/grass/qgsgrassprovider.h
Expand Up @@ -226,10 +226,12 @@ class QgsGrassProvider : public QgsVectorDataProvider
bool startEdit();

/** Close editing. Rebuild topology, GMAP.update = false
* @param newMap set to true if a new map was created
* and it is not yet used as layer
* @return true success
* @return false failed to close vector or vector was not in update mode
*/
bool closeEdit();
bool closeEdit( bool newMap=false );

/** Get current number of lines.
* @return number of lines
Expand Down

0 comments on commit 8d8841d

Please sign in to comment.