@@ -46,6 +46,7 @@ void RecentProjectListModel::reloadModel()
4646 mRecentProjects .clear ();
4747
4848 QSettings settings;
49+
4950 mRecentProjects = recentProjects ( true );
5051
5152 const bool sampleProjectsAdded = settings.value ( QStringLiteral ( " QField/recentProjectsAdded" ), false ).toBool ();
@@ -146,11 +147,14 @@ void RecentProjectListModel::removeRecentProject( const QString &path )
146147 }
147148}
148149
149- QList<RecentProjectListModel::RecentProject> RecentProjectListModel::recentProjects ( bool skipNonExistent )
150+ QList<RecentProjectListModel::RecentProject> RecentProjectListModel::recentProjects ( bool skipNonAvailable )
150151{
151- QSettings settings;
152152 QList<RecentProject> projects;
153153
154+ QSettings settings;
155+ const QString qfieldCloudUsername = QSettings ().value ( QStringLiteral ( " /QFieldCloud/username" ) ).toString ();
156+ const QString qdieldCloudLocalDirectory = QFieldCloudUtils::localCloudDirectory ();
157+
154158 settings.beginGroup ( " /qgis/recentProjects" );
155159
156160 const QStringList projectKeysList = settings.childGroups ();
@@ -167,9 +171,15 @@ QList<RecentProjectListModel::RecentProject> RecentProjectListModel::recentProje
167171 const QString path = settings.value ( QStringLiteral ( " path" ) ).toString ();
168172 const QFileInfo fi ( path );
169173
174+ bool skip = false ;
170175 ProjectType type = LocalDataset;
171- if ( path.startsWith ( QFieldCloudUtils::localCloudDirectory () ) )
176+ if ( path.startsWith ( qdieldCloudLocalDirectory ) )
172177 {
178+ if ( skipNonAvailable && ( !fi.exists () || !path.startsWith ( QStringLiteral ( " %1%2%3%2" ).arg ( qdieldCloudLocalDirectory, QDir::separator (), qfieldCloudUsername ) ) ) )
179+ {
180+ skip = true ;
181+ }
182+
173183 type = CloudProject;
174184 }
175185 else if ( path.startsWith ( " http://" , Qt::CaseInsensitive ) || path.startsWith ( " https://" , Qt::CaseInsensitive ) )
@@ -178,14 +188,24 @@ QList<RecentProjectListModel::RecentProject> RecentProjectListModel::recentProje
178188 }
179189 else if ( SUPPORTED_PROJECT_EXTENSIONS.contains ( fi.suffix () ) )
180190 {
191+ if ( skipNonAvailable && !fi.exists () )
192+ {
193+ skip = true ;
194+ }
195+
181196 type = LocalProject;
182197 }
183198 else
184199 {
200+ if ( skipNonAvailable && !fi.exists () )
201+ {
202+ skip = true ;
203+ }
204+
185205 type = LocalDataset;
186206 }
187207
188- if ( !skipNonExistent || type == LinkProject || fi. exists () )
208+ if ( !skip )
189209 {
190210 projects.append ( RecentProject ( type,
191211 settings.value ( QStringLiteral ( " title" ) ).toString (),
0 commit comments