mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
23.01
This commit is contained in:
@@ -8,28 +8,37 @@
|
||||
#include "PluginLoader.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
int CExtDatabase::FindExt(const UString &ext)
|
||||
int CExtDatabase::FindExt(const UString &ext) const
|
||||
{
|
||||
FOR_VECTOR (i, Exts)
|
||||
if (Exts[i].Ext.IsEqualTo_NoCase(ext))
|
||||
return i;
|
||||
return (int)i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CExtDatabase::Read()
|
||||
{
|
||||
/*
|
||||
ReadFileFolderPluginInfoList(Plugins);
|
||||
FOR_VECTOR (pluginIndex, Plugins)
|
||||
*/
|
||||
{
|
||||
const CPluginInfo &plugin = Plugins[pluginIndex];
|
||||
// const CPluginInfo &plugin = Plugins[pluginIndex];
|
||||
|
||||
CPluginLibrary pluginLib;
|
||||
CMyComPtr<IFolderManager> folderManager;
|
||||
|
||||
if (plugin.FilePath.IsEmpty())
|
||||
// if (plugin.FilePath.IsEmpty())
|
||||
folderManager = new CArchiveFolderManager;
|
||||
else if (pluginLib.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &folderManager) != S_OK)
|
||||
continue;
|
||||
/*
|
||||
else
|
||||
{
|
||||
if (!plugin.ClassID_Defined)
|
||||
continue;
|
||||
if (pluginLib.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &folderManager) != S_OK)
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
CMyComBSTR extBSTR;
|
||||
if (folderManager->GetExtensions(&extBSTR) != S_OK)
|
||||
return;
|
||||
@@ -46,15 +55,15 @@ void CExtDatabase::Read()
|
||||
Int32 iconIndex;
|
||||
CMyComBSTR iconPath;
|
||||
CPluginToIcon plugPair;
|
||||
plugPair.PluginIndex = pluginIndex;
|
||||
// plugPair.PluginIndex = pluginIndex;
|
||||
if (folderManager->GetIconPath(ext, &iconPath, &iconIndex) == S_OK)
|
||||
if (iconPath != 0)
|
||||
if (iconPath)
|
||||
{
|
||||
plugPair.IconPath = (const wchar_t *)iconPath;
|
||||
plugPair.IconIndex = iconIndex;
|
||||
}
|
||||
|
||||
int index = FindExt(ext);
|
||||
const int index = FindExt(ext);
|
||||
if (index >= 0)
|
||||
Exts[index].Plugins.Add(plugPair);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user