From 3d26dc75537137d829cc388abe0b9fe4b2df0d9d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Mar 2013 13:38:53 +0000 Subject: unicode folders custom names (gotten from szName by default, as usual) git-svn-id: http://svn.miranda-ng.org/main/trunk@3835 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Folders/src/folderItem.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'plugins/Folders/src/folderItem.cpp') diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index fe16f30d7a..4125d43d4a 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -20,13 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -CFolderItem::CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const DWORD flags) +CFolderItem::CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const TCHAR *userName) { m_szSection = mir_strdup(sectionName); m_szName = mir_strdup(name); + if (userName) + m_tszUserName = mir_tstrdup(userName); + else + m_tszUserName = mir_a2t(name); m_tszFormat = NULL; m_tszOldFormat = NULL; - m_flags = flags; GetDataFromDatabase(format); FolderCreateDirectory(); } @@ -48,17 +51,17 @@ void CFolderItem::SetFormat(const TCHAR *newFormat) int CFolderItem::IsEqual(const CFolderItem *other) { - return (IsEqual(other->GetSection(), other->GetName())); + return (IsEqual(other->GetSection(), other->GetUserName())); } -int CFolderItem::IsEqual(const char *section, const char *name) +int CFolderItem::IsEqual(const char *section, const TCHAR *name) { - return ((strcmp(m_szName, name) == 0) && (strcmp(m_szSection, section) == 0)); + return !_tcscmp(m_tszUserName, name) && !strcmp(m_szSection, section); } -int CFolderItem::IsEqualTranslated(const char *trSection, const char *trName) +int CFolderItem::IsEqualTranslated(const char *trSection, const TCHAR *trName) { - return ((strcmp(Translate(m_szName), trName) == 0) && (strcmp(Translate(m_szSection), trSection) == 0)); + return !_tcscmp( TranslateTS(m_tszUserName), trName) && !strcmp(Translate(m_szSection), trSection); } int CFolderItem::operator ==(const CFolderItem *other) -- cgit v1.2.3