diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index 1e7d5b9..d140a16 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -323,13 +323,16 @@ QSharedPointerDataSourceManager::previewSQL(const QString &c query.exec(); model->setQuery(query); m_lastError = model->lastError().text(); + putError(m_lastError); if (model->query().isActive()) return QSharedPointer(model); else return QSharedPointer(0); } - if (!db.isOpen()) + if (!db.isOpen()){ m_lastError = tr("Connection \"%1\" is not open").arg(connectionName); + putError(m_lastError); + } return QSharedPointer(0); } @@ -657,7 +660,7 @@ void DataSourceManager::putProxyDesc(ProxyDesc *proxyDesc) bool DataSourceManager::connectConnection(ConnectionDesc *connectionDesc) { bool connected = false; - clearErrorsList(); + clearErrors(); QString lastError =""; foreach(QString datasourceName, dataSourceNames()){ diff --git a/limereport/lrdatasourcemanager.h b/limereport/lrdatasourcemanager.h index 494ec20..aac8778 100644 --- a/limereport/lrdatasourcemanager.h +++ b/limereport/lrdatasourcemanager.h @@ -178,7 +178,7 @@ public: QString lastError() const { return m_lastError;} void putError(QString error){ if (!m_errorsList.contains(error)) m_errorsList.append(error);} - void clearErrorsList(){ m_errorsList.clear();} + void clearErrors(){ m_errorsList.clear(); m_lastError = "";} QStringList errorsList(){ return m_errorsList;} bool designTime() const; void setDesignTime(bool designTime);