Bug 341203

Summary: Char* assignments to QStrings in headers, breaks compilation with QT_NO_CAST_ASCII
Product: [Applications] marble Reporter: Teemu Rytilahti <tpr>
Component: generalAssignee: marble-bugs
Status: RESOLVED FIXED    
Severity: normal CC: illya.kovalevskyy
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Teemu Rytilahti 2014-11-23 21:29:44 UTC
There are multiple instances of setting default values for parameters in the public headers. This in turn breaks builds if QT_NO_CAST_ASCII is being used, like it seems to be default for KF5 builds when no KF5Kdelibs4Support is enabled.

Possible solution would be to avoid defining default values in those headers or wrapping them with QStringLiteral or similar.

[tpr@tuli lib]$ find . -name *.h|xargs grep "=\s*\""
./marble/AbstractDataPlugin.h:                 const QString& renderPos = "NONE", GeoSceneLayer * layer = 0 );
./marble/MapWizard.h:    static QString createLegendHtml( const QString& image = "./legend/legend.png" );
./marble/MarbleMap.h:     *    maptheme = "earth/bluemarble/bluemarble.dgml"
./marble/MarbleMap.h:     *    maptheme = "earth/bluemarble/bluemarble.dgml" 
./marble/MarbleModel.h:     *    maptheme = "earth/bluemarble/bluemarble.dgml"
./marble/MarbleModel.h:     *    maptheme = "earth/bluemarble/bluemarble.dgml"
./marble/MarbleModel.h:    void addGeoDataString( const QString& data, const QString& key = "data" );
./marble/MarbleWidget.h:     *    mapThemeId = "earth/bluemarble/bluemarble.dgml"
./marble/MarbleWidget.h:     *    maptheme = "earth/bluemarble/bluemarble.dgml"
./marble/layers/TextureLayer.h:                 const QString &renderPos = "NONE", GeoSceneLayer *layer = 0 );
./marble/layers/GeometryLayer.h:                         const QString& renderPos = "NONE", GeoSceneLayer * layer = 0 );
./marble/layers/GroundLayer.h:    const QString& renderPos = "NONE", GeoSceneLayer * layer = 0 );
./marble/layers/GroundLayer.h:    QColor m_color;  // Gets the color specified via DGML's <map bgcolor="">
./marble/layers/FogLayer.h:       const QString& renderPos = "NONE", GeoSceneLayer * layer = 0 );
./marble/layers/MarbleSplashLayer.h:                         const QString &renderPos = "SURFACE", GeoSceneLayer *layer = 0 );
./marble/layers/VectorTileLayer.h:                 const QString &renderPos = "NONE", GeoSceneLayer *layer = 0 );
./marble/layers/PlacemarkLayer.h:                 const QString &renderPos = "NONE", GeoSceneLayer *layer = 0 );
./marble/routing/RoutingLayer.h:                 const QString &renderPos = "NONE", GeoSceneLayer *layer = 0 );
./marble/AbstractFloatItem.h:                 const QString& renderPos = "FLOAT_ITEM", GeoSceneLayer * layer = 0 );

Reproducible: Always

Steps to Reproduce:
1. Include marble/MarbleModel.h to your external project
2. Compile external project with QT_NO_CAST_ASCII enabled
Comment 1 Illya Kovalevskyy 2014-12-13 18:53:21 UTC
Makes sense, header files shouldn't go with char* cast definitely. I will try to look into tomorrow.
Comment 2 Justin Zobel 2021-03-09 22:51:32 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 3 Teemu Rytilahti 2022-10-26 21:14:01 UTC
I doubt this is valid anymore so I'll close it, thanks for giving us marble!