[Marble-bugs] [marble] [Bug 318735] New: Legend images not shown on windows
Dennis Nienhüser
earthwings at gentoo.org
Mon Apr 22 19:47:30 UTC 2013
https://bugs.kde.org/show_bug.cgi?id=318735
Bug ID: 318735
Summary: Legend images not shown on windows
Classification: Unclassified
Product: marble
Version: 1.6.0 (KDE 4.11.0)
Platform: MS Windows
URL: https://forum.kde.org/viewtopic.php?f=217&t=109874&p=2
63576#p263576
OS: MS Windows
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: marble-bugs at kde.org
Reporter: earthwings at gentoo.org
Quoting the forum thread:
2) Next fix is... obscure? Problem occurs in
MarbleLegendBrowser::generateSectionsHtml (file MarbleLegendBrowser.cpp).
Generating html from dgml, we add image properties tags. Among these properties
is the path to the image file. Path generated by adding two strings - "file://"
and canonical path. On Linux all seems to be ok, because Linux canonical paths
begins with '/' symbol. The result is an url like
"file:///opt/marble/data/bitmaps/flag.png", according to this article.
But on Windows the result is invalid, like
"file://c:/marble/data/bitmaps/flag.png". This result cannot be shown correctly
in LegendWidget. We must add one more '/' to get normal
"file:///c:/marble/data/bitmaps/flag.png" url.
When we fix this, we fall into another problem. When image file is not used and
canonical path is null, we finally get a stupid url like "file:///". On
Windows, in release build such urls provokes an internal crash in Qt, resulting
in application crash with error message from Microsoft Visual C++ Runtime
Library: "Runtime error! <...> This application has requested the Runtime to
terminate it in an unusual way. <...>".
See Atlas theme (data/maps/earth/srtm/srtm.dgml - elevation explanation
section) for such imageless elements.
Consider to check is the following fix correct:
Code: Select all
///- QString src = "file://" + path;
QString src;
///+
if( !path.isEmpty() ) {
///+
src = "file://";
///+
if( path.at( 0 ) != '/' )
///+
path.push_front( '/' );
///+
src += path;
///+
}
///+
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Marble-bugs
mailing list