summaryrefslogtreecommitdiff
path: root/plugins/Folders/src/foldersList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Folders/src/foldersList.cpp')
-rw-r--r--plugins/Folders/src/foldersList.cpp22
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))