diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-12-03 05:42:39 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-12-03 05:42:39 +0000 |
commit | c85beefd3a445d56a59c3b38426cec3986746446 (patch) | |
tree | 31184c91554a7ea2c99fd5db7f76bbc301348420 /updater/scan.cpp | |
parent | 738d3aedb9eca3f49e96f096dcc7a5f55a83e371 (diff) |
Fixed Updates in some cases
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@579 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'updater/scan.cpp')
-rw-r--r-- | updater/scan.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/updater/scan.cpp b/updater/scan.cpp index fc5db50..395b3a7 100644 --- a/updater/scan.cpp +++ b/updater/scan.cpp @@ -15,23 +15,34 @@ static const AlternateShortName alternate_shortname_map[] = { "Version Informations", "Version Information" },
{ "Jabber Protocol", "JabberG Protocol" },
{ "Jabber Protocol (Unicode)", "JabberG Protocol (Unicode)" },
- //{ "PopUp Interoperability", "PopUp Plus" }, - disabled since popup plus archive structure is incompatible
+#ifdef _UNICODE
+ { "PopUp Interoperability", "PopUp Plus (Unicode)" },
+#else
+ { "PopUp Interoperability", "PopUp Plus" },
+#endif
//{ "Messaging Style Conversation", "nConvers++" }, // will this conflict with other nConvers'?
{ "MimQQ-libeva", "MirandaQQ (libeva Version)" },
- { "Icons Library Manager (Unicode)", "Icons library manager" },
// grr
{ "Updater", __PLUGIN_NAME },
{ "Updater (Unicode)", __PLUGIN_NAME },
};
-const char* findAlternateShortName(const char* name)
+char* findAlternateShortName(const char* name)
{
for (int i = 0; i < SIZEOF(alternate_shortname_map); ++i)
{
if (strcmp(name, alternate_shortname_map[i].from) == 0)
- return alternate_shortname_map[i].to;
+ return mir_strdup(alternate_shortname_map[i].to);
}
+#ifdef _UNICODE
+ if (!strstr(name, "Unicode"))
+ {
+ char *buf = (char*)mir_alloc(256);
+ mir_snprintf(buf, 256, "%s (Unicode)", name);
+ return buf;
+ }
+#endif
return NULL;
}
@@ -98,7 +109,8 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) DBWriteContactSettingByte(0, "PluginDisable", lowname, 0);
mir_free(lowname);
- const char* alternateName = findAlternateShortName(pluginInfo->shortName);
+ bool found = false;
+ char* alternateName = findAlternateShortName(pluginInfo->shortName);
if (alternateName)
{
int file_id = FindFileID(alternateName, MC_PLUGINS, update_list);
@@ -114,10 +126,13 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) fn_map->insert(fns);
}
fns->list.insert(mir_tstrdup(findData.cFileName));
+ found = true;
}
}
+ mir_free(alternateName);
}
- else
+
+ if (!found)
{
int file_id = FindFileID(pluginInfo->shortName, MC_PLUGINS, update_list);
if (file_id != -1)
@@ -259,10 +274,15 @@ bool RearrangeDllsWorker(char *shortName, StrList &filenames, TCHAR *basedir) dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
if((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
{
- const char* alternateName = findAlternateShortName(pluginInfo->shortName);
- if (alternateName == NULL) alternateName = pluginInfo->shortName;
+ bool found = !_stricmp(pluginInfo->shortName, shortName);
+ if (!found)
+ {
+ char* alternateName = findAlternateShortName(pluginInfo->shortName);
+ found = alternateName && !_stricmp(alternateName, shortName);
+ mir_free(alternateName);
+ }
- if (_stricmp(alternateName, shortName) == 0)
+ if (found)
{
bool moved = false;
TCHAR* newname = NULL;
|