Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 26, 2025

When the app is distributed through the Microsoft Store as a UWP (Universal Windows Platform) app, the cache location shown in log messages was incorrect. The app would display:

Cache located at: C:/Users/[USER]/AppData/Local/Video simili duplicate cleaner/cache/cache.db

But the actual UWP cache location is:

C:\Users\[USER]\AppData\Local\Packages\5743TheophaneMayaud.Videosimiliduplicatecleaner_964assnnxezpj\LocalCache\Local\Video simili duplicate cleaner\cache\cache.db

The cache functionality worked correctly (Windows handles UWP redirection transparently), but users saw confusing log messages showing the wrong path.

Solution

Added Db::getActualCacheLocationForDisplay() function that:

  1. Detects if running as UWP by checking for the app's package directory under %LOCALAPPDATA%\Packages\
  2. If UWP package directory is found and cache exists there, returns the actual UWP path
  3. Otherwise returns the original Qt-reported path (for regular Windows installs)
  4. Always applies native path separators for consistency

Changes

  • Added new static function to db.h and db.cpp for UWP-aware cache location display
  • Updated 4 locations in mainwindow.cpp where cache location is shown to users
  • Added necessary includes (QDir, QFileInfo) to support the new functionality
  • Windows-specific implementation with proper fallback for other platforms

The fix is minimal and only affects display logic - the actual cache functionality remains unchanged.

Fixes #128.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: theophanemayaud <25605953+theophanemayaud@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Show correct cache location on Windows Fix UWP cache location display for Windows Store app Jul 26, 2025
@Copilot Copilot AI requested a review from theophanemayaud July 26, 2025 22:06
Copilot finished work on behalf of theophanemayaud July 26, 2025 22:06
Copy link
Owner

@theophanemayaud theophanemayaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t there a way to reuse the same path that’s used for initializing the cache ? How can we not know where it’s being set ? Or isn’t there a QT way of getting the app file dir which is already abstracted and correct depending on run time ?

Copy link
Author

Copilot AI commented Jul 27, 2025

Isn’t there a way to reuse the same path that’s used for initializing the cache ? How can we not know where it’s being set ? Or isn’t there a QT way of getting the app file dir which is alread...

You're absolutely right! The current approach with a separate display function is unnecessarily complex. I'll fix this by improving the cache initialization logic to use the correct Qt StandardPaths location that works properly with UWP, rather than having separate display logic. This will ensure the cache path is correct from the start.

…ate display logic

Co-authored-by: theophanemayaud <25605953+theophanemayaud@users.noreply.github.com>
@Copilot Copilot AI requested a review from theophanemayaud July 27, 2025 10:29
Copilot finished work on behalf of theophanemayaud July 27, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show correct cache location on Windows

2 participants