forked from qt-creator/qt-creator
QmlDesigner: Rename DefaultDesignerAction to AbstractAction
We are already in the QmlDesigner namespace and default gives no real information about the class. Change-Id: Ia45c93c778d207c5237d52f5bd2bef6ee6559bb5 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -28,32 +28,32 @@
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "defaultdesigneraction.h"
|
||||
#include "abstractaction.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
DefaultDesignerAction::DefaultDesignerAction(const QString &description)
|
||||
AbstractAction::AbstractAction(const QString &description)
|
||||
: m_defaultAction(new DefaultAction(description))
|
||||
{
|
||||
}
|
||||
|
||||
DefaultDesignerAction::DefaultDesignerAction(DefaultAction *action)
|
||||
AbstractAction::AbstractAction(DefaultAction *action)
|
||||
: m_defaultAction(action)
|
||||
{
|
||||
}
|
||||
|
||||
QAction *DefaultDesignerAction::action() const
|
||||
QAction *AbstractAction::action() const
|
||||
{
|
||||
return m_defaultAction.data();
|
||||
}
|
||||
|
||||
void DefaultDesignerAction::currentContextChanged(const SelectionContext &selectionContext)
|
||||
void AbstractAction::currentContextChanged(const SelectionContext &selectionContext)
|
||||
{
|
||||
m_selectionContext = selectionContext;
|
||||
updateContext();
|
||||
}
|
||||
|
||||
void DefaultDesignerAction::updateContext()
|
||||
void AbstractAction::updateContext()
|
||||
{
|
||||
m_defaultAction->setSelectionContext(m_selectionContext);
|
||||
if (m_selectionContext.isValid()) {
|
||||
@@ -62,12 +62,12 @@ void DefaultDesignerAction::updateContext()
|
||||
}
|
||||
}
|
||||
|
||||
DefaultAction *DefaultDesignerAction::defaultAction() const
|
||||
DefaultAction *AbstractAction::defaultAction() const
|
||||
{
|
||||
return m_defaultAction.data();
|
||||
}
|
||||
|
||||
SelectionContext DefaultDesignerAction::selectionContext() const
|
||||
SelectionContext AbstractAction::selectionContext() const
|
||||
{
|
||||
return m_selectionContext;
|
||||
}
|
@@ -56,11 +56,11 @@ protected:
|
||||
SelectionContext m_selectionContext;
|
||||
};
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT DefaultDesignerAction : public ActionInterface
|
||||
class QMLDESIGNERCORE_EXPORT AbstractAction : public ActionInterface
|
||||
{
|
||||
public:
|
||||
DefaultDesignerAction(const QString &description = QString());
|
||||
DefaultDesignerAction(DefaultAction *action);
|
||||
AbstractAction(const QString &description = QString());
|
||||
AbstractAction(DefaultAction *action);
|
||||
|
||||
QAction *action() const;
|
||||
DefaultAction *defaultAction() const;
|
@@ -3,7 +3,7 @@ VPATH += $$PWD
|
||||
SOURCES += modelnodecontextmenu.cpp
|
||||
SOURCES += abstractactiongroup.cpp
|
||||
SOURCES += designeractionmanagerview.cpp
|
||||
SOURCES += defaultdesigneraction.cpp
|
||||
SOURCES += abstractaction.cpp
|
||||
SOURCES += modelnodecontextmenu_helper.cpp
|
||||
SOURCES += selectioncontext.cpp
|
||||
SOURCES += designeractionmanager.cpp
|
||||
@@ -13,7 +13,7 @@ SOURCES += crumblebar.cpp
|
||||
HEADERS += modelnodecontextmenu.h
|
||||
HEADERS += abstractactiongroup.h
|
||||
HEADERS += designeractionmanagerview.h
|
||||
HEADERS += defaultdesigneraction.h
|
||||
HEADERS += abstractaction.h
|
||||
HEADERS += modelnodecontextmenu_helper.h
|
||||
HEADERS += selectioncontext.h
|
||||
HEADERS += componentcore_constants.h
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#define MODELNODECONTEXTMENU_HELPER_H
|
||||
|
||||
#include "modelnodeoperations.h"
|
||||
#include "defaultdesigneraction.h"
|
||||
#include "abstractaction.h"
|
||||
#include "abstractactiongroup.h"
|
||||
#include "qmlitemnode.h"
|
||||
|
||||
@@ -142,7 +142,7 @@ private:
|
||||
SelectionContextFunction m_visibility;
|
||||
};
|
||||
|
||||
class SeperatorDesignerAction : public DefaultDesignerAction
|
||||
class SeperatorDesignerAction : public AbstractAction
|
||||
{
|
||||
public:
|
||||
SeperatorDesignerAction(const QByteArray &category, int priority) :
|
||||
@@ -165,14 +165,14 @@ private:
|
||||
SelectionContextFunction m_visibility;
|
||||
};
|
||||
|
||||
class ModelNodeAction : public DefaultDesignerAction
|
||||
class ModelNodeAction : public AbstractAction
|
||||
{
|
||||
public:
|
||||
ModelNodeAction(const QString &description, const QByteArray &category, int priority,
|
||||
ModelNodeOperations::SelectionAction selectionAction,
|
||||
SelectionContextFunction enabled = &SelectionContextFunctors::always,
|
||||
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
|
||||
DefaultDesignerAction(new ActionTemplate(description, selectionAction)),
|
||||
AbstractAction(new ActionTemplate(description, selectionAction)),
|
||||
m_category(category),
|
||||
m_priority(priority),
|
||||
m_enabled(enabled),
|
||||
|
@@ -57,7 +57,7 @@ bool isTabAndParentIsTabView(const ModelNode &modelNode)
|
||||
}
|
||||
|
||||
AddTabDesignerAction::AddTabDesignerAction()
|
||||
: DefaultDesignerAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
||||
: AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
||||
{
|
||||
connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
|
||||
}
|
||||
|
@@ -30,11 +30,11 @@
|
||||
#ifndef QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
||||
#define QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
||||
|
||||
#include "defaultdesigneraction.h"
|
||||
#include "abstractaction.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class AddTabDesignerAction : public QObject, public DefaultDesignerAction
|
||||
class AddTabDesignerAction : public QObject, public AbstractAction
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
Reference in New Issue
Block a user