Skip to content

Commit 75fe8ed

Browse files
committed
Better SVG downloading icon
(cherry-picked from 887db6e)
1 parent 120a884 commit 75fe8ed

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

images/images.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@
647647
<file>themes/default/mIconLayout.svg</file>
648648
<file>themes/default/mActionNewReport.svg</file>
649649
<file>themes/default/mIconReport.svg</file>
650+
<file>themes/default/downloading_svg.svg</file>
650651
</qresource>
651652
<qresource prefix="/images/tips">
652653
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Lines changed: 1 addition & 0 deletions
Loading

src/core/symbology/qgssvgcache.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,21 @@ QgsSvgCache::QgsSvgCache( QObject *parent )
8484
, mMutex( QMutex::Recursive )
8585
{
8686
mMissingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>?</text></svg>" ).toLatin1();
87-
mFetchingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>&#8987;</text></svg>" ).toLatin1();
87+
88+
const QString downloadingSvgPath = QgsApplication::defaultThemePath() + QStringLiteral( "downloading_svg.svg" );
89+
if ( QFile::exists( downloadingSvgPath ) )
90+
{
91+
QFile file( downloadingSvgPath );
92+
if ( file.open( QIODevice::ReadOnly ) )
93+
{
94+
mFetchingSvg = file.readAll();
95+
}
96+
}
97+
98+
if ( mFetchingSvg.isEmpty() )
99+
{
100+
mFetchingSvg = QStringLiteral( "<svg width='10' height='10'><text x='5' y='10' font-size='10' text-anchor='middle'>?</text></svg>" ).toLatin1();
101+
}
88102
}
89103

90104
QgsSvgCache::~QgsSvgCache()
Loading
Loading

0 commit comments

Comments
 (0)