Commit ac10d700 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Use QByteArray instead of QString for ids in designer actions

Change-Id: I0f366f7ef9b097e8f5cb5a9863b22774d4d6bf20
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 0aac8187
......@@ -57,8 +57,8 @@ public:
virtual ~AbstractDesignerAction() {}
virtual QAction *action() const = 0;
virtual QString category() const = 0;
virtual QString menuId() const = 0;
virtual QByteArray category() const = 0;
virtual QByteArray menuId() const = 0;
virtual int priority() const = 0;
virtual Type type() const = 0;
virtual void currentContextChanged(const SelectionContext &selectionState) = 0;
......
......@@ -32,8 +32,8 @@
namespace QmlDesigner {
DefaultDesignerAction::DefaultDesignerAction()
: m_action(new DefaultAction(QString()))
DefaultDesignerAction::DefaultDesignerAction(const QString &description)
: m_action(new DefaultAction(description))
{
}
......
......@@ -55,7 +55,7 @@ protected:
class QMLDESIGNERCORE_EXPORT DefaultDesignerAction : public AbstractDesignerAction
{
public:
DefaultDesignerAction();
DefaultDesignerAction(const QString &description = QString());
DefaultDesignerAction(DefaultAction *action);
QAction *action() const { return m_action; }
......
......@@ -227,7 +227,7 @@ QmlModelView *DesignerActionManager::view()
class VisiblityModelNodeAction : public ModelNodeAction
{
public:
VisiblityModelNodeAction(const QString &description, const QString &category, int priority,
VisiblityModelNodeAction(const QString &description, const QByteArray &category, int priority,
ModelNodeOperations::SelectionAction action,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
......@@ -253,7 +253,7 @@ public:
class SelectionModelNodeAction : public MenuDesignerAction
{
public:
SelectionModelNodeAction(const QString &displayName, const QString &menuId, int priority) :
SelectionModelNodeAction(const QString &displayName, const QByteArray &menuId, int priority) :
MenuDesignerAction(displayName, menuId, priority,
&SelectionContextFunctors::always, &SelectionContextFunctors::selectionEnabled)
......
......@@ -122,7 +122,7 @@ public /*slots*/:
class MenuDesignerAction : public AbstractDesignerAction
{
public:
MenuDesignerAction(const QString &displayName, const QString &menuId, int priority,
MenuDesignerAction(const QString &displayName, const QByteArray &menuId, int priority,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
m_displayName(displayName),
......@@ -138,8 +138,8 @@ public:
bool isVisible(const SelectionContext &m_selectionState) const { return m_visibility(m_selectionState); }
bool isEnabled(const SelectionContext &m_selectionState) const { return m_enabled(m_selectionState); }
QString category() const { return QString(); }
QString menuId() const { return m_menuId; }
QByteArray category() const { return QByteArray(); }
QByteArray menuId() const { return m_menuId; }
int priority() const { return m_priority; }
AbstractDesignerAction::Type type() const { return AbstractDesignerAction::Menu; }
QAction *action() const { return m_action; }
......@@ -160,7 +160,7 @@ public:
protected:
const QString m_displayName;
const QString m_menuId;
const QByteArray m_menuId;
const int m_priority;
SelectionContext m_selectionContext;
QScopedPointer<QMenu> m_menu;
......@@ -172,7 +172,7 @@ protected:
class SeperatorDesignerAction : public DefaultDesignerAction
{
public:
SeperatorDesignerAction(const QString &category, int priority) :
SeperatorDesignerAction(const QByteArray &category, int priority) :
m_category(category),
m_priority(priority),
m_visibility(&SelectionContextFunctors::always)
......@@ -180,14 +180,14 @@ public:
bool isVisible(const SelectionContext &m_selectionState) const { return m_visibility(m_selectionState); }
bool isEnabled(const SelectionContext &) const { return true; }
QString category() const { return m_category; }
QString menuId() const { return QString(); }
QByteArray category() const { return m_category; }
QByteArray menuId() const { return QByteArray(); }
int priority() const { return m_priority; }
Type type() const { return Action; }
void currentContextChanged(const SelectionContext &) {}
private:
const QString m_category;
const QByteArray m_category;
const int m_priority;
SelectionContextFunction m_visibility;
};
......@@ -195,7 +195,7 @@ private:
class ModelNodeAction : public DefaultDesignerAction
{
public:
ModelNodeAction(const QString &description, const QString &category, int priority,
ModelNodeAction(const QString &description, const QByteArray &category, int priority,
ModelNodeOperations::SelectionAction selectionAction,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
......@@ -208,13 +208,13 @@ public:
bool isVisible(const SelectionContext &selectionState) const { return m_visibility(selectionState); }
bool isEnabled(const SelectionContext &selectionState) const { return m_enabled(selectionState); }
QString category() const { return m_category; }
QString menuId() const { return QString(); }
QByteArray category() const { return m_category; }
QByteArray menuId() const { return QByteArray(); }
int priority() const { return m_priority; }
Type type() const { return Action; }
private:
const QString m_category;
const QByteArray m_category;
const int m_priority;
const SelectionContextFunction m_enabled;
const SelectionContextFunction m_visibility;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment