forked from qt-creator/qt-creator
QmlJSStaticAnalysis: make PrototypeMessageData public
We need this in the rewriter to avoid warning. Change-Id: Ia99583e080eed936d98517ce553294d3040f8cee Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -43,14 +43,6 @@ class StaticAnalysisMessages
|
|||||||
Q_DECLARE_TR_FUNCTIONS(QmlJS::StaticAnalysisMessages)
|
Q_DECLARE_TR_FUNCTIONS(QmlJS::StaticAnalysisMessages)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class PrototypeMessageData {
|
|
||||||
public:
|
|
||||||
Type type;
|
|
||||||
Severity severity;
|
|
||||||
QString message;
|
|
||||||
int placeholders;
|
|
||||||
};
|
|
||||||
|
|
||||||
void newMsg(Type type, Severity severity, const QString &message, int placeholders = 0)
|
void newMsg(Type type, Severity severity, const QString &message, int placeholders = 0)
|
||||||
{
|
{
|
||||||
PrototypeMessageData prototype;
|
PrototypeMessageData prototype;
|
||||||
@@ -248,7 +240,7 @@ Message::Message(Type type,
|
|||||||
: location(location), type(type)
|
: location(location), type(type)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(messages()->messages.contains(type), return);
|
QTC_ASSERT(messages()->messages.contains(type), return);
|
||||||
const StaticAnalysisMessages::PrototypeMessageData &prototype = messages()->messages.value(type);
|
const PrototypeMessageData &prototype = prototypeForMessageType(type);
|
||||||
severity = prototype.severity;
|
severity = prototype.severity;
|
||||||
message = prototype.message;
|
message = prototype.message;
|
||||||
if (prototype.placeholders == 0) {
|
if (prototype.placeholders == 0) {
|
||||||
@@ -299,3 +291,11 @@ QRegExp Message::suppressionPattern()
|
|||||||
{
|
{
|
||||||
return QRegExp(QLatin1String("@disable-check M(\\d+)"));
|
return QRegExp(QLatin1String("@disable-check M(\\d+)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PrototypeMessageData Message::prototypeForMessageType(Type type)
|
||||||
|
{
|
||||||
|
QTC_CHECK(messages()->messages.contains(type));
|
||||||
|
const PrototypeMessageData &prototype = messages()->messages.value(type);
|
||||||
|
|
||||||
|
return prototype;
|
||||||
|
}
|
||||||
|
@@ -131,6 +131,14 @@ enum Type
|
|||||||
ErrInvalidArrayValueLength = 323
|
ErrInvalidArrayValueLength = 323
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QMLJS_EXPORT PrototypeMessageData {
|
||||||
|
public:
|
||||||
|
Type type;
|
||||||
|
Severity severity;
|
||||||
|
QString message;
|
||||||
|
int placeholders;
|
||||||
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT Message
|
class QMLJS_EXPORT Message
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -152,6 +160,8 @@ public:
|
|||||||
QString message;
|
QString message;
|
||||||
Type type;
|
Type type;
|
||||||
Severity severity;
|
Severity severity;
|
||||||
|
|
||||||
|
static const PrototypeMessageData prototypeForMessageType(Type type);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace StaticAnalysis
|
} // namespace StaticAnalysis
|
||||||
|
Reference in New Issue
Block a user