diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-29 10:04:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-29 10:04:32 +0000 |
commit | d0548b5d631f44cad9bbce5ac521717c87cef3ad (patch) | |
tree | 928027ed38136c512473939eaee36f64fab901e6 /plugins | |
parent | 8aad639169f7d36ba395737592cfc4d0295ce5f7 (diff) |
- by default Weather goes virtual;
- version bump;
git-svn-id: http://svn.miranda-ng.org/main/trunk@2555 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Weather/src/version.h | 9 | ||||
-rw-r--r-- | plugins/Weather/src/weather.cpp | 51 | ||||
-rw-r--r-- | plugins/Weather/src/weather.h | 5 | ||||
-rw-r--r-- | plugins/Weather/src/weather_data.cpp | 5 | ||||
-rw-r--r-- | plugins/Weather/src/weather_opt.cpp | 2 |
5 files changed, 10 insertions, 62 deletions
diff --git a/plugins/Weather/src/version.h b/plugins/Weather/src/version.h index 58a8f34a3c..c528909dd7 100644 --- a/plugins/Weather/src/version.h +++ b/plugins/Weather/src/version.h @@ -1,6 +1,3 @@ -#define __FILEVERSION_STRING 0,3,9,1
-#define __VERSION_STRING "0.3.9.1"
-#define __VERSION_DWORD PLUGIN_MAKE_VERSION(0, 3, 9, 1)
-
-#define BETA FALSE
-#define AUTH "NoName, borkra"
+#define __FILEVERSION_STRING 0,4,0,1
+#define __VERSION_STRING "0.4.0.1"
+#define __VERSION_DWORD PLUGIN_MAKE_VERSION(0, 4, 0, 1)
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 9eb22252b5..92e17894e7 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -56,20 +56,16 @@ BOOL ThreadRunning; // variable to determine if module loaded
BOOL ModuleLoaded;
-
-
-
// plugin info
-// VER = version, AUTH = author, defined in weather.h
static const PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
"Weather Protocol",
__VERSION_DWORD,
"Retrieves weather information and displays it in your contact list.",
- AUTH,
- "borkra@miranda-im.org",
- "(c) 2002-2005 NoName, 2005-2010 Boris Krasnovskiy",
+ "Miranda NG Team",
+ "www.miranda-ng.org",
+ "(c) 2002-2005 NoName, 2005-2010 Boris Krasnovskiy, 2012 Miranda NG Team",
"http://miranda-ng.org/",
UNICODE_AWARE,
MIID_WEATHER
@@ -89,7 +85,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-
int WeatherShutdown(WPARAM wParam,LPARAM lParam)
{
KillTimer(NULL, timerId); // kill update timer
@@ -106,19 +101,6 @@ int WeatherShutdown(WPARAM wParam,LPARAM lParam) return 0;
}
-// update some settings/db values for new version
-// lastver = dword value for the last version made by PLUGIN_MAKE_VERSION
-void Upgrade(DWORD lastver)
-{
- // for version below v0.3.2.3, remove the "TriggerText" setting
- if (lastver < PLUGIN_MAKE_VERSION(0,3,2,3))
- db_unset(NULL, WEATHERPROTONAME, "TriggerText");
- if (lastver < PLUGIN_MAKE_VERSION(0,3,3,13))
- db_unset(NULL, "KnownModules", "Weather");
-
- db_set_dw(NULL, WEATHERPROTONAME, "Version", __VERSION_DWORD);
-}
-
// weather protocol initialization function
// run after the event ME_SYSTEM_MODULESLOADED occurs
int WeatherInit(WPARAM wParam,LPARAM lParam)
@@ -144,19 +126,6 @@ int WeatherInit(WPARAM wParam,LPARAM lParam) return 0;
}
-// update some settings/db values for new version, this one is for contact
-// lastver = dword value for the last version made by PLUGIN_MAKE_VERSION
-// hContact = current contact
-void UpgradeContact(DWORD lastver, HANDLE hContact)
-{
- // for version below v0.3.2.3, suppress online notifications for all weather contacts
- if (lastver < PLUGIN_MAKE_VERSION(0,3,2,3))
- {
- db_set_dw(hContact, "Ignore", "Mask", 8);
- db_set_dw(hContact, "Ignore", "Mask1", 8);
- }
-}
-
//============ MISC FUNCTIONS ============
// initialize the global variables at startup
@@ -194,8 +163,6 @@ extern "C" int __declspec(dllexport) Unload(void) extern "C" int __declspec(dllexport) Load(void)
{
- DWORD lastver;
-
mir_getLP(&pluginInfoEx);
// initialize global variables
@@ -204,18 +171,8 @@ extern "C" int __declspec(dllexport) Load(void) // load options and set defaults
LoadOptions();
- // upgrade check
- // I only support version check and upgrade for my own version, so check if the author is my name
- if (strstr(AUTH, "NoName") != NULL)
- {
- lastver = db_get_dw(NULL, WEATHERPROTONAME, "Version", PLUGIN_MAKE_VERSION(0,3,1,8));
- if (lastver < __VERSION_DWORD) Upgrade(lastver);
- }
- else // if it is not my build, ignore upgrade procedure
- lastver = PLUGIN_MAKE_VERSION(255,255,255,255);
-
// reset the weather data at startup for individual contacts
- EraseAllInfo(lastver);
+ EraseAllInfo();
// load weather update data
LoadWIData(TRUE);
diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 072860c914..95a7d5bf49 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -371,9 +371,6 @@ extern BOOL ThreadRunning; //============ FUNCTION PRIMITIVES ============
-// functions in weather.c
-void UpgradeContact(DWORD lastver, HANDLE hContact);
-
// functions in weather_addstn.c
INT_PTR WeatherAddToList(WPARAM wParam,LPARAM lParam);
BOOL CheckSearch();
@@ -429,7 +426,7 @@ WEATHERINFO LoadWeatherInfo(HANDLE Change); int DBGetData(HANDLE hContact, char *setting, DBVARIANT *dbv);
int DBGetStaticString(HANDLE hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len);
-void EraseAllInfo(DWORD lastver);
+void EraseAllInfo(void);
void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data);
void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szInfo);
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 5def028c3d..09fd7f849e 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -117,7 +117,7 @@ int DBGetStaticString(HANDLE hContact, const char *szModule, const char *valueNa // erase all current weather information from database
// lastver = the last used version number in dword (using PLUGIN_MAKE_VERSION)
-void EraseAllInfo(DWORD lastver)
+void EraseAllInfo()
{
TCHAR str[255];
int ContactCount = 0;
@@ -128,9 +128,6 @@ void EraseAllInfo(DWORD lastver) while(hContact) {
// see if the contact is a weather contact
if ( IsMyContact(hContact)) {
- // check for upgrade
- if (lastver < __VERSION_DWORD)
- UpgradeContact(lastver, hContact);
db_set_w(hContact,WEATHERPROTONAME, "Status",ID_STATUS_OFFLINE);
db_set_w(hContact,WEATHERPROTONAME, "StatusIcon",ID_STATUS_OFFLINE);
db_unset(hContact, "CList", "MyHandle");
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index f242adb0f1..31ddc72e2d 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -112,7 +112,7 @@ void LoadOptions(void) opt.AutoUpdate = db_get_b(NULL, WEATHERPROTONAME, "AutoUpdate",TRUE);
opt.UpdateTime = db_get_w(NULL, WEATHERPROTONAME, "UpdateTime",30);
opt.NewBrowserWin = db_get_b(NULL, WEATHERPROTONAME, "NewWindow",TRUE);
- opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus",0);
+ opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus",TRUE);
opt.UpdateOnlyConditionChanged = db_get_b(NULL, WEATHERPROTONAME, "CondChangeAsUpdate",TRUE);
opt.RemoveOldData = db_get_b(NULL, WEATHERPROTONAME, "RemoveOld",FALSE);
opt.MakeItalic = db_get_b(NULL, WEATHERPROTONAME, "MakeItalic",TRUE);
|