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 19
19
#include " qgsgrassselect.h"
20
20
#include " qgsgrasstools.h"
21
21
#include " qgsgrassprovider.h"
22
+ #include " qgsgrassutils.h"
22
23
#include " qgsgrass.h"
23
24
24
25
#include " qgisinterface.h"
@@ -1498,8 +1499,14 @@ void QgsGrassModule::viewOutput()
1498
1499
if ( onlyLayer1 && layers[j].left ( 1 ) != " 1" )
1499
1500
continue ;
1500
1501
1502
+ QStringList split = uri.split ( ' /' , QString::SkipEmptyParts );
1503
+ QString layer = split.last ();
1504
+
1505
+ QString name = QgsGrassUtils::vectorLayerName (
1506
+ map, layer, 1 );
1507
+
1501
1508
// TODO vector layer name
1502
- mIface ->addVectorLayer ( uri, layers[j] , " grass" );
1509
+ mIface ->addVectorLayer ( uri, name , " grass" );
1503
1510
}
1504
1511
}
1505
1512
@@ -3100,7 +3107,7 @@ void QgsGrassModuleFile::browse()
3100
3107
3101
3108
if ( fd->exec () == QDialog::Accepted )
3102
3109
{
3103
- QString selectedFile = fd->selectedFiles ().first ();
3110
+ QString selectedFile = fd->selectedFiles ().last ();
3104
3111
QFileInfo fi = QFileInfo (selectedFile);
3105
3112
currentDir = fi.absoluteDir ();
3106
3113
if (mType == Multiple)
You can’t perform that action at this time.
0 commit comments