QmlJS: Clean up ViewerContext

The special ctor wasn't used anywhere, the default ctor can be replaced
by inline initialization, maybeAddPath is only meaningful in the model
manager and the language compatibility check should definitely not
pretend to be a general rule either.

Change-Id: I11cf25fe1c696550d33b56ce57316100321d564b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Ulf Hermann
2019-10-23 09:14:58 +02:00
parent 3b65c0a5d5
commit 6371725dbf
6 changed files with 51 additions and 111 deletions

View File

@@ -32,9 +32,8 @@
namespace QmlJS {
class QMLJS_EXPORT ViewerContext
struct QMLJS_EXPORT ViewerContext
{
public:
enum Flags {
Complete,
AddAllPathsAndDefaultSelectors,
@@ -43,18 +42,10 @@ public:
AddDefaultPathsAndSelectors
};
ViewerContext();
ViewerContext(const QStringList &selectors, const QStringList &paths,
Dialect language = Dialect::Qml,
Flags flags = AddAllPaths);
bool languageIsCompatible(Dialect l) const;
void maybeAddPath(const QString &path);
QStringList selectors;
QStringList paths;
Dialect language;
Flags flags;
Dialect language = Dialect::Qml;
Flags flags = AddAllPaths;
};
} // namespace QmlJS