Skip to content
Permalink
Browse files

Fix mssql browser items not correctly populated before refreshing

  • Loading branch information
nyalldawson committed Feb 3, 2016
1 parent 316a941 commit 75fcd2d0d24b4c5d95742db93d96b19b69bcb23d
Showing with 20 additions and 0 deletions.
  1. +17 −0 src/providers/mssql/qgsmssqldataitems.cpp
  2. +3 −0 src/providers/mssql/qgsmssqldataitems.h
@@ -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;

0 comments on commit 75fcd2d

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