[Differential] [Request, 7 lines] D3668: src/lib/marble/AbstractFloatItem.cpp: macOS: fix a crash after when attempting to restore settings
whitegeorge (George White)
noreply at phabricator.kde.org
Tue Dec 13 17:46:43 UTC 2016
whitegeorge created this revision.
whitegeorge added a reviewer: Marble.
whitegeorge set the repository for this revision to R34 Marble.
whitegeorge added a project: Marble.
This patch is submitted as part of a Google Code-In student task.
For some bizarre reason, when the QPointF is serialised to be placed in to the QSettings (which, on macOS and iOS, uses a plist XML document), its value is lost. When restoring the position in AbstractFloatItem::setSettings from a defective plist, a sigabrt is caused by an assertion within QList::at when the index of 1 is accessed as part of restoring the QPointF from the QStringList.
This patch ensures that the QPointF is safely cast to a QVariant, and that the QVariant is restored back to a QPointF without going through the process of casting it to a QString and then attempting to create a new QPointF from that only the string value. This is kept under the protection of `#if __APPLE__` to ensure this minimally impacts non-Apple operating systems.
To: whitegeorge, #marble
Cc: mnafees, shentey, chaz6, dkolozsvari, cmihalache, rahn, nienhueser, marble-devel
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Marble-devel