Skip to content

Commit 7c28470

Browse files
author
rblazek
committed
list of input maps fixed
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5857 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 2aa82c0 commit 7c28470

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/plugins/grass/qgsgrassmapcalc.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,10 @@ void QgsGrassMapcalc::updateMaps()
894894
// Check if it is GRASS raster
895895
QString source = QDir::cleanDirPath ( layer->source() );
896896

897-
QChar sep = QDir::separator();
897+
// Note: QDir::cleanPath is using '/' also on Windows
898+
//QChar sep = QDir::separator();
899+
QChar sep = '/';
900+
898901
if ( source.contains( "cellhd" ) == 0 ) continue;
899902

900903
// Most probably GRASS layer, check GISBASE and LOCATION
@@ -910,8 +913,11 @@ void QgsGrassMapcalc::updateMaps()
910913
QString mapset = split.last();
911914
split.pop_back(); // mapset
912915

913-
QDir locDir ( sep + split.join ( QString(sep) ) ) ;
914-
QString loc = locDir.canonicalPath();
916+
//QDir locDir ( sep + split.join ( QString(sep) ) ) ;
917+
//QString loc = locDir.canonicalPath();
918+
919+
QString loc = source.remove ( QRegExp("/[^/]+/[^/]+/[^/]+$") );
920+
loc = QDir(loc).canonicalPath();
915921

916922
QDir curlocDir ( QgsGrass::getDefaultGisdbase() + sep + QgsGrass::getDefaultLocation() );
917923
QString curloc = curlocDir.canonicalPath();

0 commit comments

Comments
 (0)