Skip to content

Commit

Permalink
Databrowser fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
fralx committed Oct 27, 2017
2 parents eb370da + 9980966 commit 00bc175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion limereport/databrowser/lrdatabrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ void DataBrowser::on_dataTree_currentItemChanged(QTreeWidgetItem *current, QTree
Q_UNUSED(previous)
if (current&&(current->type() == DataBrowserTree::Connection)) {
bool internalConnection = m_report->dataManager()->connectionByName(ConnectionDesc::connectionNameForReport(current->text(0)));
if (m_report->dataManager()->isConnectionConnected(current->text(0))){
if (m_report->dataManager()->isConnectionConnected(ConnectionDesc::connectionNameForReport(current->text(0)))){
ui->pbConnect->setIcon(QIcon(":/databrowser/images/plug-connect.png"));
} else {
ui->pbConnect->setIcon(QIcon(":/databrowser/images/plug-disconnect.png"));
Expand Down
9 changes: 6 additions & 3 deletions limereport/lrdatasourcemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,18 @@ void DataSourceManager::removeConnection(const QString &connectionName)
{
QList<ConnectionDesc*>::iterator cit = m_connections.begin();
while( cit != m_connections.end() ){
if ( ((*cit)->name().compare(connectionName) == 0) && (*cit)->isInternal() ){
if ( ((*cit)->name().compare(connectionName) == 0) ){
if ((*cit)->isInternal())
{
QSqlDatabase db = QSqlDatabase::database(connectionName);
db.close();
}
QSqlDatabase::removeDatabase(connectionName);
delete (*cit);
cit = m_connections.erase(cit);
} else {
cit++;
}
delete (*cit);
cit = m_connections.erase(cit);
}
emit datasourcesChanged();
}
Expand Down

0 comments on commit 00bc175

Please sign in to comment.