Skip to content

Commit

Permalink
list of input maps fixed
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5857 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Sep 22, 2006
1 parent d3bdf52 commit 767fd2f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/plugins/grass/qgsgrassmapcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,10 @@ void QgsGrassMapcalc::updateMaps()
// Check if it is GRASS raster
QString source = QDir::cleanDirPath ( layer->source() );

QChar sep = QDir::separator();
// Note: QDir::cleanPath is using '/' also on Windows
//QChar sep = QDir::separator();
QChar sep = '/';

if ( source.contains( "cellhd" ) == 0 ) continue;

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

QDir locDir ( sep + split.join ( QString(sep) ) ) ;
QString loc = locDir.canonicalPath();
//QDir locDir ( sep + split.join ( QString(sep) ) ) ;
//QString loc = locDir.canonicalPath();

QString loc = source.remove ( QRegExp("/[^/]+/[^/]+/[^/]+$") );
loc = QDir(loc).canonicalPath();

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

0 comments on commit 767fd2f

Please sign in to comment.