From b2269a81668efaf157d541f2ffd67e52b89417c6 Mon Sep 17 00:00:00 2001 From: George Hazan <george.hazan@gmail.com> Date: Fri, 1 Mar 2013 21:11:59 +0000 Subject: useless Folders support checks removed git-svn-id: http://svn.miranda-ng.org/main/trunk@3824 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/include/mim.h | 1 - plugins/TabSRMM/src/mim.cpp | 27 ++++++++++----------------- 2 files changed, 10 insertions(+), 18 deletions(-) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/src/include/mim.h b/plugins/TabSRMM/src/include/mim.h index c971cb7fdf..30d89406e6 100644 --- a/plugins/TabSRMM/src/include/mim.h +++ b/plugins/TabSRMM/src/include/mim.h @@ -159,7 +159,6 @@ public: const TCHAR* getSkinPath() const { return(m_szSkinsPath); } const TCHAR* getSavedAvatarPath() const { return(m_szSavedAvatarsPath); } const TCHAR* getChatLogPath() const { return(m_szChatLogsPath); } - const bool haveFoldersPlugin() const { return(m_haveFolders); } const TCHAR* getUserDir(); void configureCustomFolders(); diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index f491210554..809a7b0a56 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -318,17 +318,13 @@ int CMimAPI::FoldersPathChanged(WPARAM wParam, LPARAM lParam) void CMimAPI::configureCustomFolders() { - m_haveFolders = false; - if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { - m_hDataPath = (HANDLE)FoldersRegisterCustomPathT("TabSRMM", "Data path", const_cast<TCHAR *>(getDataPath())); - m_hSkinsPath = (HANDLE)FoldersRegisterCustomPathT("TabSRMM", "Skins root", const_cast<TCHAR *>(getSkinPath())); - m_hAvatarsPath = (HANDLE)FoldersRegisterCustomPathT("TabSRMM", "Saved Avatars", const_cast<TCHAR *>(getSavedAvatarPath())); - m_hChatLogsPath = (HANDLE)FoldersRegisterCustomPathT("TabSRMM", "Group chat logs root", const_cast<TCHAR *>(getChatLogPath())); + m_hDataPath = FoldersRegisterCustomPathT("TabSRMM", "Data path", const_cast<TCHAR *>(getDataPath())); + m_hSkinsPath = FoldersRegisterCustomPathT("TabSRMM", "Skins root", const_cast<TCHAR *>(getSkinPath())); + m_hAvatarsPath = FoldersRegisterCustomPathT("TabSRMM", "Saved Avatars", const_cast<TCHAR *>(getSavedAvatarPath())); + m_hChatLogsPath = FoldersRegisterCustomPathT("TabSRMM", "Group chat logs root", const_cast<TCHAR *>(getChatLogPath())); + + if (m_hDataPath) CGlobals::m_event_FoldersChanged = HookEvent(ME_FOLDERS_PATH_CHANGED, CMimAPI::FoldersPathChanged); - m_haveFolders = true; - } - else - m_hDataPath = m_hSkinsPath = m_hAvatarsPath = m_hChatLogsPath = 0; foldersPathChanged(); } @@ -381,15 +377,12 @@ INT_PTR CMimAPI::foldersPathChanged() const TCHAR* CMimAPI::getUserDir() { if (m_userDir[0] == 0) { - wchar_t* userdata; - if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) - userdata = L"%%miranda_userdata%%"; + if ( ServiceExists(MS_FOLDERS_REGISTER_PATH)) + lstrcpyn(m_userDir, L"%%miranda_userdata%%", SIZEOF(m_userDir)); else - userdata = ::Utils_ReplaceVarsT(L"%miranda_userdata%"); - mir_sntprintf(m_userDir, MAX_PATH, userdata); + lstrcpyn(m_userDir, VARST( _T("%miranda_userdata%")), SIZEOF(m_userDir)); + Utils::ensureTralingBackslash(m_userDir); - if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) - mir_free(userdata); } return(m_userDir); } -- cgit v1.2.3