Commit 906cf995 authored by Murad Tagirov's avatar Murad Tagirov

- Implemented parsing of icons. Currently support only "file://" url scheme....

- Implemented parsing of icons. Currently support only "file://" url scheme. Use MarbleDirs to locate icon

svn path=/trunk/KDE/kdeedu/marble/; revision=705982
parent ab1ea479
2007-08-29 Murad Tagirov <tmurad@gmail.com>
Implemented parsing of icons. Currently support only
"file://" url scheme. Use MarbleDirs to locate icon.
* src/lib/kml/KMLIconStyleParser.{h,cpp}
* docs/projects/kml/KMLClasses.xmi
2007-08-27 Torsten Rahn <rahn@kde.org>
* src/lib/MarbleWidget.{h,cpp}:
* src/lib/MarbleControlBox.{h,cpp}:
If FLATPROJ_GSOC is defined then enable
If FLATPROJ_GSOC is defined then enable
switching between projections ...
Now I need to fix the "jumping projection" bug ...
2007-08-27 Torsten Rahn <rahn@kde.org>
* src/lib/HttpFetchFile.cpp:
- Fixing tile loading bug introduced by Danimo's
- Fixing tile loading bug introduced by Danimo's
last Windows fix
* src/lib/GlobeScanlineTextureMapper.cpp:
- Fixing crash due to different tile depths
- Fixing crash due to different tile depths
reported by Frederik Schwarzer.
* src/lib/TileCreator.cpp:
- Faster tile creation
......@@ -25,7 +32,7 @@
* src/lib/kml/KMLIconStyle.cpp (setIcon): Take const QPixmap&
2007-08-25 Carlos Licea <carlos_licea@hotmail.com>
*MarbleWidget: solved the trace bug. As I expected the
*MarbleWidget: solved the trace bug. As I expected the
problem was an exception for the Spherical projection
tha wasn't needed in the flat projection.
......
This diff is collapsed.
......@@ -10,7 +10,11 @@
#include "KMLIconStyleParser.h"
#include <QtCore/QUrl>
#include <QtGui/QPixmap>
#include "KMLIconStyle.h"
#include "lib/MarbleDirs.h"
namespace
{
......@@ -111,6 +115,7 @@ bool KMLIconStyleParser::characters( const QString& ch )
/*
* TODO
*/
loadIcon( ch );
result = true;
break;
default:
......@@ -120,3 +125,22 @@ bool KMLIconStyleParser::characters( const QString& ch )
return result;
}
void KMLIconStyleParser::loadIcon( const QString& hrefValue )
{
QUrl url( hrefValue );
/*
* Iterate over supported schema values (e.g. file, http, etc).
*/
if ( url.scheme() == "file" ) {
QString path = MarbleDirs::path( url.authority() + url.path() );
if ( QFile::exists( path ) ) {
QPixmap pixmap( path );
KMLIconStyle& style = (KMLIconStyle&) m_object;
style.setIcon (pixmap);
}
}
}
......@@ -14,6 +14,7 @@
#include "KMLColorStyleParser.h"
class QString;
class KMLIconStyle;
class KMLIconStyleParser : public KMLColorStyleParser
......@@ -32,6 +33,9 @@ class KMLIconStyleParser : public KMLColorStyleParser
virtual bool characters( const QString& ch );
private:
void loadIcon( const QString& hrefValue );
private:
enum
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment