mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:07:02 +08:00
refs #912, utility function for hotkey list
This commit is contained in:
committed by
Mathew Sutcliffe
parent
08f6f3f81c
commit
9921cc3497
@@ -20,7 +20,7 @@ namespace BlackMisc
|
||||
CSequence<CActionHotkey>(baseClass)
|
||||
{ }
|
||||
|
||||
CActionHotkeyList CActionHotkeyList::findSubsetsOf(const CActionHotkey &other)
|
||||
CActionHotkeyList CActionHotkeyList::findSubsetsOf(const CActionHotkey &other) const
|
||||
{
|
||||
CActionHotkeyList subsets;
|
||||
for (const auto &actionHotkey : *this)
|
||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
||||
return subsets;
|
||||
}
|
||||
|
||||
CActionHotkeyList CActionHotkeyList::findSupersetsOf(const CActionHotkey &other)
|
||||
CActionHotkeyList CActionHotkeyList::findSupersetsOf(const CActionHotkey &other) const
|
||||
{
|
||||
CActionHotkeyList supersets;
|
||||
for (const auto &actionHotkey : *this)
|
||||
@@ -45,5 +45,10 @@ namespace BlackMisc
|
||||
}
|
||||
return supersets;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CActionHotkeyList::containsAction(const QString &action) const
|
||||
{
|
||||
return this->contains(&CActionHotkey::getAction, action);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -47,16 +47,18 @@ namespace BlackMisc
|
||||
//! Returns true if this list has a action hotkey with a combination which is a subset of other
|
||||
//! Example:
|
||||
//! List contains CTRL and other has combination CTRL-F
|
||||
CActionHotkeyList findSubsetsOf(const CActionHotkey &other);
|
||||
CActionHotkeyList findSubsetsOf(const CActionHotkey &other) const;
|
||||
|
||||
//! Returns true if this list has a hotkey with a combination for which other is a subset
|
||||
//! Example:
|
||||
//! List contains CTRL-F and other has combination CTRL
|
||||
CActionHotkeyList findSupersetsOf(const CActionHotkey &other);
|
||||
};
|
||||
CActionHotkeyList findSupersetsOf(const CActionHotkey &other) const;
|
||||
|
||||
}
|
||||
} // namespace
|
||||
//! Contains action
|
||||
bool containsAction(const QString &action) const;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Input::CActionHotkeyList)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::Input::CActionHotkey>)
|
||||
|
||||
Reference in New Issue
Block a user