File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ bool CContextMenuItem::IsGroup() const
47
47
return !m_groupId.empty ();
48
48
}
49
49
50
+ bool CContextMenuItem::HasParent () const
51
+ {
52
+ return !m_parent.empty ();
53
+ }
54
+
50
55
bool CContextMenuItem::Execute (const std::shared_ptr<CFileItem>& item) const
51
56
{
52
57
if (!item || m_library.empty () || IsGroup ())
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class IContextMenuItem
33
33
virtual bool Execute (const std::shared_ptr<CFileItem>& item) const = 0;
34
34
virtual std::string GetLabel (const CFileItem& item) const = 0;
35
35
virtual bool IsGroup () const { return false ; }
36
+ virtual bool HasParent () const { return false ; }
36
37
};
37
38
38
39
@@ -56,6 +57,7 @@ class CContextMenuItem : public IContextMenuItem
56
57
bool IsVisible (const CFileItem& item) const override ;
57
58
bool IsParentOf (const CContextMenuItem& menuItem) const ;
58
59
bool IsGroup () const override ;
60
+ bool HasParent () const override ;
59
61
bool Execute (const std::shared_ptr<CFileItem>& item) const override ;
60
62
bool operator ==(const CContextMenuItem& other) const ;
61
63
std::string ToString () const ;
Original file line number Diff line number Diff line change @@ -298,6 +298,8 @@ bool CONTEXTMENU::ShowFor(const std::shared_ptr<CFileItem>& fileItem, const CCon
298
298
299
299
CContextButtons buttons;
300
300
// compute fileitem property-based contextmenu items
301
+ // unless we're browsing a child menu item
302
+ if (!root.HasParent ())
301
303
{
302
304
int i = 0 ;
303
305
while (fileItem->HasProperty (StringUtils::Format (" contextmenulabel({})" , i)))
You can’t perform that action at this time.
0 commit comments