Added win_sparkle_get_last_check_time to dll_api

Added function win_sparkle_get_last_check_time to dll_api.
This commit is contained in:
Andreas Schyman
2014-03-31 16:23:54 +02:00
committed by Vaclav Slavik
parent 360c589b0b
commit dc83f0da5f
2 changed files with 23 additions and 0 deletions

View File

@@ -213,6 +213,14 @@ WIN_SPARKLE_API void __cdecl win_sparkle_set_update_check_interval(int interval)
*/
WIN_SPARKLE_API int __cdecl win_sparkle_get_update_check_interval();
/**
Gets the time for the last update check.
Default value is -1, indicating that the update check has never run.
@since 0.4
*/
WIN_SPARKLE_API time_t __cdecl win_sparkle_get_last_check_time();
/// Callback type for win_sparkle_can_shutdown_callback()
typedef int (__cdecl *win_sparkle_can_shutdown_callback_t)();

View File

@@ -204,6 +204,21 @@ WIN_SPARKLE_API int __cdecl win_sparkle_get_update_check_interval()
return DEFAULT_CHECK_INTERVAL;
}
WIN_SPARKLE_API time_t __cdecl win_sparkle_get_last_check_time()
{
static const time_t DEFAULT_LAST_CHECK_TIME = -1;
try
{
time_t last_check;
Settings::ReadConfigValue("LastCheckTime", last_check, DEFAULT_LAST_CHECK_TIME);
return last_check;
}
CATCH_ALL_EXCEPTIONS
return DEFAULT_LAST_CHECK_TIME;
}
WIN_SPARKLE_API void __cdecl win_sparkle_set_can_shutdown_callback(win_sparkle_can_shutdown_callback_t callback)
{
try