OSDN Git Service

DirView: even if tree mode is enabled and a folder item is selected, enable Compare...
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 14 May 2016 03:54:36 +0000 (12:54 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 14 May 2016 03:54:36 +0000 (12:54 +0900)
Src/DirActions.cpp
Src/DirActions.h
Src/DirView.cpp

index 7cf10d5..b559717 100644 (file)
@@ -373,28 +373,6 @@ bool IsItemDeletableOnBoth(const CDiffContext& ctxt, const DIFFITEM & di)
        return true;
 }
 
-/**
- * @brief Determine if item can be opened.
- * Basically we only disable opening unique files at the moment.
- * Unique folders can be opened since we ask for creating matching folder
- * to another side.
- * @param [in] di DIFFITEM for item to check.
- * @return true if the item can be opened, false otherwise.
- */
-bool IsItemOpenable(const CDiffContext& ctxt, const DIFFITEM & di, bool treemode)
-{
-       if (treemode && ctxt.m_bRecursive)
-       {
-               if (di.diffcode.isDirectory() || !IsItemExistAll(ctxt, di))
-                       return false;
-       }
-       else 
-       {
-               if (!di.diffcode.isDirectory() && !IsItemExistAll(ctxt, di))
-                       return false;
-       }
-       return true;
-}
 /// is it possible to compare these two items?
 bool AreItemsOpenable(const CDiffContext& ctxt, SELECTIONTYPE selectionType, const DIFFITEM & di1, const DIFFITEM & di2)
 {
index 128ff83..c012879 100644 (file)
@@ -140,7 +140,6 @@ uintptr_t FindItemFromPaths(const CDiffContext& ctxt, const String& pathLeft, co
 bool IsItemCopyable(const DIFFITEM & di, int index);
 bool IsItemDeletable(const DIFFITEM & di, int index);
 bool IsItemDeletableOnBoth(const CDiffContext& ctxt, const DIFFITEM & di);
-bool IsItemOpenable(const CDiffContext& ctxt, const DIFFITEM & di, bool treemode);
 bool AreItemsOpenable(const CDiffContext& ctxt, SELECTIONTYPE selectionType, const DIFFITEM & di1, const DIFFITEM & di2);
 bool AreItemsOpenable(const CDiffContext& ctxt, const DIFFITEM & di1, const DIFFITEM & di2, const DIFFITEM & di3);
 bool IsItemOpenableOn(const DIFFITEM & di, int index);
index 699c852..bb9e6e3 100644 (file)
@@ -1726,7 +1726,7 @@ void CDirView::DoUpdateOpen(SELECTIONTYPE selectionType, CCmdUI* pCmdUI)
        {
                // One item selected
                const DIFFITEM& di = GetDiffItem(sel1);
-               if (selectionType != SELECTIONTYPE_NORMAL || !::IsItemOpenable(GetDiffContext(), di, m_bTreeMode))
+               if (selectionType != SELECTIONTYPE_NORMAL)
                {
                        pCmdUI->Enable(FALSE);
                        return;