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
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2009-06-02 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:59 +0300
commit829409452d85cd6dd9dfc9151f109d6e13a2bb1c (patch)
treee0acaea47044d167f35fa197584dee1bde41c329 /CPP/7zip/UI/FileManager/Panel.cpp
parent8874e4fbc9faabdcff719b9b2ac8ebad4f282bbe (diff)
9.04 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/Panel.cpp')
-rwxr-xr-xCPP/7zip/UI/FileManager/Panel.cpp45
1 files changed, 29 insertions, 16 deletions
diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp
index 40192c5f..9255b117 100755
--- a/CPP/7zip/UI/FileManager/Panel.cpp
+++ b/CPP/7zip/UI/FileManager/Panel.cpp
@@ -5,28 +5,30 @@
#include <Windowsx.h>
#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+
#include "Windows/Error.h"
#include "Windows/PropVariant.h"
#include "Windows/Thread.h"
#include "../../PropID.h"
-#include "Panel.h"
-#include "RootFolder.h"
-#include "FSFolder.h"
-#include "FormatUtils.h"
-#include "App.h"
-#include "ExtractCallback.h"
-
#include "resource.h"
-#include "..\GUI\ExtractRes.h"
+#include "../GUI/ExtractRes.h"
+
+#include "../Common/ArchiveName.h"
+#include "../Common/CompressCall.h"
#include "../Agent/IFolderArchive.h"
-#include "../Common/CompressCall.h"
-#include "../Common/ArchiveName.h"
+#include "App.h"
+#include "ExtractCallback.h"
+#include "FSFolder.h"
+#include "FormatUtils.h"
+#include "Panel.h"
+#include "RootFolder.h"
+
using namespace NWindows;
using namespace NControl;
@@ -707,7 +709,7 @@ bool CPanel::IsFSDrivesFolder() const
UString CPanel::GetFsPath() const
{
- if (IsFSDrivesFolder())
+ if (IsFSDrivesFolder() && !IsDeviceDrivesPrefix())
return UString();
return _currentFolderPrefix;
}
@@ -773,7 +775,7 @@ void CPanel::AddToArchive()
{
CRecordVector<UInt32> indices;
GetOperatedItemIndices(indices);
- if (!IsFSFolder())
+ if (!IsFsOrDrivesFolder())
{
MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
return;
@@ -784,14 +786,25 @@ void CPanel::AddToArchive()
return;
}
UStringVector names;
+
+ UString curPrefix = _currentFolderPrefix;
+ UString destCurDirPrefix = _currentFolderPrefix;
+ if (IsFSDrivesFolder())
+ {
+ destCurDirPrefix = L"C:\\";
+ if (!IsDeviceDrivesPrefix())
+ curPrefix.Empty();
+ }
+
for (int i = 0; i < indices.Size(); i++)
{
int index = indices[i];
- names.Add(_currentFolderPrefix + GetItemRelPath(index));
+ names.Add(curPrefix + GetItemRelPath(index));
}
const UString archiveName = CreateArchiveName(
names.Front(), (names.Size() > 1), false);
- HRESULT res = CompressFiles(_currentFolderPrefix, archiveName, L"", names, false, true, false);
+
+ HRESULT res = CompressFiles(destCurDirPrefix, archiveName, L"", names, false, true, false);
if (res != S_OK)
{
if (_currentFolderPrefix.Length() >= MAX_PATH)
@@ -823,7 +836,7 @@ void CPanel::GetFilePaths(const CRecordVector<UInt32> &indices, UStringVector &p
paths.Clear();
break;
}
- paths.Add(_currentFolderPrefix + GetItemRelPath(index));
+ paths.Add(GetItemFullPath(index));
}
if (paths.Size() == 0)
{