From a8b193de0517591da9dc1a1379e7c92ac213e7e5 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Fri, 24 Jun 2016 23:12:33 +0300 Subject: [PATCH] Errors messages have been modified --- limereport/lrdatasourcemanager.cpp | 7 +++++-- limereport/lrdatasourcemanager.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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);