Skip to content

Commit

Permalink
[MSSQL] Fix refresh in browser node
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 21, 2014
1 parent 9e67d7a commit 15e1129
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/providers/mssql/qgsmssqldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, QString nam
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
}

QgsMssqlConnectionItem::~QgsMssqlConnectionItem()
{
}

void QgsMssqlConnectionItem::readConnectionSettings()
{
QSettings settings;
QString key = "/MSSQL/connections/" + mName;
mService = settings.value( key + "/service" ).toString();
Expand All @@ -63,10 +71,6 @@ QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, QString nam
mConnInfo += " estimatedmetadata=true";
}

QgsMssqlConnectionItem::~QgsMssqlConnectionItem()
{
}

void QgsMssqlConnectionItem::refresh()
{
QgsDebugMsg( "mPath = " + mPath );
Expand Down Expand Up @@ -95,6 +99,7 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()

QVector<QgsDataItem*> children;

readConnectionSettings();
QSqlDatabase db = QgsMssqlProvider::GetDatabase( mService,
mHost, mDatabase, mUsername, mPassword );

Expand Down
2 changes: 2 additions & 0 deletions src/providers/mssql/qgsmssqldataitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
bool mUseGeometryColumns;
bool mUseEstimatedMetadata;
bool mAllowGeometrylessTables;

void readConnectionSettings();
};

class QgsMssqlSchemaItem : public QgsDataCollectionItem
Expand Down

0 comments on commit 15e1129

Please sign in to comment.