diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2015-06-15 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:54 +0300 |
commit | 54490d51d5c6b0d794dcbad2d634d4c95fc25b6c (patch) | |
tree | c3c413656432c0ef87b2841c80e42b55ad17d4e8 /CPP/7zip/UI/FileManager/PanelDrag.cpp | |
parent | 0713a3ab803e57401f18432148b4139e5fe6e5dd (diff) |
15.0515.05
Diffstat (limited to 'CPP/7zip/UI/FileManager/PanelDrag.cpp')
-rw-r--r-- | CPP/7zip/UI/FileManager/PanelDrag.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/CPP/7zip/UI/FileManager/PanelDrag.cpp b/CPP/7zip/UI/FileManager/PanelDrag.cpp index 9434d156..e20ddd63 100644 --- a/CPP/7zip/UI/FileManager/PanelDrag.cpp +++ b/CPP/7zip/UI/FileManager/PanelDrag.cpp @@ -296,9 +296,11 @@ static bool CopyNamesToHGlobal(NMemory::CGlobal &hgDrop, const UStringVector &na void CPanel::OnDrag(LPNMLISTVIEW /* nmListView */) { - CDisableTimerProcessing disableTimerProcessing2(*this); if (!DoesItSupportOperations()) return; + + CDisableTimerProcessing disableTimerProcessing2(*this); + CRecordVector<UInt32> indices; GetOperatedItemIndices(indices); if (indices.Size() == 0) @@ -312,7 +314,7 @@ void CPanel::OnDrag(LPNMLISTVIEW /* nmListView */) bool isFSFolder = IsFSFolder(); if (isFSFolder) - dirPrefix = us2fs(_currentFolderPrefix); + dirPrefix = us2fs(GetFsPath()); else { tempDirectory.Create(kTempDirPrefix); @@ -580,7 +582,9 @@ bool CDropTarget::IsItSameDrive() const return false; if (!IsFsFolderPath()) return false; + UString drive; + if (m_Panel->IsFSFolder()) { drive = m_Panel->GetDriveOrNetworkPrefix(); @@ -594,13 +598,14 @@ bool CDropTarget::IsItSameDrive() const if (m_SourcePaths.Size() == 0) return false; + FOR_VECTOR (i, m_SourcePaths) { - if (MyStringCompareNoCase_N(m_SourcePaths[i], drive, drive.Len()) != 0) + if (!m_SourcePaths[i].IsPrefixedBy_NoCase(drive)) return false; } + return true; - } DWORD CDropTarget::GetEffect(DWORD keyState, POINTL /* pt */, DWORD allowedEffect) @@ -635,13 +640,11 @@ UString CDropTarget::GetTargetPath() const { if (!IsFsFolderPath()) return UString(); - UString path = m_Panel->_currentFolderPrefix; - if (m_Panel->IsFSDrivesFolder()) - path.Empty(); + UString path = m_Panel->GetFsPath(); if (m_SubFolderIndex >= 0 && !m_SubFolderName.IsEmpty()) { path += m_SubFolderName; - path += WCHAR_PATH_SEPARATOR; + path.Add_PathSepar(); } return path; } @@ -728,7 +731,7 @@ STDMETHODIMP CDropTarget::Drop(IDataObject *dataObject, DWORD keyState, UString path = GetTargetPath(); if (m_IsAppTarget && m_Panel) if (m_Panel->IsFSFolder()) - path = m_Panel->_currentFolderPrefix; + path = m_Panel->GetFsPath(); m_Panel->DropObject(dataObject, path); } } @@ -779,7 +782,7 @@ static bool AreThereNamesFromTemp(const UStringVector &fileNames) if (tempPath.IsEmpty()) return false; FOR_VECTOR (i, fileNames) - if (MyStringCompareNoCase_N(fileNames[i], tempPath, tempPath.Len()) == 0) + if (fileNames[i].IsPrefixedBy_NoCase(tempPath)) return true; return false; } |