port DataPaths to QStandardPaths backing
ClosedPublic

Authored by sitter on Sep 11 2017, 1:30 PM.

Details

Summary

This streamlines the code across all platforms and outsources the path
building to QSP which implements the multi-platform logic.

This keeps AppData lookup paths where they were (with additional lookup
paths from QSP).
Config location changes on Windows (from local to roaming) and OS X
(from Application Support to Preferences).
Cache also changes location on Windows and OS X.

Temporary directory management is entirely outsourced to QTemporaryDir
which is kept in a scoped pointer so it gets cleaned up on exit.

Diff Detail

Repository
R875 Falkon
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
sitter created this revision.Sep 11 2017, 1:30 PM

https://gist.github.com/apachelogger/1776b25bb9fa12d2b1e35fb110d371ce has an overview of the path changes this produces

Would be grand if this could get some testing on OS X and Windows though.

drosca requested changes to this revision.Sep 13 2017, 3:07 PM

Overall the paths looks fine, but AppData should really contain only one path (and the correct one). What I mean is that it should only be inside bundle on OS X, in $APPDIR on Win and XDG path on Linux. As it is now, it pulls quite a lot of unused paths on Windows and also that one we really need ($APPDIR) is only third, which may cause problems.

src/lib/app/datapaths.cpp
93–94

Please don't use auto here, also it detaches QList.

97–98

This is appending single path, so that for on next line is not needed.

This revision now requires changes to proceed.Sep 13 2017, 3:07 PM
sitter updated this revision to Diff 19633.Sep 18 2017, 10:21 AM

prevent list detaching, undo previously accepted auto, expand for loop manually and use .at(0)

drosca accepted this revision.Sep 18 2017, 10:35 AM
This revision is now accepted and ready to land.Sep 18 2017, 10:35 AM
sitter closed this revision.Sep 18 2017, 10:57 AM