diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-02 13:38:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-02 13:38:53 +0000 |
commit | 3d26dc75537137d829cc388abe0b9fe4b2df0d9d (patch) | |
tree | 61ee0925fca5f4d9ab10ef3ea5a8e14f213a1a11 /plugins/Folders/src/foldersList.cpp | |
parent | 6d46936f5711c2b927b88f4c93cf1431a776bbba (diff) |
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
Diffstat (limited to 'plugins/Folders/src/foldersList.cpp')
-rw-r--r-- | plugins/Folders/src/foldersList.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/plugins/Folders/src/foldersList.cpp b/plugins/Folders/src/foldersList.cpp index e003ad81ab..1f7ab3aef5 100644 --- a/plugins/Folders/src/foldersList.cpp +++ b/plugins/Folders/src/foldersList.cpp @@ -67,7 +67,7 @@ PFolderItem CFoldersList::Get(int index) return list[index];
}
-PFolderItem CFoldersList::Get(const char *section, const char *name)
+PFolderItem CFoldersList::Get(const char *section, const TCHAR *name)
{
for (int i = 0; i < count; i++)
if (list[i]->IsEqual(section, name))
@@ -76,7 +76,7 @@ PFolderItem CFoldersList::Get(const char *section, const char *name) return NULL;
}
-PFolderItem CFoldersList::GetTranslated(const char *trSection, const char *trName)
+PFolderItem CFoldersList::GetTranslated(const char *trSection, const TCHAR *trName)
{
for (int i = 0; i < count; i++)
if (list[i]->IsEqualTranslated(trSection, trName))
@@ -112,13 +112,17 @@ int CFoldersList::Add(CFolderItem *item) int CFoldersList::Add(FOLDERSDATA* data)
{
- CFolderItem *item;
+ FOLDERSDATA tmp;
+ if (data->cbSize < sizeof(FOLDERSDATA)) {
+ memset(&tmp, 0, sizeof(FOLDERSDATA));
+ memcpy(&tmp, data, data->cbSize);
+ data = &tmp;
+ }
+
if (data->flags & FF_UNICODE)
- item = new CFolderItem(data->szSection, data->szName, data->szFormatW, data->flags);
- else
- item = new CFolderItem(data->szSection, data->szName, _A2T(data->szFormat), data->flags);
+ return Add( new CFolderItem(data->szSection, data->szName, data->szFormatW, data->szUserNameW));
- return Add(item);
+ return Add( new CFolderItem(data->szSection, data->szName, _A2T(data->szFormat), _A2T(data->szUserName)));
}
void CFoldersList::Remove(CFolderItem *item)
@@ -131,10 +135,10 @@ void CFoldersList::Remove(int uniqueID) int CFoldersList::Contains(CFolderItem *item)
{
- return Contains(item->GetSection(), item->GetName());
+ return Contains(item->GetSection(), item->GetUserName());
}
-int CFoldersList::Contains(const char *section, const char *name)
+int CFoldersList::Contains(const char *section, const TCHAR *name)
{
for (int i = 0; i < count; i++)
if (list[i]->IsEqual(section, name))
|