Skip to content

Commit

Permalink
[ui] app: Don't read QSettings again when updating thumbnails for pro…
Browse files Browse the repository at this point in the history
…jects

There is no need to read the QSettings again as the content of
`self._recentProjectFiles` reflects their content accurately and they
do not store any thumbnail-related information.

QSettings will now only be read once, upon Meshroom's start.
  • Loading branch information
cbentejac committed Jan 22, 2025
1 parent 041c643 commit de7777f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion meshroom/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,14 @@ def updateRecentProjectFilesThumbnails(self) -> None:
available.
"""
if not self._updatedRecentProjectFilesThumbnails:
self._recentProjectFiles = self._getRecentProjectFiles()
self._updateRecentProjectFilesThumbnails()
self._updatedRecentProjectFilesThumbnails = True

def _updateRecentProjectFilesThumbnails(self) -> None:
for project in self._recentProjectFiles:
path = project["path"]
project["thumbnail"] = self._retrieveThumbnailPath(path)

@Slot(str)
@Slot(QUrl)
def addRecentProjectFile(self, projectFile) -> None:
Expand Down

0 comments on commit de7777f

Please sign in to comment.