[GRASS-SVN] r42988 - grass/branches/develbranch_6/vector/v.edit
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 4 03:33:30 EDT 2010
Author: hamish
Date: 2010-08-04 07:33:30 +0000 (Wed, 04 Aug 2010)
New Revision: 42988
Modified:
grass/branches/develbranch_6/vector/v.edit/Makefile
grass/branches/develbranch_6/vector/v.edit/main.c
Log:
set up default DB if it doesn't exist
Modified: grass/branches/develbranch_6/vector/v.edit/Makefile
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/Makefile 2010-08-04 06:13:01 UTC (rev 42987)
+++ grass/branches/develbranch_6/vector/v.edit/Makefile 2010-08-04 07:33:30 UTC (rev 42988)
@@ -2,8 +2,8 @@
PGM = v.edit
-LIBES = $(VEDITLIB) $(VECTLIB) $(GISLIB)
-DEPENDENCIES= $(VEDITDEP) $(VECTDEP) $(GISDEP)
+LIBES = $(VEDITLIB) $(VECTLIB) $(DBMILIB) $(GISLIB)
+DEPENDENCIES= $(VEDITDEP) $(VECTDEP) $(DBMIDEP) $(GISDEP)
EXTRA_INC = $(VECT_INC)
EXTRA_CFLAGS = $(VECT_CFLAGS)
Modified: grass/branches/develbranch_6/vector/v.edit/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/main.c 2010-08-04 06:13:01 UTC (rev 42987)
+++ grass/branches/develbranch_6/vector/v.edit/main.c 2010-08-04 07:33:30 UTC (rev 42988)
@@ -1,4 +1,3 @@
-
/****************************************************************
*
* MODULE: v.edit
@@ -18,6 +17,7 @@
* TODO: 3D support
****************************************************************/
+#include <grass/dbmi.h>
#include "global.h"
int main(int argc, char *argv[])
@@ -94,6 +94,10 @@
params.map->answer);
}
+ if (! db_get_default_driver_name() ) {
+ G_message(_("Creating new DB connection based on default mapset settings..."));
+ db_set_default_connection();
+ }
/* 3D vector maps? */
ret = Vect_open_new(&Map, params.map->answer, WITHOUT_Z);
if (ret == -1) {
More information about the grass-commit
mailing list