From a99eef68f5e621f78df3b8f54e0b44a6178437f5 Mon Sep 17 00:00:00 2001 From: xiphon Date: Fri, 24 Apr 2020 00:43:40 +0000 Subject: [PATCH] always use native directory separators in paths --- js/Wizard.js | 5 ----- main.qml | 9 ++------- pages/settings/SettingsInfo.qml | 10 +++------- src/libwalletqt/Wallet.cpp | 2 +- src/main/main.cpp | 3 ++- src/qt/KeysFiles.cpp | 22 +++++++++++++++------- src/qt/KeysFiles.h | 7 +++++-- wizard/WizardController.qml | 2 +- wizard/WizardOpenWallet1.qml | 15 +++++---------- wizard/WizardWalletInput.qml | 2 +- 10 files changed, 35 insertions(+), 42 deletions(-) diff --git a/js/Wizard.js b/js/Wizard.js index a41864d4..a3d892cb 100644 --- a/js/Wizard.js +++ b/js/Wizard.js @@ -58,11 +58,6 @@ function switchPage(next) { } function createWalletPath(isIOS, folder_path,account_name){ - // Remove trailing slash - (default on windows and mac) - if (folder_path.substring(folder_path.length -1) === "/"){ - folder_path = folder_path.substring(0,folder_path.length -1) - } - // Store releative path on ios. if(isIOS) folder_path = ""; diff --git a/main.qml b/main.qml index bb68008d..3e9f8999 100644 --- a/main.qml +++ b/main.qml @@ -214,7 +214,7 @@ ApplicationWindow { appWindow.viewState = prevState; } }; - passwordDialog.open(usefulName(walletPath())); + passwordDialog.open(usefulName(persistentSettings.wallet_path)); } function initialize() { @@ -253,7 +253,7 @@ ApplicationWindow { simpleModeConnectionTimer.running = true; // wallet already opened with wizard, we just need to initialize it - var wallet_path = walletPath(); + var wallet_path = persistentSettings.wallet_path; if(isIOS) wallet_path = moneroAccountsDir + wallet_path; // console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.walletPassword); @@ -392,11 +392,6 @@ ApplicationWindow { return !persistentSettings.useRemoteNode || persistentSettings.is_trusted_daemon; } - function walletPath() { - var wallet_path = persistentSettings.wallet_path - return wallet_path; - } - function usefulName(path) { // arbitrary "short enough" limit if (path.length < 32) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 84d066e7..861f0d39 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -131,10 +131,11 @@ Rectangle { } MoneroComponents.TextBlock { + id: walletLocation Layout.fillWidth: true color: MoneroComponents.Style.dimmedFontColor font.pixelSize: 14 - property string walletPath: (isIOS ? moneroAccountsDir : "") + appWindow.walletPath() + property string walletPath: (isIOS ? moneroAccountsDir : "") + persistentSettings.wallet_path text: "\