fix(App): colors getter returns a const pointer now

This commit is contained in:
Ronan Abhamon 2017-06-21 14:29:49 +02:00
parent 00bc9aa18f
commit 46f989c2e8
3 changed files with 5 additions and 11 deletions

View file

@ -352,8 +352,8 @@ void registerToolType (const char *name) {
#define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \
NAME, 1, 0, NAME, \
[](QQmlEngine *, QJSEngine *) -> QObject *{ \
QObject *object = METHOD(); \
[](QQmlEngine *, QJSEngine *) -> QObject *{ \
QObject *object = const_cast<TYPE *>(METHOD()); \
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); \
return object; \
} \

View file

@ -64,7 +64,7 @@ public:
return mNotifier;
}
Colors *getColors () const {
const Colors *getColors () const {
return mColors;
}

View file

@ -58,10 +58,7 @@ static QByteArray buildByteArrayAttribute (const QByteArray &name, const QByteAr
return attribute;
}
static QByteArray parseFillAndStroke (
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QByteArray parseFillAndStroke (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
static QRegExp regex("^color-([^-]+)-(fill|stroke)$");
QByteArray attributes;
@ -86,10 +83,7 @@ static QByteArray parseFillAndStroke (
return attributes;
}
static QByteArray parseStyle (
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
static QRegExp regex("^color-([^-]+)-style-(fill|stroke)$");
QByteArray attribute;