Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Jan 21, 2025
1 parent 4fcfe19 commit 46961e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions Src/DirActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,6 @@ DIFFITEM *FindItemFromPaths(const CDiffContext& ctxt, const PathContext& paths)
return 0;
}

/// is it possible to copy item to left ?
bool IsItemCopyable(const DIFFITEM &di, int index)
{
// don't let them mess with error items
if (di.diffcode.isResultError()) return false;
// can't copy same items
if (di.diffcode.isResultSame()) return false;
// impossible if not existing
if (!di.diffcode.exists(index)) return false;
// everything else can be copied to other side
return true;
}

bool IsItemCopyable(const DIFFITEM &di, int index, bool copyOnlyDiffItems)
{
if (copyOnlyDiffItems)
Expand Down
3 changes: 1 addition & 2 deletions Src/DirActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ UPDATEITEM_TYPE UpdateDiffAfterOperation(const FileActionItem & act, CDiffContex

DIFFITEM *FindItemFromPaths(const CDiffContext& ctxt, const PathContext& paths);

bool IsItemCopyable(const DIFFITEM &di, int index);
bool IsItemCopyable(const DIFFITEM &di, int index, bool copyOnlyDiffItems);
bool IsItemMovable(const DIFFITEM &di, int index);
bool IsItemDeletable(const DIFFITEM &di, int index);
Expand Down Expand Up @@ -233,7 +232,7 @@ struct DirActions
template <SIDE_TYPE src, SIDE_TYPE dst>
bool IsItemCopyableOnTo(const DIFFITEM& di) const
{
return (di.diffcode.diffcode != 0 && !m_RO[SideToIndex(m_ctxt, dst)] && ::IsItemCopyable(di, SideToIndex(m_ctxt, src)));
return (di.diffcode.diffcode != 0 && !m_RO[SideToIndex(m_ctxt, dst)] && ::IsItemCopyable(di, SideToIndex(m_ctxt, src), false));
}

template <SIDE_TYPE src>
Expand Down

0 comments on commit 46961e5

Please sign in to comment.