Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core, node, darwin, qt] Remove support for paint classes #8953

Merged
merged 6 commits into from
May 15, 2017

Conversation

jfirebaugh
Copy link
Contributor

@jfirebaugh jfirebaugh commented May 10, 2017

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.

@jfirebaugh jfirebaugh force-pushed the rm-classes branch 4 times, most recently from 97b67ff to 420e83a Compare May 10, 2017 23:53
@jfirebaugh jfirebaugh changed the title [core, node, darwin] Remove support for paint classes [core, node, darwin, qt] Remove support for paint classes May 10, 2017
@jfirebaugh jfirebaugh force-pushed the rm-classes branch 2 times, most recently from 0d1325d to b1075f5 Compare May 11, 2017 01:22
@jfirebaugh jfirebaugh force-pushed the immutable branch 4 times, most recently from e859904 to 2228ad9 Compare May 12, 2017 17:55
@jfirebaugh jfirebaugh changed the base branch from immutable to master May 12, 2017 18:28
Copy link
Contributor

@1ec5 1ec5 left a 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.

}

- (BOOL)hasStyleClass:(NSString *)styleClass
{
return styleClass && self.mapView.mbglMap->hasClass([styleClass UTF8String]);
return false;
Copy link
Contributor

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.

}

return returnArray;
return [NSMutableArray arrayWithCapacity:0];
Copy link
Contributor

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.

Copy link
Contributor

@1ec5 1ec5 left a 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.")));
Copy link
Contributor

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?

*/
void QMapboxGL::addClass(const QString &className)
void QMapboxGL::addClass(const QString &)
Copy link
Member

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.

*/
void QMapboxGL::removeClass(const QString &className)
void QMapboxGL::removeClass(const QString &)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

*/
bool QMapboxGL::hasClass(const QString &className) const
bool QMapboxGL::hasClass(const QString &) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

*/
void QMapboxGL::setClasses(const QStringList &classNames)
void QMapboxGL::setClasses(const QStringList &)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


\deprecated
\sa setClasses()
*/
QStringList QMapboxGL::getClasses() const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@@ -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&)
Copy link
Member

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.

Copy link
Member

@brunoabinader brunoabinader left a 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 🤘

@jfirebaugh
Copy link
Contributor Author

Great, thanks @brunoabinader, I will remove it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants