mirror of
				https://github.com/fralx/LimeReport.git
				synced 2025-11-04 15:11:26 +03:00 
			
		
		
		
	Databrowser fixed
This commit is contained in:
		@@ -702,7 +702,7 @@ void DataBrowser::on_dataTree_currentItemChanged(QTreeWidgetItem *current, QTree
 | 
				
			|||||||
    Q_UNUSED(previous)
 | 
					    Q_UNUSED(previous)
 | 
				
			||||||
    if (current&&(current->type() == DataBrowserTree::Connection)) {
 | 
					    if (current&&(current->type() == DataBrowserTree::Connection)) {
 | 
				
			||||||
        bool internalConnection = m_report->dataManager()->connectionByName(ConnectionDesc::connectionNameForReport(current->text(0)));
 | 
					        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"));
 | 
					            ui->pbConnect->setIcon(QIcon(":/databrowser/images/plug-connect.png"));
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            ui->pbConnect->setIcon(QIcon(":/databrowser/images/plug-disconnect.png"));
 | 
					            ui->pbConnect->setIcon(QIcon(":/databrowser/images/plug-disconnect.png"));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -652,15 +652,18 @@ void DataSourceManager::removeConnection(const QString &connectionName)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    QList<ConnectionDesc*>::iterator cit = m_connections.begin();
 | 
					    QList<ConnectionDesc*>::iterator cit = m_connections.begin();
 | 
				
			||||||
    while( cit != m_connections.end() ){
 | 
					    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);
 | 
					                QSqlDatabase db = QSqlDatabase::database(connectionName);
 | 
				
			||||||
                db.close();
 | 
					                db.close();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            QSqlDatabase::removeDatabase(connectionName);
 | 
					            QSqlDatabase::removeDatabase(connectionName);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
            delete (*cit);
 | 
					            delete (*cit);
 | 
				
			||||||
            cit = m_connections.erase(cit);
 | 
					            cit = m_connections.erase(cit);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            cit++;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    emit datasourcesChanged();
 | 
					    emit datasourcesChanged();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user