Skip to content

Commit

Permalink
Use XDG standard paths
Browse files Browse the repository at this point in the history
In case the app were to get ported to other systems,
or if Sailfish added localized directory names (like desktop distros do)
or if anything similar were to happen.

Closes monich#9
  • Loading branch information
Arusekk committed Jun 19, 2022
1 parent 4a9e592 commit 797c649
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/FoilAuthModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <QDateTime>
#include <QThreadPool>
#include <QSharedPointer>
#include <QStandardPaths>

#include <unistd.h>
#include <sys/stat.h>
Expand All @@ -72,8 +73,8 @@
#define MAX_HEADERS 8

// Directories relative to home
#define FOIL_AUTH_DIR "Documents/FoilAuth"
#define FOIL_KEY_DIR ".local/share/foil"
#define FOIL_AUTH_DIR "FoilAuth"
#define FOIL_KEY_DIR "foil"
#define FOIL_KEY_FILE "foil.key"

#define INFO_FILE ".info"
Expand Down Expand Up @@ -1029,8 +1030,8 @@ FoilAuthModel::Private::Private(FoilAuthModel* aParent) :
iQueuedSignals(0),
iFirstQueuedSignal(SignalCount),
iFoilState(FoilKeyMissing),
iFoilDataDir(QDir::homePath() + "/" FOIL_AUTH_DIR),
iFoilKeyDir(QDir::homePath() + "/" FOIL_KEY_DIR),
iFoilDataDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/" FOIL_AUTH_DIR),
iFoilKeyDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/" FOIL_KEY_DIR),
iFoilKeyFile(iFoilKeyDir + "/" + FOIL_KEY_FILE),
iPrivateKey(NULL),
iPublicKey(NULL),
Expand Down

0 comments on commit 797c649

Please sign in to comment.