Skip to content

Commit 18a1c8a

Browse files
committed
Fix #10828 (slow project loading)
1 parent 43635e7 commit 18a1c8a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/gui/qgsmaplayermodel.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <QIcon>
1717

18+
#include "qgsdataitem.h"
1819
#include "qgsmaplayermodel.h"
1920
#include "qgsmaplayerregistry.h"
2021
#include "qgsapplication.h"
@@ -132,6 +133,7 @@ int QgsMapLayerModel::columnCount( const QModelIndex &parent ) const
132133
return 1;
133134
}
134135

136+
135137
QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
136138
{
137139
if ( !index.isValid() || !index.internalPointer() )
@@ -165,7 +167,7 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
165167
{
166168
case QgsMapLayer::RasterLayer:
167169
{
168-
return QgsApplication::getThemeIcon( "/mIconRasterLayer.svg" );
170+
return QgsLayerItem::iconRaster();
169171
}
170172

171173
case QgsMapLayer::VectorLayer:
@@ -180,19 +182,19 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
180182
{
181183
case QGis::Point:
182184
{
183-
return QgsApplication::getThemeIcon( "/mIconPointLayer.svg" );
185+
return QgsLayerItem::iconPoint();
184186
}
185187
case QGis::Polygon :
186188
{
187-
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.svg" );
189+
return QgsLayerItem::iconPolygon();
188190
}
189191
case QGis::Line :
190192
{
191-
return QgsApplication::getThemeIcon( "/mIconLineLayer.svg" );
193+
return QgsLayerItem::iconLine();
192194
}
193195
case QGis::NoGeometry :
194196
{
195-
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
197+
return QgsLayerItem::iconTable();
196198
}
197199
default:
198200
{

0 commit comments

Comments
 (0)