forked from qt-creator/qt-creator
Core: Make Id(int) constructor less accessible
... and change two seemingly accidental uses. The functionality is still available by explicitly using Id::fromUniqueIdentifier(). Change-Id: I190e58f9fcd5c0f06e29103a0c0c82e322bee100 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "command_p.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
@@ -320,7 +321,7 @@ void Action::addOverrideAction(QAction *action, const Context &context, bool scr
|
||||
if (isEmpty())
|
||||
m_action->initialize(action);
|
||||
if (context.isEmpty()) {
|
||||
m_contextActionMap.insert(0, action);
|
||||
m_contextActionMap.insert(Constants::C_GLOBAL, action);
|
||||
} else {
|
||||
for (int i = 0; i < context.size(); ++i) {
|
||||
Id id = context.at(i);
|
||||
|
@@ -49,7 +49,6 @@ public:
|
||||
enum { IdsPerPlugin = 10000, ReservedPlugins = 1000 };
|
||||
|
||||
Id() : m_id(0) {}
|
||||
Id(int uid) : m_id(uid) {}
|
||||
Id(const char *name);
|
||||
|
||||
Id withSuffix(int suffix) const;
|
||||
@@ -78,6 +77,9 @@ public:
|
||||
private:
|
||||
// Intentionally unimplemented
|
||||
Id(const QLatin1String &);
|
||||
// Force explicit use of fromUniqueIdentifier().
|
||||
explicit Id(int uid) : m_id(uid) {}
|
||||
|
||||
int m_id;
|
||||
};
|
||||
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
class ConditionalFeature {
|
||||
public:
|
||||
ConditionalFeature() : feature(-1) { }
|
||||
ConditionalFeature() : feature(Core::Id()) { }
|
||||
ConditionalFeature(const Core::Feature &f, const QVariant &c) : feature(f), condition(c)
|
||||
{ }
|
||||
|
||||
|
Reference in New Issue
Block a user