mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
Returns a list of project
This commit is contained in:
parent
44b8ed25ab
commit
5d78bbe998
@ -68,7 +68,7 @@ Returns the name of the current strategy
|
||||
.. versionadded:: 3.26
|
||||
%End
|
||||
|
||||
QMap<QString, QDateTime> projects() const;
|
||||
QList<QgsProject *> projects() const;
|
||||
%Docstring
|
||||
Returns projects currently in cache.
|
||||
|
||||
|
||||
@ -182,14 +182,14 @@ const QgsProject *QgsConfigCache::project( const QString &path, const QgsServerS
|
||||
return entry ? entry->second.get() : nullptr;
|
||||
}
|
||||
|
||||
QMap<QString, QDateTime> QgsConfigCache::projects() const
|
||||
QList<QgsProject *> QgsConfigCache::projects() const
|
||||
{
|
||||
QMap<QString, QDateTime> projects;
|
||||
QList<QgsProject *> projects;
|
||||
|
||||
const auto constKeys { mProjectCache.keys() };
|
||||
for ( const auto &path : std::as_const( constKeys ) )
|
||||
{
|
||||
projects[path] = mProjectCache[path]->first;
|
||||
projects << mProjectCache[path]->second.get();
|
||||
}
|
||||
|
||||
return projects;
|
||||
|
||||
@ -121,7 +121,7 @@ class SERVER_EXPORT QgsConfigCache : public QObject
|
||||
* Returns projects currently in cache.
|
||||
* \since QGIS 3.30
|
||||
*/
|
||||
QMap<QString, QDateTime> projects() const;
|
||||
QList<QgsProject *> projects() const;
|
||||
|
||||
public:
|
||||
//! Initialize from settings
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user