File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1919#include " qgsgrassselect.h"
2020#include " qgsgrasstools.h"
2121#include " qgsgrassprovider.h"
22+ #include " qgsgrassutils.h"
2223#include " qgsgrass.h"
2324
2425#include " qgisinterface.h"
@@ -1498,8 +1499,14 @@ void QgsGrassModule::viewOutput()
14981499 if ( onlyLayer1 && layers[j].left ( 1 ) != " 1" )
14991500 continue ;
15001501
1502+ QStringList split = uri.split ( ' /' , QString::SkipEmptyParts );
1503+ QString layer = split.last ();
1504+
1505+ QString name = QgsGrassUtils::vectorLayerName (
1506+ map, layer, 1 );
1507+
15011508 // TODO vector layer name
1502- mIface ->addVectorLayer ( uri, layers[j] , " grass" );
1509+ mIface ->addVectorLayer ( uri, name , " grass" );
15031510 }
15041511 }
15051512
@@ -3100,7 +3107,7 @@ void QgsGrassModuleFile::browse()
31003107
31013108 if ( fd->exec () == QDialog::Accepted )
31023109 {
3103- QString selectedFile = fd->selectedFiles ().first ();
3110+ QString selectedFile = fd->selectedFiles ().last ();
31043111 QFileInfo fi = QFileInfo (selectedFile);
31053112 currentDir = fi.absoluteDir ();
31063113 if (mType == Multiple)
You can’t perform that action at this time.
0 commit comments