mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +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()
|
void showBackups()
|
||||||
{
|
{
|
||||||
fs::path backupsDir = GetBackupsDir();
|
fs::path backupsDir = gArgs.GetBackupsDirPath();
|
||||||
|
|
||||||
/* Open folder with default browser */
|
/* Open folder with default browser */
|
||||||
if (fs::exists(backupsDir))
|
if (fs::exists(backupsDir))
|
||||||
|
@ -455,6 +455,14 @@ const fs::path& ArgsManager::GetDataDirPath(bool net_specific) const
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs::path ArgsManager::GetBackupsDirPath()
|
||||||
|
{
|
||||||
|
if (!IsArgSet("-walletbackupsdir"))
|
||||||
|
return GetDataDirPath() / "backups";
|
||||||
|
|
||||||
|
return fs::absolute(GetArg("-walletbackupsdir", ""));
|
||||||
|
}
|
||||||
|
|
||||||
void ArgsManager::ClearPathCache()
|
void ArgsManager::ClearPathCache()
|
||||||
{
|
{
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
@ -804,10 +812,7 @@ const fs::path &GetDataDir(bool fNetSpecific)
|
|||||||
|
|
||||||
fs::path GetBackupsDir()
|
fs::path GetBackupsDir()
|
||||||
{
|
{
|
||||||
if (!gArgs.IsArgSet("-walletbackupsdir"))
|
return gArgs.GetBackupsDirPath();
|
||||||
return GetDataDir() / "backups";
|
|
||||||
|
|
||||||
return fs::absolute(gArgs.GetArg("-walletbackupsdir", ""));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckDataDirOption()
|
bool CheckDataDirOption()
|
||||||
|
@ -98,7 +98,6 @@ void ReleaseDirectoryLocks();
|
|||||||
bool TryCreateDirectories(const fs::path& p);
|
bool TryCreateDirectories(const fs::path& p);
|
||||||
fs::path GetDefaultDataDir();
|
fs::path GetDefaultDataDir();
|
||||||
const fs::path &GetDataDir(bool fNetSpecific = true);
|
const fs::path &GetDataDir(bool fNetSpecific = true);
|
||||||
fs::path GetBackupsDir();
|
|
||||||
// Return true if -datadir option points to a valid directory or is not specified.
|
// Return true if -datadir option points to a valid directory or is not specified.
|
||||||
bool CheckDataDirOption();
|
bool CheckDataDirOption();
|
||||||
fs::path GetConfigFile(const std::string& confPath);
|
fs::path GetConfigFile(const std::string& confPath);
|
||||||
@ -279,6 +278,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
const fs::path& GetDataDirPath(bool net_specific = true) const;
|
const fs::path& GetDataDirPath(bool net_specific = true) const;
|
||||||
|
|
||||||
|
fs::path GetBackupsDirPath();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear cached directory paths
|
* Clear cached directory paths
|
||||||
*/
|
*/
|
||||||
|
@ -5017,7 +5017,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path backupsDir = GetBackupsDir();
|
fs::path backupsDir = gArgs.GetBackupsDirPath();
|
||||||
backupsDir.make_preferred();
|
backupsDir.make_preferred();
|
||||||
|
|
||||||
if (!fs::exists(backupsDir))
|
if (!fs::exists(backupsDir))
|
||||||
|
Loading…
Reference in New Issue
Block a user