summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Events.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:32:43 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:32:43 +0000
commitc72e3f9fe11a3d6b72a04af599b04fde82091dd5 (patch)
tree51a38dabcf65b28b8e2e6893b7e947b443583fef /plugins/PluginUpdater/src/Events.cpp
parent850eb8d3890ebd911fb8278114b7b93eba407cb0 (diff)
PluginUpdater:
- Show a notification when the update URL isn't available - small redesign of new components window - minor memory leaks fixecd git-svn-id: http://svn.miranda-ng.org/main/trunk@10509 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Events.cpp')
-rw-r--r--plugins/PluginUpdater/src/Events.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp
index 90ad62e3fb..6afabbe2a7 100644
--- a/plugins/PluginUpdater/src/Events.cpp
+++ b/plugins/PluginUpdater/src/Events.cpp
@@ -30,23 +30,34 @@ int OnFoldersChanged(WPARAM, LPARAM)
return 0;
}
-int ModulesLoaded(WPARAM, LPARAM)
+void EmptyFolder()
{
- HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
+ SHFILEOPSTRUCT file_op = {
+ NULL,
+ FO_DELETE,
+ tszRoot,
+ _T(""),
+ FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION,
+ false,
+ 0,
+ _T("") };
+ SHFileOperation(&file_op);
+}
- hPluginUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Plugin Updater"), MIRANDA_PATHT _T("\\")DEFAULT_UPDATES_FOLDER);
- if (hPluginUpdaterFolder)
+int ModulesLoaded(WPARAM, LPARAM)
+{
+ if (hPluginUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Plugin Updater"), MIRANDA_PATHT _T("\\")DEFAULT_UPDATES_FOLDER)) {
+ HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
OnFoldersChanged(0, 0);
+ }
else
lstrcpyn(tszRoot, VARST( _T("%miranda_path%\\"DEFAULT_UPDATES_FOLDER)), SIZEOF(tszRoot));
- opts.bSilent = true;
-
int iRestartCount = db_get_b(NULL, MODNAME, "RestartCount", 2);
if (iRestartCount > 0)
db_set_b(NULL, MODNAME, "RestartCount", iRestartCount-1);
else
- EmptyFolder(0, TRUE); // silently
+ EmptyFolder(); // silently
CheckUpdateOnStartup();
@@ -56,24 +67,6 @@ int ModulesLoaded(WPARAM, LPARAM)
return 0;
}
-INT_PTR EmptyFolder(WPARAM,LPARAM lParam)
-{
- SHFILEOPSTRUCT file_op = {
- NULL,
- FO_DELETE,
- tszRoot,
- _T(""),
- FOF_NOERRORUI |
- FOF_SILENT,
- false,
- 0,
- _T("") };
- if (lParam)
- file_op.fFlags |= FOF_NOCONFIRMATION;
- SHFileOperation(&file_op);
- return 0;
-}
-
int OnPreShutdown(WPARAM, LPARAM)
{
CancelWaitableTimer(Timer);