From cd4e43a5af4dcf660969bc5abada0d97cfd0cd03 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Jan 2014 15:57:14 +0000 Subject: version related code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7478 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/VersionInfo/src/CVersionInfo.cpp | 55 ++++++++------------------------ 1 file changed, 14 insertions(+), 41 deletions(-) (limited to 'plugins/VersionInfo/src/CVersionInfo.cpp') 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 = ""; - 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); -- cgit v1.2.3