One last tweak to which connection is displayed.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4114 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2005-10-20 20:25:30 +00:00
parent d96896cf00
commit e651ad901b

View File

@ -471,5 +471,14 @@ void QgsDbSourceSelect::setConnectionListPosition()
// items as it allows the user to repeatidly click on delete to
// remove a whole lot of items).
if (!set && cmbConnections->count() > 0)
cmbConnections->setCurrentItem(cmbConnections->count()-1);
{
// If toSelect is null, then the selected connection wasn't found
// by QSettings, which probably means that this is the first time
// the user has used qgis with database connections, so default to
// the first in the list of connetions. Otherwise default to the last.
if (toSelect.isNull())
cmbConnections->setCurrentItem(0);
else
cmbConnections->setCurrentItem(cmbConnections->count()-1);
}
}