Skip to content

Commit

Permalink
Merge branch 'dev' into slptokens
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Sep 27, 2022
2 parents c00f14d + e7f14f5 commit 76be1e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- name: Install QT IFW (MacOS)
if: runner.os == 'macOS'
run: |
python3 -m aqt tool mac tools_ifw 4.4.1 qt.tools.ifw.44 --outputdir ${{ github.workspace }}/Qt
python3 -m aqt tool mac tools_ifw 4.4.2 qt.tools.ifw.44 --outputdir ${{ github.workspace }}/Qt
echo "${{ github.workspace }}/Qt/Tools/QtInstallerFramework/4.4/bin" >> $GITHUB_PATH
- name: Install QT (Windows)
Expand All @@ -132,7 +132,7 @@ jobs:
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m aqt tool windows tools_ifw 4.4.1 qt.tools.ifw.44 --outputdir C:/Qt
python -m aqt tool windows tools_ifw 4.4.2 qt.tools.ifw.44 --outputdir C:/Qt
echo "C:/Qt/Tools/QtInstallerFramework/4.4/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo $env:GITHUB_PATH
echo $env:PATH
Expand Down
15 changes: 13 additions & 2 deletions src/core/atomicdex/managers/qt.wallet.manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,24 @@ namespace atomic_dex

const std::string wallet_cfg_file = std::string(atomic_dex::get_raw_version()) + "-coins"s + "."s + wallet_name.toStdString() + ".json"s;
const fs::path wallet_cfg_path = utils::get_atomic_dex_config_folder() / wallet_cfg_file;
bool valid_json = false;

if (fs::exists(wallet_cfg_path))
{
QFile ifs;
ifs.setFileName(std_path_to_qstring(wallet_cfg_path));
ifs.open(QIODevice::ReadOnly | QIODevice::Text);
std::string json_data = QString(ifs.readAll()).toUtf8().constData();
valid_json = nlohmann::json::accept(json_data);

if (not fs::exists(wallet_cfg_path))
ifs.close();
}

if (!valid_json)
{
const auto cfg_path = ag::core::assets_real_path() / "config";
std::string filename = std::string(atomic_dex::get_raw_version()) + "-coins.json";
fs::copy(cfg_path / filename, wallet_cfg_path);
fs::copy(cfg_path / filename, wallet_cfg_path, fs::copy_options::overwrite_existing);
}

const fs::path seed_path = utils::get_atomic_dex_config_folder() / (wallet_name.toStdString() + ".seed"s);
Expand Down

0 comments on commit 76be1e7

Please sign in to comment.