mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 20:06:59 -06:00
9.06 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
829409452d
commit
c99f3ebdd6
@@ -206,8 +206,8 @@ public:
|
||||
#endif
|
||||
|
||||
const CArc &GetArc() { return _archiveLink.Arcs.Back(); }
|
||||
IInArchive *GetArchive() { return GetArc().Archive; }
|
||||
bool CanUpdate() const { return _archiveLink.Arcs.Size() == 1; }
|
||||
IInArchive *GetArchive() { if ( _archiveLink.Arcs.IsEmpty()) return 0; return GetArc().Archive; }
|
||||
bool CanUpdate() const { return _archiveLink.Arcs.Size() <= 1; }
|
||||
};
|
||||
|
||||
#ifdef NEW_FOLDER_INTERFACE
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "Common/IntToString.h"
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#include "Windows/Defs.h"
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/PropVariant.h"
|
||||
#include "Windows/PropVariantConversions.h"
|
||||
@@ -16,7 +15,6 @@
|
||||
#include "../../Common/FileStreams.h"
|
||||
|
||||
#include "../Common/EnumDirItems.h"
|
||||
#include "../Common/HandlerLoader.h"
|
||||
#include "../Common/OpenArchive.h"
|
||||
#include "../Common/UpdateCallback.h"
|
||||
#include "../Common/UpdatePair.h"
|
||||
@@ -208,7 +206,7 @@ STDMETHODIMP CAgent::DoOperation(
|
||||
if (GetArchive())
|
||||
{
|
||||
RINOK(ReadItems());
|
||||
EnumerateArchiveItems(this, _proxyArchive->RootFolder, L"", arcItems);
|
||||
EnumerateArchiveItems(this, _proxyArchive->RootFolder, L"", arcItems);
|
||||
}
|
||||
|
||||
CRecordVector<CUpdatePair2> updatePairs2;
|
||||
|
||||
@@ -6,8 +6,16 @@
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
extern HINSTANCE g_hInstance;
|
||||
|
||||
static inline UINT GetCurrentFileCodePage()
|
||||
{ return AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
|
||||
{
|
||||
#ifdef UNDER_CE
|
||||
return CP_ACP;
|
||||
#else
|
||||
return AreFileApisANSI() ? CP_ACP : CP_OEMCP;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CArchiveFolderManager::LoadFormats()
|
||||
{
|
||||
@@ -61,21 +69,25 @@ STDMETHODIMP CArchiveFolderManager::GetExtensions(const wchar_t *type, BSTR *ext
|
||||
return StringToBstr(_codecs.Formats[formatIndex].GetAllExtensions(), extensions);
|
||||
}
|
||||
*/
|
||||
|
||||
static void AddIconExt(const CCodecIcons &lib, UString &dest)
|
||||
{
|
||||
for (int j = 0; j < lib.IconPairs.Size(); j++)
|
||||
{
|
||||
if (!dest.IsEmpty())
|
||||
dest += L' ';
|
||||
dest += lib.IconPairs[j].Ext;
|
||||
}
|
||||
}
|
||||
|
||||
STDMETHODIMP CArchiveFolderManager::GetExtensions(BSTR *extensions)
|
||||
{
|
||||
LoadFormats();
|
||||
*extensions = 0;
|
||||
UString res;
|
||||
for (int i = 0; i < _codecs->Libs.Size(); i++)
|
||||
{
|
||||
const CCodecLib &lib = _codecs->Libs[i];
|
||||
for (int j = 0; j < lib.IconPairs.Size(); j++)
|
||||
{
|
||||
if (!res.IsEmpty())
|
||||
res += L' ';
|
||||
res += lib.IconPairs[j].Ext;
|
||||
}
|
||||
}
|
||||
AddIconExt(_codecs->Libs[i], res);
|
||||
AddIconExt(_codecs->InternalIcons, res);
|
||||
return StringToBstr(res, extensions);
|
||||
}
|
||||
|
||||
@@ -87,13 +99,21 @@ STDMETHODIMP CArchiveFolderManager::GetIconPath(const wchar_t *ext, BSTR *iconPa
|
||||
for (int i = 0; i < _codecs->Libs.Size(); i++)
|
||||
{
|
||||
const CCodecLib &lib = _codecs->Libs[i];
|
||||
int ii = lib.FindIconIndex(ext);
|
||||
if (ii >= 0)
|
||||
int ii;
|
||||
if (lib.FindIconIndex(ext, ii))
|
||||
{
|
||||
*iconIndex = ii;
|
||||
return StringToBstr(GetUnicodeString(lib.Path, GetCurrentFileCodePage()), iconPath);
|
||||
}
|
||||
}
|
||||
int ii;
|
||||
if (_codecs->InternalIcons.FindIconIndex(ext, ii))
|
||||
{
|
||||
*iconIndex = ii;
|
||||
UString path;
|
||||
NWindows::NDLL::MyGetModuleFileName(g_hInstance, path);
|
||||
return StringToBstr(path, iconPath);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ HRESULT CAgentFolder::CommonUpdateOperation(
|
||||
IFolderArchiveUpdateCallback *updateCallback100)
|
||||
{
|
||||
NWorkDir::CInfo workDirInfo;
|
||||
ReadWorkDirInfo(workDirInfo);
|
||||
workDirInfo.Load();
|
||||
UString archiveFilePath = _agentSpec->_archiveFilePath;
|
||||
UString workDir = GetWorkDir(workDirInfo, archiveFilePath);
|
||||
CreateComplexDirectory(workDir);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../Common/ExtractMode.h"
|
||||
#include "../Common/IFileExtractCallback.h"
|
||||
|
||||
#define FOLDER_ARCHIVE_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 0x01, x)
|
||||
#define FOLDER_ARCHIVE_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 0x01, x)
|
||||
#define FOLDER_ARCHIVE_INTERFACE(i, x) FOLDER_ARCHIVE_INTERFACE_SUB(i, IUnknown, x)
|
||||
|
||||
#define INTERFACE_IArchiveFolder(x) \
|
||||
|
||||
Reference in New Issue
Block a user