summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/PluginUpdater.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-06-29 18:14:17 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-06-29 18:14:17 +0000
commitd10d29da43c16bd537abcac6bf5314a49d30a938 (patch)
tree2f39d6a2c4e82780a6d841acc0069a19c16e8b59 /plugins/PluginUpdater/src/PluginUpdater.cpp
parent969481ec4ea41609fa55b80c2ca3629ff7b9279d (diff)
PluginUpdater:
-More correct way of using Folders plugin -Code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@9619 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/PluginUpdater.cpp')
-rw-r--r--plugins/PluginUpdater/src/PluginUpdater.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp
index ef4d048d93..5e14fddd70 100644
--- a/plugins/PluginUpdater/src/PluginUpdater.cpp
+++ b/plugins/PluginUpdater/src/PluginUpdater.cpp
@@ -31,7 +31,6 @@ PlugOptions opts;
UTF8_INTERFACE utfi;
#endif
-HANDLE hPluginUpdaterFolder = NULL, hEmptyFolder = NULL;
HINSTANCE hInst = NULL;
TCHAR tszRoot[MAX_PATH] = {0}, tszTempPath[MAX_PATH];
int hLangpack;
@@ -89,28 +88,22 @@ extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
- ServiceInit();
+ InitServices();
#endif
db_set_b(NULL, MODNAME, "NeedRestart", 0);
- hPluginUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Plugin Updater"), MIRANDA_PATHT _T("\\")DEFAULT_UPDATES_FOLDER);
- if (hPluginUpdaterFolder)
- OnFoldersChanged(0, 0);
- else
- lstrcpyn(tszRoot, VARST( _T("%miranda_path%\\"DEFAULT_UPDATES_FOLDER)), SIZEOF(tszRoot));
-
DWORD dwLen = GetTempPath( SIZEOF(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
tszTempPath[dwLen-1] = 0;
LoadOptions();
InitPopupList();
- NetlibInit();
- IcoLibInit();
+ InitNetlib();
+ InitIcoLib();
// Add cheking update menu item
- CreateServiceFunction(MODNAME"/CheckUpdates", MenuCommand);
+ InitCheck();
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 400010000;
mi.icolibItem = Skin_GetIconHandle("check_update");
@@ -119,7 +112,7 @@ extern "C" __declspec(dllexport) int Load(void)
Menu_AddMainMenuItem(&mi);
#if MIRANDA_VER >= 0x0A00
- CreateServiceFunction(MODNAME"/ShowList", ShowListCommand);
+ InitListNew();
mi.position++;
mi.icolibItem = Skin_GetIconHandle("plg_list");
@@ -127,7 +120,7 @@ extern "C" __declspec(dllexport) int Load(void)
mi.pszService = MODNAME"/ShowList";
Menu_AddMainMenuItem(&mi);
- HookEvent(ME_OPT_INITIALISE, OptInit);
+ InitOptions();
#endif
// Add hotkey
@@ -140,8 +133,7 @@ extern "C" __declspec(dllexport) int Load(void)
hkd.lParam = FALSE;
Hotkey_Register(&hkd);
- HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+ InitEvents();
//add sounds
SkinAddNewSoundEx("updatecompleted",LPGEN("Plugin Updater"),LPGEN("Update completed"));
@@ -151,12 +143,10 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- if (hCheckThread)
- hCheckThread = NULL;
-
- if (hListThread)
- hListThread = NULL;
-
- NetlibUnInit();
+ UnloadCheck();
+#if MIRANDA_VER >= 0x0A00
+ UnloadListNew();
+#endif
+ UnloadNetlib();
return 0;
}