| Summary: | Stats plugin should use XDG_STATE_HOME rather than the hardcoded .skrooge path to store files | ||
|---|---|---|---|
| Product: | [Applications] skrooge | Reporter: | contact |
| Component: | general | Assignee: | Stephane MANKOWSKI <stephane> |
| Status: | RESOLVED FIXED | ||
| Severity: | task | CC: | stephane |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | 25.1.0 | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/office/skrooge/commit/2eabe937cfefe7c0bac06288470fd679d8917fec | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
contact
2022-06-07 12:02:10 UTC
Hi,
The path is not hardcoded.
The path is computed by using qt api like this:
QString appname = KAboutData::applicationData().componentName();
QDir::home().mkdir("." % appname);
QString docUUID = QString(QCryptographicHash::hash(m_currentDocument->getCurrentFileName().toLatin1(), QCryptographicHash::Md5).toHex());
m_file = QDir::homePath() % "/." % appname % "/" % docUUID % ".stats.txt";
So, there is no issue for me.
Hi, yes, that is exactly what I mean. QDir::homePath() % "/." % appname % is equivalent to $HOME/skrooge. Rather CacheLocation should be used (see https://doc.qt.io/qt-5/qstandardpaths.html; $XDG_STATE_HOME doesn't seem to be added yet). Git commit 2eabe937cfefe7c0bac06288470fd679d8917fec by Stephane MANKOWSKI. Committed on 11/03/2023 at 21:44. Pushed by smankowski into branch 'master'. Stats plugin should use XDG_STATE_HOME rather than the hardcoded .skrooge path to store files M +1 -0 CHANGELOG M +5 -2 plugins/generic/skg_statistic/skgstatisticplugin.cpp https://invent.kde.org/office/skrooge/commit/2eabe937cfefe7c0bac06288470fd679d8917fec |