Skip to content

Commit d4dcde0

Browse files
committedMay 24, 2012
restricted location/mapset names in GRASS new mapset dialog, fixes #4258
1 parent 429403d commit d4dcde0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/plugins/grass/qgsgrassnewmapset.cpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
#include <QCloseEvent>
3030
#include <QFileDialog>
3131
#include <QMessageBox>
32+
#include <QRegExp>
3233
#include <QSettings>
3334
#include <QTextStream>
3435

36+
3537
extern "C"
3638
{
3739
#include <grass/gprojects.h>
@@ -134,10 +136,16 @@ QgsGrassNewMapset::QgsGrassNewMapset( QgisInterface *iface,
134136
m = new QTreeWidgetItem( l, QStringList() << "Cimrman" << tr( "User's mapset" ) );
135137
m->setExpanded( true );
136138

139+
// LOCATION
140+
QRegExp rx;
141+
rx.setPattern( "[A-Za-z0-9_.]+" );
142+
mLocationLineEdit->setValidator( new QRegExpValidator( rx, mLocationLineEdit ) );
143+
137144
// CRS
138145

139146
// MAPSET
140147
mMapsetsListView->clear();
148+
mMapsetLineEdit->setValidator( new QRegExpValidator( rx, mMapsetLineEdit ) );
141149

142150
// FINISH
143151

0 commit comments

Comments
 (0)
Please sign in to comment.