diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-10-30 17:58:45 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-10-30 17:58:45 +0000 |
commit | 75d27e475943eafbcb52e9a795554358c9348fbd (patch) | |
tree | c809bfe3d298f81633e22cea62a9336b22e99237 /protocols/Tox/src/tox_options.cpp | |
parent | c0bf2d57a2b9ed3bb11eb6a4c499629b7ce8ba98 (diff) |
Tox: fixed profile creation and import
git-svn-id: http://svn.miranda-ng.org/main/trunk@15654 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index fdd5d30a92..007a3d6f74 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -74,25 +74,15 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) return;
}
CloseHandle(hProfile);
-
- TOX_ERR_NEW initError;
- toxThread.tox = tox_new(NULL, &initError);
- if (initError != TOX_ERR_NEW_OK)
- {
- m_proto->logger->Log(__FUNCTION__": failed to load tox profile (%d)", initError);
- return;
- }
}
- if (m_proto->InitToxCore())
+ if (m_proto->InitToxCore(&toxThread))
{
ptrT group(m_group.GetText());
if (mir_tstrlen(group) > 0 && Clist_GroupExists(group))
Clist_CreateGroup(0, group);
- m_proto->LoadFriendList(NULL);
- m_proto->SaveToxProfile();
- tox_kill(toxThread.tox);
+ m_proto->UninitToxCore(&toxThread);
m_toxAddress.Enable();
m_toxAddress.SetTextA(ptrA(m_proto->getStringA(TOX_SETTINGS_ID)));
@@ -128,15 +118,11 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) ofn.lpstrInitialDir = _T("%APPDATA%\\Tox");
if (!GetOpenFileName(&ofn))
- {
return;
- }
ptrT defaultProfilePath(m_proto->GetToxProfilePath());
if (mir_tstrcmpi(profilePath, defaultProfilePath) != 0)
- {
CopyFile(profilePath, defaultProfilePath, FALSE);
- }
m_profileCreate.OnClick(&m_profileCreate);
}
|