Tails: use feather_data instead of .feather

This commit is contained in:
tobtoht 2022-03-05 16:54:40 +01:00
parent 69a13449fa
commit f22d1ff2ac
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
2 changed files with 22 additions and 4 deletions

View file

@ -110,14 +110,25 @@ QString defaultWalletDir() {
if (TailsOS::detect()) {
QString path = []{
// Starting in 1.1.0 the wallet and config directory were moved from ./.feather to ./feather_data
// A user might accidentally delete the folder containing the file hidden folder after moving the AppImage
// We return the old path if it still exists
QString appImagePath = qgetenv("APPIMAGE");
if (appImagePath.isEmpty()) {
qDebug() << "Not an appimage, using currentPath()";
return QDir::currentPath() + "/.feather/Monero/wallets";
if (QDir(QDir::currentPath() + "/.feather").exists()) {
return QDir::currentPath() + "/.feather/Monero/wallets";
}
return QDir::currentPath() + "/feather_data/wallets";
}
QFileInfo appImageDir(appImagePath);
return appImageDir.absoluteDir().path() + "/.feather/Monero/wallets";
QString absolutePath = appImageDir.absoluteDir().path();
if (QDir(absolutePath + "/.feather").exists()) {
return absolutePath + "/.feather/Monero/wallets";
}
return absolutePath + "/feather_data/wallets";
}();
return path;

View file

@ -176,11 +176,18 @@ QDir Config::defaultConfigDir() {
QString appImagePath = qgetenv("APPIMAGE");
if (appImagePath.isEmpty()) {
qDebug() << "Not an appimage, using currentPath()";
return QDir::currentPath() + "/.feather/.config/feather";
if (QDir(QDir::currentPath() + "/.feather").exists()) {
return QDir::currentPath() + "/.feather/.config/feather";
}
return QDir::currentPath() + "/feather_data";
}
QFileInfo appImageDir(appImagePath);
return appImageDir.absoluteDir().path() + "/.feather/.config/feather";
QString absolutePath = appImageDir.absoluteDir().path();
if (QDir(absolutePath + "/.feather").exists()) {
return absolutePath + "/.feather/.config/feather";
}
return absolutePath + "/feather_data";
}();
return QDir(path);