summaryrefslogtreecommitdiff
path: root/plugins/Weather/src/weather_update.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-29 11:43:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-29 11:43:52 +0000
commit41958e91d52457e264e7e62e22beb605432a76a2 (patch)
tree88fb1623464d18e0fe80775f7fba4660aad229ca /plugins/Weather/src/weather_update.cpp
parent35d3ce335858b8ac7c9db915f798f2f6a916a16d (diff)
- weather is not updated in the virtual mode;
- unused option removed git-svn-id: http://svn.miranda-ng.org/main/trunk@2557 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather_update.cpp')
-rw-r--r--plugins/Weather/src/weather_update.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp
index d07af7865b..aa60678ccd 100644
--- a/plugins/Weather/src/weather_update.cpp
+++ b/plugins/Weather/src/weather_update.cpp
@@ -47,7 +47,7 @@ int UpdateWeather(HANDLE hContact)
// log to netlib log for debug purpose
Netlib_LogfT(hNetlibUser, _T("************************************************************************"));
- int dbres = DBGetContactSettingTString(hContact, WEATHERPROTONAME, "Nick", &dbv);
+ int dbres = db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv);
Netlib_LogfT(hNetlibUser, _T("<-- Start update for station -->"));
@@ -81,19 +81,19 @@ int UpdateWeather(HANDLE hContact)
// compare the old condition and determine if the weather had changed
if (opt.UpdateOnlyConditionChanged) { // consider condition change
- if ( !DBGetContactSettingTString(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
+ if ( !db_get_ts(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
if (_tcsicmp(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed
db_free(&dbv);
}
else Ch = TRUE;
- if ( !DBGetContactSettingTString(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
+ if ( !db_get_ts(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
if (_tcsicmp(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed
db_free(&dbv);
}
else Ch = TRUE;
}
else { // consider update time change
- if ( !DBGetContactSettingTString(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
+ if ( !db_get_ts(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
if (_tcsicmp(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed
db_free(&dbv);
}
@@ -101,7 +101,7 @@ int UpdateWeather(HANDLE hContact)
}
// have weather alert issued?
- dbres = DBGetContactSettingTString(hContact, WEATHERCONDITION, "Alert", &dbv);
+ dbres = db_get_ts(hContact, WEATHERCONDITION, "Alert", &dbv);
if ( !dbres && dbv.ptszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
@@ -167,7 +167,7 @@ int UpdateWeather(HANDLE hContact)
if (db_get_b(hContact, WEATHERPROTONAME, "File", 0)) {
// external log
- if ( !DBGetContactSettingTString(hContact,WEATHERPROTONAME, "Log",&dbv)) {
+ if ( !db_get_ts(hContact,WEATHERPROTONAME, "Log",&dbv)) {
// for the option for overwriting the file, delete old file first
if (db_get_b(hContact,WEATHERPROTONAME, "Overwrite",0))
DeleteFile(dbv.ptszVal);
@@ -594,8 +594,7 @@ int GetWeatherData(HANDLE hContact)
void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
// only run if it is not current updating and the auto update option is enabled
- if ( !ThreadRunning && opt.CAutoUpdate && !Miranda_Terminated() &&
- (!opt.NoProtoCondition || status == ID_STATUS_ONLINE))
+ if ( !ThreadRunning && opt.CAutoUpdate && !Miranda_Terminated() && (opt.NoProtoCondition || status == ID_STATUS_ONLINE))
UpdateAll(TRUE, FALSE);
}
@@ -607,7 +606,7 @@ void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
ThreadRunning = FALSE;
if ( !Miranda_Terminated()) {
- if (opt.StartupUpdate && !opt.NoProtoCondition)
+ if (opt.StartupUpdate)
UpdateAll(FALSE, FALSE);
timerId = SetTimer(NULL, 0, ((int)opt.UpdateTime)*60000, (TIMERPROC)timerProc);
}