summaryrefslogtreecommitdiff
path: root/plugins/VersionInfo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-03 15:57:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-03 15:57:14 +0000
commitcd4e43a5af4dcf660969bc5abada0d97cfd0cd03 (patch)
tree2cb7da25499aa1258196b6a2dc80346cfe40a2f1 /plugins/VersionInfo
parent23617c95e41dc21347d4957c29fe5989a36e2a85 (diff)
version related code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7478 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/VersionInfo')
-rw-r--r--plugins/VersionInfo/src/CVersionInfo.cpp55
1 files changed, 14 insertions, 41 deletions
diff --git a/plugins/VersionInfo/src/CVersionInfo.cpp b/plugins/VersionInfo/src/CVersionInfo.cpp
index bb6aad9b6c..2f0a0dcd0d 100644
--- a/plugins/VersionInfo/src/CVersionInfo.cpp
+++ b/plugins/VersionInfo/src/CVersionInfo.cpp
@@ -685,50 +685,23 @@ bool CVersionInfo::GetPluginLists()
}
//Let's get the info.
- if (MirandaPluginInfo != NULL) {//a valid miranda plugin
- if (pluginInfo != NULL) {
- //We have loaded the informations into pluginInfo.
- std::tstring timedate = GetPluginTimestamp(&fd.ftLastWriteTime);
- CPlugin thePlugin(fd.cFileName, _A2T(pluginInfo->shortName), pluginInfo->uuid, /*(pluginInfo->flags & 1) ? _T("Unicode aware") :*/ _T(""), (DWORD) pluginInfo->version, timedate.c_str(), _T(""));
-
- if (PluginIsEnabled)
- AddPlugin(thePlugin, listActivePlugins);
- else {
- if ((IsUUIDNull(pluginInfo->uuid)) && (mirandaVersion >= PLUGIN_MAKE_VERSION(0,8,0,9))) {
- thePlugin.SetErrorMessage( _T(" Plugin does not have an UUID and will not work with Miranda 0.8.\r\n"));
- AddPlugin(thePlugin, listUnloadablePlugins);
- }
- else AddPlugin(thePlugin, listInactivePlugins);
-
- FreeLibrary(hInstPlugin); //We don't need it anymore.
- }
- FreePluginInfo(pluginInfo);
- MirandaPluginInfo = NULL;
- #ifdef _DEBUG
- if (verbose) {
- TCHAR szMsg[4096] = { 0 };
- mir_sntprintf(szMsg, SIZEOF(szMsg), _T("Done with: %s"), fd.cFileName);
- PUShowMessageT(szMsg, SM_NOTIFY);
- }
- #endif
- }
- else { //pluginINFO == NULL
- pluginInfo = CopyPluginInfo(MirandaPluginInfo(PLUGIN_MAKE_VERSION(9, 9, 9, 9))); //let's see if the plugin likes this miranda version
- char *szShortName = "<unknown>";
- std::tstring time = GetPluginTimestamp(&fd.ftLastWriteTime); //get the plugin timestamp;
- DWORD version = 0;
- if (pluginInfo) {
- szShortName = pluginInfo->shortName;
- version = pluginInfo->version;
- }
+ if (MirandaPluginInfo == NULL || pluginInfo == NULL) {
+ FreeLibrary(hInstPlugin); //We don't need it anymore.
+ continue;
+ }
- CPlugin thePlugin(fd.cFileName, _A2T(szShortName), (pluginInfo) ? pluginInfo->uuid : UUID_NULL, (/*((pluginInfo) && (pluginInfo->flags & 1)) ? _T("Unicode aware") :*/ _T("")), version, time.c_str(), _T(" Plugin refuses to load. Miranda version too old."));
+ //We have loaded the informations into pluginInfo.
+ std::tstring timedate = GetPluginTimestamp(&fd.ftLastWriteTime);
+ CPlugin thePlugin(fd.cFileName, _A2T(pluginInfo->shortName), pluginInfo->uuid, /*(pluginInfo->flags & 1) ? _T("Unicode aware") :*/ _T(""), (DWORD) pluginInfo->version, timedate.c_str(), _T(""));
- AddPlugin(thePlugin, listUnloadablePlugins);
- if (pluginInfo)
- FreePluginInfo(pluginInfo);
- }
+ if (PluginIsEnabled)
+ AddPlugin(thePlugin, listActivePlugins);
+ else {
+ AddPlugin(thePlugin, listInactivePlugins);
+ FreeLibrary(hInstPlugin); //We don't need it anymore.
}
+ FreePluginInfo(pluginInfo);
+ MirandaPluginInfo = NULL;
}
while (FindNextFile(hFind,&fd));
FindClose(hFind);