Mounting changes
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user