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/services.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/services.cpp')
-rw-r--r-- | plugins/Folders/src/services.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index 4178dd49e8..5fb4a404a8 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -27,11 +27,6 @@ TCHAR szCurrentProfile[MAX_FOLDERS_PATH]; TCHAR szMirandaPath[MAX_FOLDERS_PATH];
TCHAR szUserDataPath[MAX_FOLDERS_PATH];
-HANDLE hsFoldersGetPath;
-HANDLE hsFoldersGetSize;
-HANDLE hsFoldersGetPathAlloc;
-HANDLE hsFoldersRegisterPath;
-
INT_PTR ExpandPath(TCHAR *szResult, TCHAR *format, int size)
{
szResult[0] = '\0';
@@ -62,8 +57,11 @@ INT_PTR ExpandPath(TCHAR *szResult, TCHAR *format, int size) INT_PTR RegisterPathService(WPARAM wParam, LPARAM lParam)
{
- FOLDERSDATA *tmp = (FOLDERSDATA *) lParam;
- if (tmp == NULL || tmp->cbSize != sizeof(FOLDERSDATA))
+ FOLDERSDATA *tmp = (FOLDERSDATA*)lParam;
+ if (tmp == NULL)
+ return NULL;
+
+ if (tmp->cbSize != sizeof(FOLDERSDATA) && tmp->cbSize != FOLDERSDATA_SIZE_V1)
return NULL;
return lstRegisteredFolders.Add(tmp); //returns 1..n or 0 on error
@@ -113,16 +111,8 @@ int InitServices() mir_sntprintf(szUserDataPath, MAX_FOLDERS_PATH, szTemp);
mir_free(szTemp);
- hsFoldersGetPath = CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
- hsFoldersGetSize = CreateServiceFunction(MS_FOLDERS_GET_SIZE, GetPathSizeService);
- hsFoldersRegisterPath = CreateServiceFunction(MS_FOLDERS_REGISTER_PATH, RegisterPathService);
- return 0;
-}
-
-int DestroyServices()
-{
- DestroyServiceFunction(hsFoldersGetPath);
- DestroyServiceFunction(hsFoldersGetSize);
- DestroyServiceFunction(hsFoldersRegisterPath);
+ CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
+ CreateServiceFunction(MS_FOLDERS_GET_SIZE, GetPathSizeService);
+ CreateServiceFunction(MS_FOLDERS_REGISTER_PATH, RegisterPathService);
return 0;
}
|