Skip to content

Commit

Permalink
Returns a list of project
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jan 24, 2023
1 parent 44b8ed2 commit 5d78bbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/server/auto_generated/qgsconfigcache.sip.in
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions src/server/qgsconfigcache.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsconfigcache.h
Expand Up @@ -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
Expand Down

0 comments on commit 5d78bbe

Please sign in to comment.