diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-08-02 14:10:10 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-08-02 14:10:10 +0000 |
commit | 0d29ccd59beb6b7493aaa1a14ef7f6c40b5174df (patch) | |
tree | 09e14fe31c400c97649b1250a3bc277114342b5b /plugins/PluginUpdater/src/DlgUpdate.cpp | |
parent | 0517871b91bd2e567a8fe294344225ec9247a632 (diff) |
PluginUpdater:
- Fixed checking intervals - "check every xx" is now relative to last check, not to miranda start
- Small cleanup
- Version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@5550 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 8d9863aced..8c2ff2bd45 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -544,9 +544,10 @@ static void CheckUpdates(void *) tszTempPath[dwLen-1] = 0;
ptrT updateUrl( GetDefaultUrl()), baseUrl;
-
+
SERVLIST hashes(50, CompareHashes);
- if (ParseHashes(updateUrl, baseUrl, hashes)) {
+ bool success = ParseHashes(updateUrl, baseUrl, hashes);
+ if (success) {
FILELIST *UpdateFiles = new FILELIST(20);
VARST dirname( _T("%miranda_path%"));
int count = ScanFolder(dirname, lstrlen(dirname)+1, 0, baseUrl, hashes, UpdateFiles);
@@ -559,7 +560,8 @@ static void CheckUpdates(void *) }
else CallFunctionAsync(LaunchDialog, UpdateFiles);
}
-
+ InitTimer(success);
+
hashes.destroy();
hCheckThread = NULL;
}
@@ -572,9 +574,8 @@ void DoCheck(int iFlag) ShowWindow(hwndDialog, SW_SHOW);
SetForegroundWindow(hwndDialog);
SetFocus(hwndDialog);
- }
- else if (iFlag) {
- hCheckThread = mir_forkthread(CheckUpdates, 0);
+ } else if (iFlag) {
db_set_dw(NULL, MODNAME, "LastUpdate", time(NULL));
+ hCheckThread = mir_forkthread(CheckUpdates, 0);
}
}
|