Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/CPP/7zip/UI
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2010-06-04 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:16:03 +0300
commit708873490ee36691d84cc06336aac87c5129f8a0 (patch)
treebbe6e5aa922a158e5810c1a2ff7c78927cc6d973 /CPP/7zip/UI
parent3dacb5eb8afda99aad81f4723cb966c0fa91ba1d (diff)
9.149.14
Diffstat (limited to 'CPP/7zip/UI')
-rwxr-xr-xCPP/7zip/UI/Common/PropIDUtils.cpp37
-rwxr-xr-xCPP/7zip/UI/Console/UserInputUtils.cpp1
-rwxr-xr-xCPP/7zip/UI/FileManager/PanelItemOpen.cpp47
-rwxr-xr-xCPP/7zip/UI/GUI/CompressDialog.cpp8
4 files changed, 65 insertions, 28 deletions
diff --git a/CPP/7zip/UI/Common/PropIDUtils.cpp b/CPP/7zip/UI/Common/PropIDUtils.cpp
index d8c0e7d6..daa57ef6 100755
--- a/CPP/7zip/UI/Common/PropIDUtils.cpp
+++ b/CPP/7zip/UI/Common/PropIDUtils.cpp
@@ -24,6 +24,27 @@ void ConvertUInt32ToHex(UInt32 value, wchar_t *s)
s[8] = L'\0';
}
+static const char g_WinAttrib[17] = "RHS8DAdNTsrCOnE_";
+/*
+0 READONLY
+1 HIDDEN
+3 SYSTEM
+
+4 DIRECTORY
+5 ARCHIVE
+6 DEVICE
+7 NORMAL
+8 TEMPORARY
+9 SPARSE_FILE
+10 REPARSE_POINT
+11 COMPRESSED
+12 OFFLINE
+13 NOT_CONTENT_INDEXED
+14 ENCRYPTED
+
+16 VIRTUAL
+*/
+
#define MY_ATTR_CHAR(a, n, c) ((a )& (1 << (n))) ? c : L'-';
UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool full)
@@ -55,16 +76,14 @@ UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool ful
{
if (prop.vt != VT_UI4)
break;
- UString res;
UInt32 a = prop.ulVal;
- if (NFile::NFind::NAttributes::IsReadOnly(a)) res += L'R';
- if (NFile::NFind::NAttributes::IsHidden(a)) res += L'H';
- if (NFile::NFind::NAttributes::IsSystem(a)) res += L'S';
- if (NFile::NFind::NAttributes::IsDir(a)) res += L'D';
- if (NFile::NFind::NAttributes::IsArchived(a)) res += L'A';
- if (NFile::NFind::NAttributes::IsCompressed(a)) res += L'C';
- if (NFile::NFind::NAttributes::IsEncrypted(a)) res += L'E';
- return res;
+ wchar_t sz[32];
+ int pos = 0;
+ for (int i = 0; i < 16; i++)
+ if (a & (1 << i) && i != 7)
+ sz[pos++] = g_WinAttrib[i];
+ sz[pos] = '\0';
+ return sz;
}
case kpidPosixAttrib:
{
diff --git a/CPP/7zip/UI/Console/UserInputUtils.cpp b/CPP/7zip/UI/Console/UserInputUtils.cpp
index 0e55a868..bae33478 100755
--- a/CPP/7zip/UI/Console/UserInputUtils.cpp
+++ b/CPP/7zip/UI/Console/UserInputUtils.cpp
@@ -26,6 +26,7 @@ NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
for (;;)
{
(*outStream) << kHelpQuestionMessage;
+ outStream->Flush();
AString scannedString = g_StdIn.ScanStringUntilNewLine();
scannedString.Trim();
if (!scannedString.IsEmpty())
diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
index 15e01483..12206786 100755
--- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
+++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
@@ -163,40 +163,51 @@ HRESULT CPanel::OpenParentArchiveFolder()
return S_OK;
}
-static const wchar_t *kStartExtensions[] =
-{
+static const char *kStartExtensions =
#ifdef UNDER_CE
- L"cab",
+ " cab"
#endif
- L"exe", L"bat", L"com",
- L"chm",
- L"msi", L"doc", L"xls", L"ppt", L"pps", L"wps", L"wpt", L"wks", L"xlr", L"wdb",
+ " exe bat com"
+ " chm"
+ " msi doc xls ppt pps wps wpt wks xlr wdb"
- L"docx", L"docm", L"dotx", L"dotm", L"xlsx", L"xlsm", L"xltx", L"xltm", L"xlsb",
- L"xlam", L"pptx", L"pptm", L"potx", L"potm", L"ppam", L"ppsx", L"ppsm", L"xsn",
- L"msg",
- L"dwf",
+ " docx docm dotx dotm xlsx xlsm xltx xltm xlsb"
+ " xlam pptx pptm potx potm ppam ppsx ppsm xsn"
+ " mpp"
+ " msg"
+ " dwf"
- L"flv", L"swf",
+ " flv swf"
- L"odt", L"ods",
- L"wb3",
- L"pdf"
-};
+ " odt ods"
+ " wb3"
+ " pdf"
+ " ";
-static bool DoItemAlwaysStart(const UString &name)
+static bool FindExt(const char *p, const UString &name)
{
int extPos = name.ReverseFind('.');
if (extPos < 0)
return false;
UString ext = name.Mid(extPos + 1);
ext.MakeLower();
- for (int i = 0; i < sizeof(kStartExtensions) / sizeof(kStartExtensions[0]); i++)
- if (ext.Compare(kStartExtensions[i]) == 0)
+ AString ext2 = UnicodeStringToMultiByte(ext);
+ for (int i = 0; p[i] != 0;)
+ {
+ int j;
+ for (j = i; p[j] != ' '; j++);
+ if (ext2.Length() == j - i && memcmp(p + i, (const char *)ext2, ext2.Length()) == 0)
return true;
+ i = j + 1;
+ }
return false;
}
+static bool DoItemAlwaysStart(const UString &name)
+{
+ return FindExt(kStartExtensions, name);
+}
+
static UString GetQuotedString(const UString &s)
{
return UString(L'\"') + s + UString(L'\"');
diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp
index 75a1f9ed..25c20c29 100755
--- a/CPP/7zip/UI/GUI/CompressDialog.cpp
+++ b/CPP/7zip/UI/GUI/CompressDialog.cpp
@@ -229,6 +229,12 @@ static const CFormatInfo g_Formats[] =
(1 << 0),
0, 0,
false, false, false, false, false, false
+ },
+ {
+ L"wim",
+ (1 << 0),
+ 0, 0,
+ false, false, false, false, false, false
}
};
@@ -1032,7 +1038,7 @@ void CCompressDialog::SetDictionary()
if (i == 20 && j > 0)
continue;
UInt32 dictionary = (1 << i) + (j << (i - 1));
- if (dictionary >= (1 << 31))
+ if (dictionary > (1 << 30))
continue;
AddDictionarySize(dictionary);
UInt64 decomprSize;