Skip to content
Permalink
Browse files

avoid use of QIcon in data items in threads

  • Loading branch information
blazek committed Nov 14, 2014
1 parent aa4338a commit e0ab4b2c7ccce497af1bcd3bc90f0a3dc43b42ac
@@ -535,7 +535,10 @@ void QgsBrowserModel::refresh( const QModelIndex& theIndex )
QVector<QgsDataItem*> QgsBrowserModel::createChildren( QgsDataItem* item )
{
QgsDebugMsg( "Entered" );
QTime time;
time.start();
QVector <QgsDataItem*> children = item->createChildren();
QgsDebugMsg( QString( "Children created in %1 ms" ).arg( time.elapsed() ) );
// Children objects must be pushed to main thread.
foreach ( QgsDataItem* child, children )
{
@@ -235,8 +235,6 @@ QVector<QgsDataItem*>QgsWCSRootItem::createChildren()
{
QgsOWSConnection connection( "WCS", connName );
QgsDataItem * conn = new QgsWCSConnectionItem( this, connName, mPath + "/" + connName, connection.uri().encodedUri() );

conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;
@@ -29,7 +29,7 @@ QgsWFSLayerItem::QgsWFSLayerItem( QgsDataItem* parent, QString name, QgsDataSour
{
mUri = QgsWFSCapabilities( uri.encodedUri() ).uriGetFeature( featureType, crsString );
mPopulated = true;
mIconName = "mIconWfs.svg";
mIconName = "mIconConnect.png";
}

QgsWFSLayerItem::~QgsWFSLayerItem()
@@ -155,7 +155,6 @@ QVector<QgsDataItem*> QgsWFSRootItem::createChildren()
QgsOWSConnection connection( "WFS", connName );
QString path = "wfs:/" + connName;
QgsDataItem * conn = new QgsWFSConnectionItem( this, connName, path, connection.uri().encodedUri() );
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;
@@ -32,7 +32,7 @@ QgsWMSConnectionItem::QgsWMSConnectionItem( QgsDataItem* parent, QString name, Q
: QgsDataCollectionItem( parent, name, path )
, mUri( uri )
{
mIconName = "mIconWms.svg";
mIconName = "mIconConnect.png";
}

QgsWMSConnectionItem::~QgsWMSConnectionItem()
@@ -374,7 +374,6 @@ QVector<QgsDataItem*> QgsWMSRootItem::createChildren()
QgsWMSConnection connection( connName );
QgsDataItem * conn = new QgsWMSConnectionItem( this, connName, mPath + "/" + connName, connection.uri().encodedUri() );

conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;

0 comments on commit e0ab4b2

Please sign in to comment.
You can’t perform that action at this time.