1
0

Mounting changes

This commit is contained in:
Scott E. Graves
2017-03-02 00:16:18 -06:00
parent 37025e5035
commit 27cd8def9b
36 changed files with 124 additions and 36 deletions

View File

@@ -108,6 +108,13 @@ CSiaDriveDlg::CSiaDriveDlg(CWnd* pParent /*=NULL*/)
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
CSiaDriveDlg::~CSiaDriveDlg()
{
_dokan.reset(nullptr);
_siaApi.reset(nullptr);
}
void CSiaDriveDlg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::DoDataExchange(pDX);
@@ -207,21 +214,22 @@ HRESULT CSiaDriveDlg::OnButtonUnlockWallet(IHTMLElement* /*pElement*/)
return S_OK;
}
std::unique_ptr<Dokan::CSiaDokanDrive> d;
void CSiaDriveDlg::OnDocumentComplete(LPDISPATCH, LPCTSTR)
{
KillTimer(IDT_UPDATE);
KillTimer(IDT_UI_ACTION_QUEUE);
// Create new API to clear all cached data used by threaded implementations
_siaApi.reset(new CSiaApi({ L"localhost", 9980, L"1.1.1" }, &_siaConfig));
if (!_siaApi)
{
_siaApi.reset(new CSiaApi({ L"localhost", 9980, L"1.1.1" }, &_siaConfig));
}
ClearDisplay();
CallClientScript(L"setAvailableDrives", json(GetAvailableDrives()), nullptr);
if (!d)
if (!_dokan)
{
d.reset(new Dokan::CSiaDokanDrive(*_siaApi, &_siaConfig));
d->Mount('A', CA2W(_siaConfig.GetCacheFolder().c_str()).m_psz, 10);
_dokan.reset(new Dokan::CSiaDokanDrive(*_siaApi, &_siaConfig));
_dokan->Mount('Y', CA2W(_siaConfig.GetCacheFolder().c_str()).m_psz, 10);
}
SetTimer(IDT_UPDATE, 2000, nullptr);