Skip to content

Commit

Permalink
Better SVG downloading icon
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent 9c28c91 commit 887db6e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -648,6 +648,7 @@
<file>themes/default/mIconLayout.svg</file>
<file>themes/default/mActionNewReport.svg</file>
<file>themes/default/mIconReport.svg</file>
<file>themes/default/downloading_svg.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
1 change: 1 addition & 0 deletions images/themes/default/downloading_svg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion src/core/symbology/qgssvgcache.cpp
Expand Up @@ -84,7 +84,21 @@ QgsSvgCache::QgsSvgCache( QObject *parent )
, mMutex( QMutex::Recursive )
{
mMissingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>?</text></svg>" ).toLatin1();
mFetchingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>&#8987;</text></svg>" ).toLatin1();

const QString downloadingSvgPath = QgsApplication::defaultThemePath() + QStringLiteral( "downloading_svg.svg" );
if ( QFile::exists( downloadingSvgPath ) )
{
QFile file( downloadingSvgPath );
if ( file.open( QIODevice::ReadOnly ) )
{
mFetchingSvg = file.readAll();
}
}

if ( mFetchingSvg.isEmpty() )
{
mFetchingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>?</text></svg>" ).toLatin1();
}
}

QgsSvgCache::~QgsSvgCache()
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 887db6e

Please sign in to comment.