Hi J. On Tue, 23. Oct 2012 at 08:00:55 +0200, J. Gaspar Mora Navarro wrote: > I can't find how avoid QGIS stores users logins and passwords from > PostGis in the QGIS project. > > If I use this code: > > uri = qgis.core.QgsDataSourceURI() > uri.setConnection(host, port, database, usuario, password)
Don't set username and password - otherwise they'll get saved. But in that case QGIS will ask interactively for a the credentials via QgsCredentials. You might be able to avoid that using [1], before adding the layers. Jürgen [1] http://www.qgis.org/api/classQgsCredentials.html#a13e8e43c36c056e7ece146e985136658 -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de committ(ed|ing) to Quantum GIS IRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
