diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-01 21:11:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-01 21:11:59 +0000 |
commit | b2269a81668efaf157d541f2ffd67e52b89417c6 (patch) | |
tree | 128980a09b93abf48f63ee78bb51a041b607e8a2 /plugins/Db_autobackups/src | |
parent | be6c3121411e55055383900f45d17a1ef887ccdd (diff) |
useless Folders support checks removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@3824 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db_autobackups/src')
-rw-r--r-- | plugins/Db_autobackups/src/main.cpp | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 93865adbcd..d5c0116e75 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -6,8 +6,6 @@ TCHAR *profilePath; int hLangpack;
HANDLE hFolder;
-HANDLE hHooks[4];
-HANDLE hServices[3];
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -42,12 +40,12 @@ static int FoldersGetBackupPath(WPARAM wParam, LPARAM lParam) return 0;
}
-static int FoldersInit(void)
+static void FoldersInit(void)
{
- hFolder = (HANDLE) FoldersRegisterCustomPathT("Database Backups", "Backup Folder", DIR SUB_DIR);
- hHooks[0] = HookEvent(ME_FOLDERS_PATH_CHANGED, FoldersGetBackupPath);
- FoldersGetBackupPath(0, 0);
- return 0;
+ if (hFolder = FoldersRegisterCustomPathT("Database Backups", "Backup Folder", DIR SUB_DIR)) {
+ HookEvent(ME_FOLDERS_PATH_CHANGED, FoldersGetBackupPath);
+ FoldersGetBackupPath(0, 0);
+ }
}
static void MenuInit(void)
@@ -85,16 +83,15 @@ static int ModulesLoad(WPARAM wParam, LPARAM lParam) Icon_Register(hInst, LPGEN("Database/Database Backups"), iconList, SIZEOF(iconList));
- if(ServiceExists(MS_FOLDERS_REGISTER_PATH))
- FoldersInit();
+ FoldersInit();
LoadOptions();
MenuInit();
// register trigger action for triggerplugin
- if(ServiceExists(MS_TRIGGER_REGISTERACTION))
+ if ( ServiceExists(MS_TRIGGER_REGISTERACTION))
TriggerActionInit();
- hHooks[1] = HookEvent(ME_OPT_INITIALISE, OptionsInit);
+ HookEvent(ME_OPT_INITIALISE, OptionsInit);
if(options.backup_types & BT_START)
mir_forkthread(BackupThread, NULL);
return 0;
@@ -117,12 +114,12 @@ void SysInit() mir_getLP(&pluginInfo);
OleInitialize(0);
- hServices[0] = CreateServiceFunction(MS_AB_BACKUP, ABService);
- hServices[1] = CreateServiceFunction(MS_AB_BACKUPTRGR, BackupServiceTrgr);
- hServices[2] = CreateServiceFunction(MS_AB_SAVEAS, DBSaveAs);
+ CreateServiceFunction(MS_AB_BACKUP, ABService);
+ CreateServiceFunction(MS_AB_BACKUPTRGR, BackupServiceTrgr);
+ CreateServiceFunction(MS_AB_SAVEAS, DBSaveAs);
- hHooks[2] = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
- hHooks[3] = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
@@ -138,7 +135,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) int Load(void)
{
-
SysInit();
return 0;
}
@@ -146,18 +142,6 @@ extern "C" __declspec(dllexport) int Load(void) extern "C" __declspec(dllexport) int Unload(void)
{
OleUninitialize();
-
- for (int i = 0; i < SIZEOF(hHooks); ++i)
- {
- if (hHooks[i])
- UnhookEvent(hHooks[i]);
- }
- for (int i = 0; i < SIZEOF(hServices); ++i)
- {
- if (hServices[i])
- DestroyServiceFunction(hServices[i]);
- }
-
return 0;
}
|