mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-26 05:18:11 +03:00
Merge branch '1.4' into 1.4_QJSEngine
This commit is contained in:
commit
84f4e92d1d
@ -735,6 +735,11 @@ void DataSourceManager::setReportSettings(ReportSettings *reportSettings)
|
|||||||
m_reportSettings = reportSettings;
|
m_reportSettings = reportSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DataSourceManager::checkConnection(QSqlDatabase db){
|
||||||
|
QSqlQuery query("Select 1",db);
|
||||||
|
return query.first();
|
||||||
|
}
|
||||||
|
|
||||||
bool DataSourceManager::connectConnection(ConnectionDesc *connectionDesc)
|
bool DataSourceManager::connectConnection(ConnectionDesc *connectionDesc)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -759,7 +764,10 @@ bool DataSourceManager::connectConnection(ConnectionDesc *connectionDesc)
|
|||||||
db.close();
|
db.close();
|
||||||
connected = initAndOpenDB(db, *connectionDesc);
|
connected = initAndOpenDB(db, *connectionDesc);
|
||||||
} else {
|
} else {
|
||||||
connected = db.isOpen();
|
//connected = db.isOpen();
|
||||||
|
connected = checkConnection(db);
|
||||||
|
if (!connected)
|
||||||
|
connected = initAndOpenDB(db, *connectionDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ protected:
|
|||||||
void setSystemVariable(const QString& name, const QVariant& value, RenderPass pass);
|
void setSystemVariable(const QString& name, const QVariant& value, RenderPass pass);
|
||||||
void setLastError(const QString& value);
|
void setLastError(const QString& value);
|
||||||
void invalidateLinkedDatasources(QString datasourceName);
|
void invalidateLinkedDatasources(QString datasourceName);
|
||||||
|
bool checkConnection(QSqlDatabase db);
|
||||||
private slots:
|
private slots:
|
||||||
void slotConnectionRenamed(const QString& oldName,const QString& newName);
|
void slotConnectionRenamed(const QString& oldName,const QString& newName);
|
||||||
void slotQueryTextChanged(const QString& queryName, const QString& queryText);
|
void slotQueryTextChanged(const QString& queryName, const QString& queryText);
|
||||||
|
Loading…
Reference in New Issue
Block a user