summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-15 10:48:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-15 10:48:34 +0000
commit7ad7dc2a281fbe2442bf3e8efe594e4ffdd0c5de (patch)
treef00ceb65e062806bf20a7db84e628ffa8d0b85d6 /plugins/PluginUpdater/src/Events.cpp
parent5a91616243eb2dba33ac92849cb2702091641306 (diff)
- folder's path isn't updated upon change in Options;
- plugin's own directory should be skipped during scan; - minor code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@1464 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Events.cpp')
-rw-r--r--plugins/PluginUpdater/src/Events.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp
index 23d6fb26ca..4e2eb89ca1 100644
--- a/plugins/PluginUpdater/src/Events.cpp
+++ b/plugins/PluginUpdater/src/Events.cpp
@@ -21,8 +21,19 @@ Boston, MA 02111-1307, USA.
HANDLE Timer;
+int OnFoldersChanged(WPARAM, LPARAM)
+{
+ FoldersGetCustomPathT(hPluginUpdaterFolder, tszRoot, MAX_PATH, _T(""));
+ size_t len = _tcslen(tszRoot);
+ if (tszRoot[len-1] == '\\' || tszRoot[len-1] == '/')
+ tszRoot[len-1] = 0;
+ return 0;
+}
+
int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
+ HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
+
opts.bSilent = true;
int iRestartCount = DBGetContactSettingByte(NULL, MODNAME, "RestartCount", 2);
@@ -65,7 +76,7 @@ INT_PTR EmptyFolder(WPARAM wParam,LPARAM lParam)
return 0;
}
-INT OnPreShutdown(WPARAM wParam, LPARAM lParam)
+int OnPreShutdown(WPARAM wParam, LPARAM lParam)
{
CancelWaitableTimer(Timer);
CloseHandle(Timer);