MCPcopy Create free account
hub / github.com/KDE/kdevelop / findActionInsertionPoint

Function findActionInsertionPoint

kdevplatform/sublime/container.cpp:74–84  ·  view source on GitHub ↗

* Find a suitable insertion point in a list of actions. * * @param actions a list of actions ordered by title of their associated document case-insensitively. * @param actionDocumentTitle the title of the document associated with the action to be inserted. */

Source from the content-addressed store, hash-verified

72 * @param actionDocumentTitle the title of the document associated with the action to be inserted.
73 */
74ActionInsertionPoint findActionInsertionPoint(const QList<QAction*>& actions, const QString& actionDocumentTitle)
75{
76 const auto it = std::lower_bound(
77 actions.cbegin(), actions.cend(), actionDocumentTitle, [](const QAction* lhs, const QString& rhs) {
78 return lhs->data().value<Sublime::View*>()->document()->title().compare(rhs, Qt::CaseInsensitive) < 0;
79 });
80 ActionInsertionPoint ret;
81 ret.next = it == actions.cend() ? nullptr : *it;
82 ret.previous = it == actions.cbegin() ? nullptr : *(it - 1);
83 return ret;
84}
85
86} // namespace
87

Callers 1

Calls 4

compareMethod · 0.45
titleMethod · 0.45
documentMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected