Tweaked display name to capitalize the first letter and strip schema/geometry column from name of PG layers

git-svn-id: http://svn.osgeo.org/qgis/trunk@612 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2004-01-28 02:03:52 +00:00
parent 3a5a61c09d
commit 8ca1965c7f

View File

@ -113,6 +113,16 @@ const char *cOgrLib = (const char *)ogrlib;
// look at the fields in the layer and set the primary
// display field using some real fuzzy logic
setDisplayField();
QString layerTitle = baseName;
if(providerKey == "postgres"){
// adjust the display name for postgres layers
layerTitle = layerTitle.mid(layerTitle.find(".") +1);
layerTitle = layerTitle.left(layerTitle.find("("));
}
// upper case the first letter of the layer name
layerTitle = layerTitle.left(1).upper() + layerTitle.mid(1);
setLayerName(layerTitle);
}
} else {
std::cout << "Unable to instantiate the data provider plugin\n";