Hi Bo, Is that with or without `cached` ?
QMap<QString, QgsAbstractProviderConnection *> connections( bool cached = true ) On Mon, Oct 25, 2021 at 11:46 AM Bo Victor Thomsen < [email protected]> wrote: > Hi list members - > > I stumbled on something weird (for me at least): > > If I run the following code in the Python console: > > metadata = QgsProviderRegistry.instance().providerMetadata('postgres') > conn = metadata.connections() > for c in conn.keys(): print(c) > > It shows me (as I would expect): A list of names of postgres connections > in QGIS. > > However, if I 1) Make a *new* postgres connection and 2) Rerun the same > lines in the console, the new connection is *not* shown in the list. > > But if I restart QGIS and run the same code, the new connection will be > shown together with the older connections. > > What gives ? Is there some kind of "refresh" method I've overlooked?? > > Version: QGIS 3.20.3 on Windows 10. > > > -- > Med venlig hilsen / Kind regards > > Bo Victor Thomsen > > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > -- Alessandro Pasotti QCooperative: www.qcooperative.net ItOpen: www.itopen.it
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
