mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-22 10:44:32 +00:00
portable mode: reset wallet dir on start
This commit is contained in:
parent
7f07f98f92
commit
15aea81ea4
3 changed files with 9 additions and 4 deletions
|
@ -1601,9 +1601,14 @@ void MainWindow::donationNag() {
|
||||||
config()->set(Config::donateBeg, donationCounter);
|
config()->set(Config::donateBeg, donationCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addToRecentlyOpened(const QString &keysFile) {
|
void MainWindow::addToRecentlyOpened(QString keysFile) {
|
||||||
auto recent = config()->get(Config::recentlyOpenedWallets).toList();
|
auto recent = config()->get(Config::recentlyOpenedWallets).toList();
|
||||||
|
|
||||||
|
if (Utils::isPortableMode()) {
|
||||||
|
QDir appPath{Utils::applicationPath()};
|
||||||
|
keysFile = appPath.relativeFilePath(keysFile);
|
||||||
|
}
|
||||||
|
|
||||||
if (recent.contains(keysFile)) {
|
if (recent.contains(keysFile)) {
|
||||||
recent.removeOne(keysFile);
|
recent.removeOne(keysFile);
|
||||||
}
|
}
|
||||||
|
@ -1631,7 +1636,7 @@ void MainWindow::updateRecentlyOpenedMenu() {
|
||||||
const QStringList recentWallets = config()->get(Config::recentlyOpenedWallets).toStringList();
|
const QStringList recentWallets = config()->get(Config::recentlyOpenedWallets).toStringList();
|
||||||
for (const auto &walletPath : recentWallets) {
|
for (const auto &walletPath : recentWallets) {
|
||||||
QFileInfo fileInfo{walletPath};
|
QFileInfo fileInfo{walletPath};
|
||||||
ui->menuRecently_open->addAction(fileInfo.fileName(), m_windowManager, std::bind(&WindowManager::tryOpenWallet, m_windowManager, walletPath, ""));
|
ui->menuRecently_open->addAction(fileInfo.fileName(), m_windowManager, std::bind(&WindowManager::tryOpenWallet, m_windowManager, fileInfo.absoluteFilePath(), ""));
|
||||||
}
|
}
|
||||||
ui->menuRecently_open->addSeparator();
|
ui->menuRecently_open->addSeparator();
|
||||||
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
||||||
|
|
|
@ -214,7 +214,7 @@ private:
|
||||||
QString getHardwareDevice();
|
QString getHardwareDevice();
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
void donationNag();
|
void donationNag();
|
||||||
void addToRecentlyOpened(const QString &filename);
|
void addToRecentlyOpened(QString filename);
|
||||||
void updateRecentlyOpenedMenu();
|
void updateRecentlyOpenedMenu();
|
||||||
void updateWidgetIcons();
|
void updateWidgetIcons();
|
||||||
bool verifyPassword(bool sensitive = true);
|
bool verifyPassword(bool sensitive = true);
|
||||||
|
|
|
@ -179,7 +179,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||||
|
|
||||||
// Setup wallet directory
|
// Setup wallet directory
|
||||||
QString walletDir = config()->get(Config::walletDirectory).toString();
|
QString walletDir = config()->get(Config::walletDirectory).toString();
|
||||||
if (walletDir.isEmpty()) {
|
if (walletDir.isEmpty() || Utils::isPortableMode()) {
|
||||||
walletDir = Utils::defaultWalletDir();
|
walletDir = Utils::defaultWalletDir();
|
||||||
config()->set(Config::walletDirectory, walletDir);
|
config()->set(Config::walletDirectory, walletDir);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue