File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -610,3 +610,34 @@ QStringList QgsGrass::rasters ( QString mapsetPath )
610
610
}
611
611
return list;
612
612
}
613
+
614
+ QStringList QgsGrass::elements ( QString gisbase, QString locationName,
615
+ QString mapsetName, QString element)
616
+ {
617
+ if ( gisbase.isEmpty () || locationName.isEmpty () || mapsetName.isEmpty () )
618
+ return QStringList ();
619
+
620
+ return QgsGrass::elements ( gisbase + " /" + locationName + " /" + mapsetName,
621
+ element );
622
+ }
623
+
624
+ QStringList QgsGrass::elements ( QString mapsetPath, QString element )
625
+ {
626
+ #ifdef QGISDEBUG
627
+ std::cerr << " QgsGrass::elements mapsetPath = "
628
+ << mapsetPath.ascii () << std::endl;
629
+ #endif
630
+
631
+ QStringList list;
632
+
633
+ if ( mapsetPath.isEmpty () ) return list;
634
+
635
+ QDir d = QDir ( mapsetPath + " /" + element );
636
+ d.setFilter (QDir::Files);
637
+
638
+ for ( int i = 0 ; i < d.count (); i++ )
639
+ {
640
+ list.append (d[i]);
641
+ }
642
+ return list;
643
+ }
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ class QgsGrass {
105
105
QString mapsetName);
106
106
static QStringList rasters (QString mapsetPath);
107
107
108
+ // ! List of elements
109
+ static QStringList elements (QString gisbase, QString locationName,
110
+ QString mapsetName, QString element);
111
+ static QStringList elements (QString mapsetPath, QString element);
112
+
108
113
109
114
static void init (void );
110
115
You can’t perform that action at this time.
0 commit comments