diff options
author | James Beddek <telans@posteo.de> | 2023-06-20 16:52:57 +1200 |
---|---|---|
committer | James Beddek <telans@posteo.de> | 2023-06-20 16:52:57 +1200 |
commit | d9b24f770561e3bb139955854ac7f3ca4d92a122 (patch) | |
tree | e983234630a8fe584343b0ea1e5af73cf5b53606 /launcher/ui | |
parent | af6bf11793fb463fe62c99695e56ff6599612d05 (diff) | |
download | PrismLauncher-d9b24f770561e3bb139955854ac7f3ca4d92a122.tar.gz PrismLauncher-d9b24f770561e3bb139955854ac7f3ca4d92a122.tar.bz2 PrismLauncher-d9b24f770561e3bb139955854ac7f3ca4d92a122.zip |
Screenshots: remove path from watcher if it no longer exists
Signed-off-by: James Beddek <telans@posteo.de>
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/instance/ScreenshotsPage.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/launcher/ui/pages/instance/ScreenshotsPage.cpp b/launcher/ui/pages/instance/ScreenshotsPage.cpp index ca368d3b..8f134efd 100644 --- a/launcher/ui/pages/instance/ScreenshotsPage.cpp +++ b/launcher/ui/pages/instance/ScreenshotsPage.cpp @@ -145,7 +145,6 @@ public: m_thumbnailCache = std::make_shared<SharedIconCache>(); m_thumbnailCache->add("placeholder", APPLICATION->getThemedIcon("screenshot-placeholder")); connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString))); - // FIXME: the watched file set is not updated when files are removed } virtual ~FilterModel() { m_thumbnailingPool.waitForDone(500); } virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const @@ -214,10 +213,12 @@ private slots: void fileChanged(QString filepath) { m_thumbnailCache->setStale(filepath); - thumbnailImage(filepath); // reinsert the path... watcher.removePath(filepath); - watcher.addPath(filepath); + if (QFile::exists(filepath)) { + watcher.addPath(filepath); + thumbnailImage(filepath); + } } private: |