mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Fix mssql browser items not correctly populated before refreshing
This commit is contained in:
parent
316a941f43
commit
75fcd2d0d2
@ -206,6 +206,7 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
|
||||
if ( !schemaItem )
|
||||
{
|
||||
schemaItem = new QgsMssqlSchemaItem( this, layer.schemaName, mPath + '/' + layer.schemaName );
|
||||
schemaItem->setState( Populating );
|
||||
children.append( schemaItem );
|
||||
}
|
||||
|
||||
@ -246,12 +247,28 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
|
||||
|
||||
// spawn threads (new layers will be added later on)
|
||||
if ( mColumnTypeThread )
|
||||
{
|
||||
connect( mColumnTypeThread, SIGNAL( finished() ), this, SLOT( setChildrenAsPopulated() ) );
|
||||
mColumnTypeThread->start();
|
||||
}
|
||||
else
|
||||
{
|
||||
//set all as populated
|
||||
setChildrenAsPopulated();
|
||||
}
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
void QgsMssqlConnectionItem::setChildrenAsPopulated()
|
||||
{
|
||||
Q_FOREACH ( QgsDataItem *child, mChildren )
|
||||
{
|
||||
child->setState( Populated );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMssqlConnectionItem::setLayerType( QgsMssqlLayerProperty layerProperty )
|
||||
{
|
||||
QgsMssqlSchemaItem *schemaItem = nullptr;
|
||||
|
@ -77,6 +77,9 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
|
||||
|
||||
void refresh() override;
|
||||
|
||||
private slots:
|
||||
void setChildrenAsPopulated();
|
||||
|
||||
private:
|
||||
QString mConnInfo;
|
||||
QString mService;
|
||||
|
Loading…
x
Reference in New Issue
Block a user