forked from qt-creator/qt-creator
Rename ActionInterfaces Target to TargetView
Change-Id: I55692f9d773a1466fec5285fdc53149a3a1359f1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
e7a65dd3c9
commit
dd8b73cfd2
@@ -53,7 +53,7 @@ public:
|
||||
LowestPriority = ComponentCoreConstants::priorityLast
|
||||
};
|
||||
|
||||
enum class Target {
|
||||
enum class TargetView {
|
||||
Undefined,
|
||||
ConnectionEditor
|
||||
};
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
virtual int priority() const = 0;
|
||||
virtual Type type() const = 0;
|
||||
virtual void currentContextChanged(const SelectionContext &selectionState) = 0;
|
||||
virtual Target target() const { return Target::Undefined; }
|
||||
virtual TargetView targetView() const { return TargetView::Undefined; }
|
||||
|
||||
};
|
||||
|
||||
|
@@ -1480,11 +1480,11 @@ void DesignerActionManager::addCreatorCommand(Core::Command *command, const QByt
|
||||
addDesignerAction(new CommandAction(command, category, priority, overrideIcon));
|
||||
}
|
||||
|
||||
QList<QSharedPointer<ActionInterface> > DesignerActionManager::actionsForTarget(const ActionInterface::Target &target)
|
||||
QList<QSharedPointer<ActionInterface> > DesignerActionManager::actionsForTargetView(const ActionInterface::TargetView &target)
|
||||
{
|
||||
QList<QSharedPointer<ActionInterface> > out;
|
||||
for (auto interface : m_designerActions)
|
||||
if (interface->target() == target)
|
||||
if (interface->targetView() == target)
|
||||
out << interface;
|
||||
|
||||
return out;
|
||||
|
@@ -107,7 +107,7 @@ public:
|
||||
void addCreatorCommand(Core::Command *command, const QByteArray &category, int priority,
|
||||
const QIcon &overrideIcon = QIcon());
|
||||
|
||||
QList<QSharedPointer<ActionInterface>> actionsForTarget(const ActionInterface::Target &target);
|
||||
QList<QSharedPointer<ActionInterface>> actionsForTargetView(const ActionInterface::TargetView &target);
|
||||
|
||||
QList<ActionInterface* > designerActions() const;
|
||||
|
||||
|
@@ -176,7 +176,10 @@ void ConnectionViewWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
data["ModelNode"] = index.siblingAtColumn(ConnectionModel::TargetModelNodeRow).data();
|
||||
data["Signal"] = index.siblingAtColumn(ConnectionModel::TargetPropertyNameRow).data();
|
||||
DesignerActionManager &designerActionManager = QmlDesignerPlugin::instance()->designerActionManager();
|
||||
for (auto actionInterface : designerActionManager.actionsForTarget(ActionInterface::Target::ConnectionEditor)) {
|
||||
const auto actions = designerActionManager.actionsForTargetView(
|
||||
ActionInterface::TargetView::ConnectionEditor);
|
||||
|
||||
for (auto actionInterface : actions) {
|
||||
auto *action = actionInterface->action();
|
||||
action->setData(data);
|
||||
menu.addAction(action);
|
||||
|
Reference in New Issue
Block a user