mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
(followup) bitcoin#21244: Move GetBackupsDir to ArgsManager
This commit is contained in:
parent
1f4e26baf9
commit
262fe0ada6
@ -643,7 +643,7 @@ void openConfigfile()
|
||||
|
||||
void showBackups()
|
||||
{
|
||||
fs::path backupsDir = GetBackupsDir();
|
||||
fs::path backupsDir = gArgs.GetBackupsDirPath();
|
||||
|
||||
/* Open folder with default browser */
|
||||
if (fs::exists(backupsDir))
|
||||
|
@ -455,6 +455,14 @@ const fs::path& ArgsManager::GetDataDirPath(bool net_specific) const
|
||||
return path;
|
||||
}
|
||||
|
||||
fs::path ArgsManager::GetBackupsDirPath()
|
||||
{
|
||||
if (!IsArgSet("-walletbackupsdir"))
|
||||
return GetDataDirPath() / "backups";
|
||||
|
||||
return fs::absolute(GetArg("-walletbackupsdir", ""));
|
||||
}
|
||||
|
||||
void ArgsManager::ClearPathCache()
|
||||
{
|
||||
LOCK(cs_args);
|
||||
@ -804,10 +812,7 @@ const fs::path &GetDataDir(bool fNetSpecific)
|
||||
|
||||
fs::path GetBackupsDir()
|
||||
{
|
||||
if (!gArgs.IsArgSet("-walletbackupsdir"))
|
||||
return GetDataDir() / "backups";
|
||||
|
||||
return fs::absolute(gArgs.GetArg("-walletbackupsdir", ""));
|
||||
return gArgs.GetBackupsDirPath();
|
||||
}
|
||||
|
||||
bool CheckDataDirOption()
|
||||
|
@ -98,7 +98,6 @@ void ReleaseDirectoryLocks();
|
||||
bool TryCreateDirectories(const fs::path& p);
|
||||
fs::path GetDefaultDataDir();
|
||||
const fs::path &GetDataDir(bool fNetSpecific = true);
|
||||
fs::path GetBackupsDir();
|
||||
// Return true if -datadir option points to a valid directory or is not specified.
|
||||
bool CheckDataDirOption();
|
||||
fs::path GetConfigFile(const std::string& confPath);
|
||||
@ -279,6 +278,8 @@ public:
|
||||
*/
|
||||
const fs::path& GetDataDirPath(bool net_specific = true) const;
|
||||
|
||||
fs::path GetBackupsDirPath();
|
||||
|
||||
/**
|
||||
* Clear cached directory paths
|
||||
*/
|
||||
|
@ -5017,7 +5017,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
return false;
|
||||
}
|
||||
|
||||
fs::path backupsDir = GetBackupsDir();
|
||||
fs::path backupsDir = gArgs.GetBackupsDirPath();
|
||||
backupsDir.make_preferred();
|
||||
|
||||
if (!fs::exists(backupsDir))
|
||||
|
Loading…
Reference in New Issue
Block a user