Commit b8de65dd authored by Christoph Roick's avatar Christoph Roick Committed by Kevin Funk

Amend 5c95479c to fix crash when pasting files in projectmanager

- pasting more than one file in a folder lead to a crash
- use back() instead of rbegin() to
  conserve Qt 5.5 compatability

(cherry picked from commit f3229baa)
parent 98dc5bee
......@@ -170,9 +170,9 @@ SourceToDestinationMap mapSourceToDestination(const Path::List& sourcePaths, con
SourceToDestinationMap result;
for (const Path& path : sortedPaths) {
if (!result.filteredPaths.isEmpty() && std::reverse_iterator<Path::List::const_iterator>(result.filteredPaths.constBegin())->isParentOf(path)) {
if (!result.filteredPaths.isEmpty() && result.filteredPaths.back().isParentOf(path)) {
// think: "/tests"
const Path& previousPath = *std::reverse_iterator<Path::List::const_iterator>(result.filteredPaths.constBegin());
const Path& previousPath = result.filteredPaths.back();
// think: "/dest" + "/".relativePath("/tests/abc.cpp") = /dest/tests/abc.cpp
result.finalPaths[previousPath].append(Path(destinationPath, previousPath.parent().relativePath(path)));
} else {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment