Commit 46f989c2 authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent 00bc9aa1
...@@ -352,8 +352,8 @@ void registerToolType (const char *name) { ...@@ -352,8 +352,8 @@ void registerToolType (const char *name) {
#define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \ #define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \
NAME, 1, 0, NAME, \ NAME, 1, 0, NAME, \
[](QQmlEngine *, QJSEngine *) -> QObject *{ \ [](QQmlEngine *, QJSEngine *) -> QObject *{ \
QObject *object = METHOD(); \ QObject *object = const_cast<TYPE *>(METHOD()); \
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); \ QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); \
return object; \ return object; \
} \ } \
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
return mNotifier; return mNotifier;
} }
Colors *getColors () const { const Colors *getColors () const {
return mColors; return mColors;
} }
......
...@@ -58,10 +58,7 @@ static QByteArray buildByteArrayAttribute (const QByteArray &name, const QByteAr ...@@ -58,10 +58,7 @@ static QByteArray buildByteArrayAttribute (const QByteArray &name, const QByteAr
return attribute; return attribute;
} }
static QByteArray parseFillAndStroke ( static QByteArray parseFillAndStroke (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QRegExp regex("^color-([^-]+)-(fill|stroke)$"); static QRegExp regex("^color-([^-]+)-(fill|stroke)$");
QByteArray attributes; QByteArray attributes;
...@@ -86,10 +83,7 @@ static QByteArray parseFillAndStroke ( ...@@ -86,10 +83,7 @@ static QByteArray parseFillAndStroke (
return attributes; return attributes;
} }
static QByteArray parseStyle ( static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QRegExp regex("^color-([^-]+)-style-(fill|stroke)$"); static QRegExp regex("^color-([^-]+)-style-(fill|stroke)$");
QByteArray attribute; QByteArray attribute;
......
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