aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/studiowelcome
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2024-04-15 15:05:53 +0200
committerEike Ziller <eike.ziller@qt.io>2024-04-18 06:07:23 +0000
commit77d7106b3a889079cc8338d8d6474830799e8f3d (patch)
treea1a09580b6310db411f702517f660821a23c2f0d /src/plugins/studiowelcome
parent28b14de384d6d22e44b692f9623d96f4e7ad8064 (diff)
Update recent projects asynchronously
Avoid blocking Qt Creator whenever it gets active or projects change, if some kind of network mapped path is in the list of recent projects. We check for existence of recent projects, and that can take a long time in that case, especially if the target is not connected. We already avoid checking on explicit IDevices, but that doesn't help for other kinds of mounted directories. Maintain an "exists" state for each item and update that asynchronously, informing all interested parties of changes with the recentProjectsChanged signal. The state is saved in the settings, meaning that projects that were not found previously start out hidden, under the assumption that the existence check is fast for them if they become available again. Fixes: QTCREATORBUG-30681 Change-Id: Ic39a88b6b5128c3ae4582a6c66fc16be4b297e56 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/studiowelcome')
-rw-r--r--src/plugins/studiowelcome/studiowelcomeplugin.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
index ac6a17de874..9e93384cfae 100644
--- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp
+++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
@@ -455,20 +455,20 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const
ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(index.row());
switch (role) {
case Qt::DisplayRole:
- return data.second;
+ return data.displayName;
break;
case FilePathRole:
- return data.first.toVariant();
+ return data.filePath.toVariant();
case PrettyFilePathRole:
- return data.first.absolutePath().withTildeHomePath();
+ return data.filePath.absolutePath().withTildeHomePath();
case PreviewUrl:
- return QVariant(QStringLiteral("image://project_preview/") +
- QmlProjectManager::ProjectFileContentTools::appQmlFile(
- data.first));
+ return QVariant(
+ QStringLiteral("image://project_preview/")
+ + QmlProjectManager::ProjectFileContentTools::appQmlFile(data.filePath));
case TagData:
- return tags(data.first);
+ return tags(data.filePath);
case Description:
- return description(data.first);
+ return description(data.filePath);
default:
return QVariant();
}