Skip to content
Permalink
Browse files

better vector names when added from browser

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4983 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 8, 2006
1 parent 71acd2d commit e436070da9351aacb43d358af71b58533308f49f
Showing with 16 additions and 4 deletions.
  1. +16 −4 src/plugins/grass/qgsgrassbrowser.cpp
@@ -49,6 +49,7 @@ extern "C" {
#include "../../src/providers/grass/qgsgrass.h"
#include "qgsgrassmodel.h"
#include "qgsgrassbrowser.h"
#include "qgsgrassselect.h"

QgsGrassBrowser::QgsGrassBrowser ( QgisIface *iface,
QWidget * parent, Qt::WFlags f )
@@ -148,13 +149,24 @@ void QgsGrassBrowser::addMap()
}
else if ( type == QgsGrassModel::VectorLayer )
{
QString map = mModel->itemMap(*it);
QString name = map;

QStringList list = QgsGrassSelect::vectorLayers(
QgsGrass::getDefaultGisdbase(),
QgsGrass::getDefaultLocation(),
mModel->itemMapset(*it), map );

// TODO: common method for vector names
QStringList split = QStringList::split ( '/', uri );
QString layer = split.last();
split.pop_back(); // map
QString vector = split.last();
mIface->addVectorLayer( uri, layer, "grass");
std::cerr << "add vector: " << uri.ascii() << std::endl;

if ( list.size() > 1 )
{
name += " " + layer;
}

mIface->addVectorLayer( uri, name, "grass");
mapSelected = true;
}
}

0 comments on commit e436070

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