Skip to content

Commit

Permalink
Followup 75fcd2, fix incorrect refreshing icon if mssql connection
Browse files Browse the repository at this point in the history
loaded while collapsed
  • Loading branch information
nyalldawson committed Feb 5, 2016
1 parent 99cef42 commit 070b28a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/providers/mssql/qgsmssqldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
{
QgsDebugMsg( "Entered" );

setState( Populating );

stop();

QVector<QgsDataItem*> children;
Expand Down Expand Up @@ -248,25 +250,26 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
// spawn threads (new layers will be added later on)
if ( mColumnTypeThread )
{
connect( mColumnTypeThread, SIGNAL( finished() ), this, SLOT( setChildrenAsPopulated() ) );
connect( mColumnTypeThread, SIGNAL( finished() ), this, SLOT( setAsPopulated() ) );
mColumnTypeThread->start();
}
else
{
//set all as populated
setChildrenAsPopulated();
setAsPopulated();
}
}

return children;
}

void QgsMssqlConnectionItem::setChildrenAsPopulated()
void QgsMssqlConnectionItem::setAsPopulated()
{
Q_FOREACH ( QgsDataItem *child, mChildren )
{
child->setState( Populated );
}
setState( Populated );
}

void QgsMssqlConnectionItem::setLayerType( QgsMssqlLayerProperty layerProperty )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqldataitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
void refresh() override;

private slots:
void setChildrenAsPopulated();
void setAsPopulated();

private:
QString mConnInfo;
Expand Down

0 comments on commit 070b28a

Please sign in to comment.