diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2010-11-02 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:04 +0300 |
commit | c65230d8585317f7cd58ae2982067385269fdee9 (patch) | |
tree | 436513094ff5034da4c88def9609f0ea376065c6 /CPP/7zip/UI/FileManager | |
parent | 2eb60a059819da595efb8e1de49f04c241f5b981 (diff) |
9.189.18
Diffstat (limited to 'CPP/7zip/UI/FileManager')
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelItemOpen.cpp | 41 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelMenu.cpp | 17 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelSort.cpp | 18 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgramLocation.cpp | 3 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyName.cpp | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyName.rc | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyNameRes.h | 1 |
7 files changed, 66 insertions, 16 deletions
diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 29c99bfd..6b8fdba2 100755 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -9,6 +9,7 @@ #include "Windows/FileDir.h" #include "Windows/FileFind.h" #include "Windows/Process.h" +#include "Windows/PropVariant.h" #include "Windows/Thread.h" #include "../Common/ExtractingFilePath.h" @@ -113,6 +114,46 @@ HRESULT CPanel::OpenItemAsArchive(IInStream *inStream, _flatMode = _flatModeForArc; + CMyComPtr<IGetFolderArcProps> getFolderArcProps; + _folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps); + if (getFolderArcProps) + { + CMyComPtr<IFolderArcProps> arcProps; + getFolderArcProps->GetFolderArcProps(&arcProps); + if (arcProps) + { + UString s; + UInt32 numLevels; + if (arcProps->GetArcNumLevels(&numLevels) != S_OK) + numLevels = 0; + for (UInt32 level2 = 0; level2 < numLevels; level2++) + { + UInt32 level = numLevels - 1 - level2; + PROPID propIDs[] = { kpidError, kpidPath, kpidType } ; + UString values[3]; + for (Int32 i = 0; i < 3; i++) + { + CMyComBSTR name; + NCOM::CPropVariant prop; + if (arcProps->GetArcProp(level, propIDs[i], &prop) != S_OK) + continue; + if (prop.vt != VT_EMPTY) + values[i] = (prop.vt == VT_BSTR) ? prop.bstrVal : L"?"; + } + if (!values[0].IsEmpty()) + { + if (!s.IsEmpty()) + s += L"--------------------\n"; + s += values[0]; s += L"\n\n["; + s += values[2]; s += L"] "; + s += values[1]; s += L"\n"; + } + } + if (!s.IsEmpty()) + MessageBox(s); + } + } + return S_OK; } diff --git a/CPP/7zip/UI/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index c60751b5..549b28da 100755 --- a/CPP/7zip/UI/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -188,17 +188,20 @@ void CPanel::Properties() if (getProps->GetArcNumProps(level, &numProps) == S_OK) { message += kSeparator; - for (Int32 i = -2; i < (Int32)numProps; i++) + for (Int32 i = -3; i < (Int32)numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; - if (i == -2) - propID = kpidPath; - else if (i == -1) - propID = kpidType; - else if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) - continue; + switch (i) + { + case -3: propID = kpidPath; break; + case -2: propID = kpidType; break; + case -1: propID = kpidError; break; + default: + if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) + continue; + } NCOM::CPropVariant prop; if (getProps->GetArcProp(level, propID, &prop) != S_OK) continue; diff --git a/CPP/7zip/UI/FileManager/PanelSort.cpp b/CPP/7zip/UI/FileManager/PanelSort.cpp index 7eabc9ef..186315b3 100755 --- a/CPP/7zip/UI/FileManager/PanelSort.cpp +++ b/CPP/7zip/UI/FileManager/PanelSort.cpp @@ -61,17 +61,19 @@ int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) // PROPID propID = panel->_properties[panel->_sortIndex].ID; PROPID propID = panel->_sortID; - NCOM::CPropVariant propVariant1, propVariant2; + NCOM::CPropVariant prop1, prop2; // Name must be first property - panel->_folder->GetProperty((UINT32)lParam1, propID, &propVariant1); - panel->_folder->GetProperty((UINT32)lParam2, propID, &propVariant2); - if (propVariant1.vt != propVariant2.vt) - return 0; // It means some BUG - if (propVariant1.vt == VT_BSTR) + panel->_folder->GetProperty((UINT32)lParam1, propID, &prop1); + panel->_folder->GetProperty((UINT32)lParam2, propID, &prop2); + if (prop1.vt != prop2.vt) { - return _wcsicmp(propVariant1.bstrVal, propVariant2.bstrVal); + return MyCompare(prop1.vt, prop2.vt); } - return propVariant1.Compare(propVariant2); + if (prop1.vt == VT_BSTR) + { + return _wcsicmp(prop1.bstrVal, prop2.bstrVal); + } + return prop1.Compare(prop2); // return 0; } diff --git a/CPP/7zip/UI/FileManager/ProgramLocation.cpp b/CPP/7zip/UI/FileManager/ProgramLocation.cpp index 04c2c98c..ce2d178e 100755 --- a/CPP/7zip/UI/FileManager/ProgramLocation.cpp +++ b/CPP/7zip/UI/FileManager/ProgramLocation.cpp @@ -2,6 +2,8 @@ #include "StdAfx.h" +#include "../../../../C/Types.h" + #include "ProgramLocation.h" #include "Windows/DLL.h" @@ -20,4 +22,3 @@ bool GetProgramFolderPath(UString &folder) folder = folder.Left(pos + 1); return true; } - diff --git a/CPP/7zip/UI/FileManager/PropertyName.cpp b/CPP/7zip/UI/FileManager/PropertyName.cpp index 79b09300..098bc47d 100755 --- a/CPP/7zip/UI/FileManager/PropertyName.cpp +++ b/CPP/7zip/UI/FileManager/PropertyName.cpp @@ -75,6 +75,7 @@ static CPropertyIDNamePair kPropertyIDNamePairs[] = { kpidSectorSize, IDS_PROP_SECTOR_SIZE, 0x02000234 }, { kpidPosixAttrib, IDS_PROP_POSIX_ATTRIB, 0x02000235 }, { kpidLink, IDS_PROP_LINK, 0x02000236 }, + { kpidError, IDS_PROP_ERROR, 0x02000605 }, { kpidTotalSize, IDS_PROP_TOTAL_SIZE, 0x03031100 }, { kpidFreeSpace, IDS_PROP_FREE_SPACE, 0x03031101 }, diff --git a/CPP/7zip/UI/FileManager/PropertyName.rc b/CPP/7zip/UI/FileManager/PropertyName.rc index 576b52cb..bdd6c8ed 100755 --- a/CPP/7zip/UI/FileManager/PropertyName.rc +++ b/CPP/7zip/UI/FileManager/PropertyName.rc @@ -56,4 +56,5 @@ BEGIN IDS_PROP_SECTOR_SIZE "Sector Size" IDS_PROP_POSIX_ATTRIB "Mode" IDS_PROP_LINK "Link" + IDS_PROP_ERROR "Error" END diff --git a/CPP/7zip/UI/FileManager/PropertyNameRes.h b/CPP/7zip/UI/FileManager/PropertyNameRes.h index 00458a24..9cc9f7c5 100755 --- a/CPP/7zip/UI/FileManager/PropertyNameRes.h +++ b/CPP/7zip/UI/FileManager/PropertyNameRes.h @@ -50,3 +50,4 @@ #define IDS_PROP_SECTOR_SIZE 52 #define IDS_PROP_POSIX_ATTRIB 53 #define IDS_PROP_LINK 54 +#define IDS_PROP_ERROR 55 |