-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core, node, darwin, qt] Remove support for paint classes #8953
Conversation
97b67ff
to
420e83a
Compare
0d1325d
to
b1075f5
Compare
e859904
to
2228ad9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the methods but making them nonfunctional would technically allow us to avoid a major semver bump on iOS, but it’s against the spirit of those rules to change the behavior in a significant way. Fortunately, hopefully style class usage on iOS is insignificant enough to make this change regardless.
We should state in the documentation comments for the affected methods and in the iOS/macOS changelogs that these methods have no effect. (There are also still deprecated style class methods on the iOS implementation of MGLMapView.) Finally, there’s a line in the “Information for Style Authors” guide that refers to style classes; we should probably remove that.
platform/darwin/src/MGLStyle.mm
Outdated
} | ||
|
||
- (BOOL)hasStyleClass:(NSString *)styleClass | ||
{ | ||
return styleClass && self.mapView.mbglMap->hasClass([styleClass UTF8String]); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The negative version of BOOL
is NO
, not false
.
platform/darwin/src/MGLStyle.mm
Outdated
} | ||
|
||
return returnArray; | ||
return [NSMutableArray arrayWithCapacity:0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use @[]
for an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☀️
*/ | ||
- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release."))); | ||
- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional."))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally deprecation messages say what to use instead, or they say, “There is no replacement.” In this case, the replacement would be setting properties on style layers individually, right?
platform/qt/src/qmapboxgl.cpp
Outdated
*/ | ||
void QMapboxGL::addClass(const QString &className) | ||
void QMapboxGL::addClass(const QString &) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to maintain binary compatibility on the QMapboxGL interface - we use it internally and expose a separate API on the QtLocation plugin - thus it is safe to assume we can remove all class-handling function implementations from QMapboxGL.
platform/qt/src/qmapboxgl.cpp
Outdated
*/ | ||
void QMapboxGL::removeClass(const QString &className) | ||
void QMapboxGL::removeClass(const QString &) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
platform/qt/src/qmapboxgl.cpp
Outdated
*/ | ||
bool QMapboxGL::hasClass(const QString &className) const | ||
bool QMapboxGL::hasClass(const QString &) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
platform/qt/src/qmapboxgl.cpp
Outdated
*/ | ||
void QMapboxGL::setClasses(const QStringList &classNames) | ||
void QMapboxGL::setClasses(const QStringList &) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
platform/qt/src/qmapboxgl.cpp
Outdated
|
||
\deprecated | ||
\sa setClasses() | ||
*/ | ||
QStringList QMapboxGL::getClasses() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
platform/qt/src/qmapboxgl.cpp
Outdated
@@ -1006,7 +984,7 @@ void QMapboxGL::setLayoutProperty(const QString& layer, const QString& property, | |||
map->setPaintProperty("route","line-dasharray", lineDashArray); | |||
\endcode | |||
*/ | |||
void QMapboxGL::setPaintProperty(const QString& layer, const QString& property, const QVariant& value, const QString& styleClass) | |||
void QMapboxGL::setPaintProperty(const QString& layer, const QString& property, const QVariant& value, const QString&) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same reasons previously mentioned, we can remove the final argument entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job @jfirebaugh 🚀 I appreciate your attention over binary compatibility on the Qt API though we don't need it - we can nuke that code away too 🤘
Great, thanks @brunoabinader, I will remove it. |
It's still relevant for runtime-styling driven paint property changes.
We've long talked about doing this, and with the implementation of async rendering, which will unlock smart set style, I think it's time.
Fixes #2875.