@@ -98,8 +98,6 @@ struct PendingPaste { |
| 98 | dest_dir: PathBuf, | 98 | dest_dir: PathBuf, |
| 99 | /// Files that conflict (exist in destination). | 99 | /// Files that conflict (exist in destination). |
| 100 | conflicts: Vec<PathBuf>, | 100 | conflicts: Vec<PathBuf>, |
| 101 | - /// Current conflict index being resolved. | | |
| 102 | - current_conflict: usize, | | |
| 103 | } | 101 | } |
| 104 | | 102 | |
| 105 | impl App { | 103 | impl App { |
@@ -1353,7 +1351,6 @@ impl App { |
| 1353 | operation: op, | 1351 | operation: op, |
| 1354 | dest_dir, | 1352 | dest_dir, |
| 1355 | conflicts, | 1353 | conflicts, |
| 1356 | - current_conflict: 0, | | |
| 1357 | }); | 1354 | }); |
| 1358 | return; | 1355 | return; |
| 1359 | } | 1356 | } |
@@ -1598,24 +1595,8 @@ impl App { |
| 1598 | // Perform the copy/move with the unique name | 1595 | // Perform the copy/move with the unique name |
| 1599 | let result = match pending.operation { | 1596 | let result = match pending.operation { |
| 1600 | ClipboardOperation::Copy => { | 1597 | ClipboardOperation::Copy => { |
| 1601 | - if conflict_file.is_dir() { | 1598 | + // Copy directly to the unique destination path |
| 1602 | - // For directories, copy then rename to unique name | 1599 | + garfield::core::copy_to_path(&conflict_file, &final_dest) |
| 1603 | - match garfield::core::copy_path(&conflict_file, &pending.dest_dir) { | | |
| 1604 | - Ok(copied_path) => { | | |
| 1605 | - // Rename to unique name if different | | |
| 1606 | - if copied_path != final_dest { | | |
| 1607 | - std::fs::rename(&copied_path, &final_dest) | | |
| 1608 | - .map(|_| final_dest.clone()) | | |
| 1609 | - .or(Ok(copied_path)) | | |
| 1610 | - } else { | | |
| 1611 | - Ok(copied_path) | | |
| 1612 | - } | | |
| 1613 | - } | | |
| 1614 | - Err(e) => Err(e), | | |
| 1615 | - } | | |
| 1616 | - } else { | | |
| 1617 | - std::fs::copy(&conflict_file, &final_dest).map(|_| final_dest.clone()) | | |
| 1618 | - } | | |
| 1619 | } | 1600 | } |
| 1620 | ClipboardOperation::Cut => { | 1601 | ClipboardOperation::Cut => { |
| 1621 | std::fs::rename(&conflict_file, &final_dest).map(|_| final_dest.clone()) | 1602 | std::fs::rename(&conflict_file, &final_dest).map(|_| final_dest.clone()) |