File tree 1 file changed +6
-25
lines changed
1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -360,18 +360,10 @@ void QgsGrassNewMapset::checkLocation()
360
360
}
361
361
else
362
362
{
363
- QDir d ( mDatabaseLineEdit ->text () );
364
-
365
- for ( unsigned int i = 0 ; i < d.count (); i++ )
363
+ if ( QFile::exists ( mDatabaseLineEdit ->text () + " /" + location ) )
366
364
{
367
- if ( d[i] == " ." || d[i] == " .." ) continue ;
368
-
369
- if ( d[i] == location )
370
- {
371
- setNextEnabled ( page ( LOCATION ), false );
372
- setError ( mLocationErrorLabel , tr ( " The location exists!" ) );
373
- break ;
374
- }
365
+ setNextEnabled ( page ( LOCATION ), false );
366
+ setError ( mLocationErrorLabel , tr ( " The location exists!" ) );
375
367
}
376
368
}
377
369
}
@@ -1229,23 +1221,12 @@ void QgsGrassNewMapset::mapsetChanged()
1229
1221
// Check if exists
1230
1222
if ( mSelectLocationRadioButton ->isChecked () )
1231
1223
{
1232
- bool exists = false ;
1233
1224
QString locationPath = mDatabaseLineEdit ->text () + " /" + mLocationComboBox ->currentText ();
1234
- QDir d ( locationPath );
1235
-
1236
- for ( unsigned int i = 0 ; i < d.count (); i++ )
1225
+ if ( QFile::exists ( locationPath + " /" + mapset ) )
1237
1226
{
1238
- if ( d[i] == " ." || d[i] == " .." ) continue ;
1239
-
1240
- if ( d[i] == mapset )
1241
- {
1242
- setError ( mMapsetErrorLabel , tr ( " The mapset already exists" ) );
1243
- exists = true ;
1244
- break ;
1245
- }
1227
+ setError ( mMapsetErrorLabel , tr ( " The mapset already exists" ) );
1246
1228
}
1247
-
1248
- if ( !exists )
1229
+ else
1249
1230
{
1250
1231
setNextEnabled ( page ( MAPSET ), true );
1251
1232
}
You can’t perform that action at this time.
0 commit comments