From 9cbcc4a1234b3ad61110eb733ed8b154f8e3ff68 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 10 Sep 2015 13:39:26 +0000 Subject: Tox: refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@15317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_options.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols/Tox/src/tox_options.cpp') diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index ddebf72d92..8ce1da4526 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -26,7 +26,7 @@ void CToxOptionsMain::OnInitDialog() { CToxDlgBase::OnInitDialog(); - std::tstring profilePath = m_proto->GetToxProfilePath(); + ptrT profilePath(m_proto->GetToxProfilePath()); if (CToxProto::IsFileExists(profilePath)) { m_toxAddress.Enable(); @@ -64,13 +64,13 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) { ToxThreadData toxThread; - std::tstring profilePath = m_proto->GetToxProfilePath(); + ptrT profilePath(m_proto->GetToxProfilePath()); if (!m_proto->IsFileExists(profilePath)) { - HANDLE hProfile = CreateFile(profilePath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hProfile = CreateFile(profilePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (hProfile == NULL) { - m_proto->debugLogA(__FUNCTION__": failed to create tox profile"); + m_proto->logger->Log(__FUNCTION__": failed to create tox profile"); return; } CloseHandle(hProfile); @@ -79,7 +79,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) toxThread.tox = tox_new(NULL, &initError); if (initError != TOX_ERR_NEW_OK) { - m_proto->debugLogA(__FUNCTION__": failed to load tox profile (%d)", initError); + m_proto->logger->Log(__FUNCTION__": failed to load tox profile (%d)", initError); return; } } @@ -131,10 +131,10 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) return; } - std::tstring defaultProfilePath = m_proto->GetToxProfilePath(); - if (mir_tstrcmpi(profilePath, defaultProfilePath.c_str()) != 0) + ptrT defaultProfilePath(m_proto->GetToxProfilePath()); + if (mir_tstrcmpi(profilePath, defaultProfilePath) != 0) { - CopyFile(profilePath, defaultProfilePath.c_str(), FALSE); + CopyFile(profilePath, defaultProfilePath, FALSE); } m_profileCreate.OnClick(&m_profileCreate); @@ -162,9 +162,9 @@ void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*) if (!GetSaveFileName(&ofn)) return; - std::tstring defaultProfilePath = m_proto->GetToxProfilePath(); - if (mir_tstrcmpi(profilePath, defaultProfilePath.c_str()) != 0) - CopyFile(defaultProfilePath.c_str(), profilePath, FALSE); + ptrT defaultProfilePath(m_proto->GetToxProfilePath()); + if (mir_tstrcmpi(profilePath, defaultProfilePath) != 0) + CopyFile(defaultProfilePath, profilePath, FALSE); } void CToxOptionsMain::OnApply() -- cgit v1.2.3