0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 09:04:39 +03:00

Finish 1.4.47

This commit is contained in:
Arin Alexander 2017-10-24 01:54:56 +03:00
commit ed72ce10e1
6 changed files with 15 additions and 11 deletions

View File

@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 4 LIMEREPORT_VERSION_MINOR = 4
LIMEREPORT_VERSION_RELEASE = 43 LIMEREPORT_VERSION_RELEASE = 47
LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"'
DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"

View File

@ -118,9 +118,9 @@ void QueryHolder::setConnectionName(QString connectionName)
m_connectionName=connectionName; m_connectionName=connectionName;
} }
void QueryHolder::invalidate(IDataSource::DatasourceMode mode){ void QueryHolder::invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed){
QSqlDatabase db = QSqlDatabase::database(m_connectionName); QSqlDatabase db = QSqlDatabase::database(m_connectionName);
if (!db.isValid()){ if (!db.isValid() || dbWillBeClosed){
setLastError(QObject::tr("Invalid connection! %1").arg(m_connectionName)); setLastError(QObject::tr("Invalid connection! %1").arg(m_connectionName));
delete m_query; delete m_query;
m_dataSource.clear(); m_dataSource.clear();
@ -552,9 +552,10 @@ IDataSource *ProxyHolder::dataSource(IDataSource::DatasourceMode mode)
return m_datasource.data(); return m_datasource.data();
} }
void ProxyHolder::invalidate(IDataSource::DatasourceMode mode) void ProxyHolder::invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed)
{ {
Q_UNUSED(mode) Q_UNUSED(mode)
Q_UNUSED(dbWillBeClosed);
if (m_model && m_model->isInvalid()){ if (m_model && m_model->isInvalid()){
m_invalid = true; m_invalid = true;
m_lastError = tr("Datasource has been invalidated"); m_lastError = tr("Datasource has been invalidated");

View File

@ -74,7 +74,7 @@ public:
virtual bool isOwned() const = 0; virtual bool isOwned() const = 0;
virtual bool isEditable() const = 0; virtual bool isEditable() const = 0;
virtual bool isRemovable() const = 0; virtual bool isRemovable() const = 0;
virtual void invalidate(IDataSource::DatasourceMode mode) = 0; virtual void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed = false) = 0;
virtual void update() = 0; virtual void update() = 0;
virtual void clearErrors() = 0; virtual void clearErrors() = 0;
virtual ~IDataSourceHolder(){} virtual ~IDataSourceHolder(){}
@ -91,7 +91,7 @@ public:
QString lastError() const { return m_dataSource->lastError(); } QString lastError() const { return m_dataSource->lastError(); }
bool isEditable() const { return false; } bool isEditable() const { return false; }
bool isRemovable() const { return false; } bool isRemovable() const { return false; }
void invalidate(IDataSource::DatasourceMode mode){Q_UNUSED(mode)} void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed = false){Q_UNUSED(mode) Q_UNUSED(dbWillBeClosed)}
void update(){} void update(){}
void clearErrors(){} void clearErrors(){}
signals: signals:
@ -200,7 +200,7 @@ public:
bool isPrepared() const {return m_prepared;} bool isPrepared() const {return m_prepared;}
QString lastError() const { return m_lastError; } QString lastError() const { return m_lastError; }
void setLastError(QString value){m_lastError=value; if (m_query) {delete m_query; m_query=0;}} void setLastError(QString value){m_lastError=value; if (m_query) {delete m_query; m_query=0;}}
void invalidate(IDataSource::DatasourceMode mode); void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed = false);
void update(); void update();
void clearErrors(){setLastError("");} void clearErrors(){setLastError("");}
DataSourceManager* dataManager() const {return m_dataManager;} DataSourceManager* dataManager() const {return m_dataManager;}
@ -330,7 +330,7 @@ public:
bool isEditable() const { return true; } bool isEditable() const { return true; }
bool isRemovable() const { return true; } bool isRemovable() const { return true; }
QString lastError() const { return m_lastError; } QString lastError() const { return m_lastError; }
void invalidate(IDataSource::DatasourceMode mode); void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed = false);
void update(){} void update(){}
void clearErrors(){m_lastError = "";} void clearErrors(){m_lastError = "";}
DataSourceManager* dataManager() const {return m_dataManger;} DataSourceManager* dataManager() const {return m_dataManger;}
@ -420,7 +420,7 @@ public:
bool isOwned() const {return m_owned;} bool isOwned() const {return m_owned;}
bool isEditable() const {return false;} bool isEditable() const {return false;}
bool isRemovable() const {return false;} bool isRemovable() const {return false;}
void invalidate(IDataSource::DatasourceMode mode){Q_UNUSED(mode)} void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed = false){Q_UNUSED(mode) Q_UNUSED(dbWillBeClosed)}
~CallbackDatasourceHolder(){delete m_datasource;} ~CallbackDatasourceHolder(){delete m_datasource;}
void update(){} void update(){}
void clearErrors(){} void clearErrors(){}

View File

@ -930,7 +930,7 @@ void DataSourceManager::disconnectConnection(const QString& connectionName)
if (isQuery(datasourceName) || isSubQuery(datasourceName)){ if (isQuery(datasourceName) || isSubQuery(datasourceName)){
QueryHolder* qh = dynamic_cast<QueryHolder*>(dataSourceHolder(datasourceName)); QueryHolder* qh = dynamic_cast<QueryHolder*>(dataSourceHolder(datasourceName));
if (qh && qh->connectionName().compare(connectionName,Qt::CaseInsensitive)==0){ if (qh && qh->connectionName().compare(connectionName,Qt::CaseInsensitive)==0){
qh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE); qh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE, true);
qh->setLastError(tr("invalid connection")); qh->setLastError(tr("invalid connection"));
} }
} }

View File

@ -637,6 +637,9 @@ void ReportDesignWidget::slotPagePropertyObjectNameChanged(const QString &oldVal
void ReportDesignWidget::slotTabMoved(int from, int to) void ReportDesignWidget::slotTabMoved(int from, int to)
{ {
Q_UNUSED(from)
Q_UNUSED(to)
QList<PageDesignIntf*> pages; QList<PageDesignIntf*> pages;
for ( int i = 0; i < m_tabWidget->tabBar()->count(); ++i){ for ( int i = 0; i < m_tabWidget->tabBar()->count(); ++i){

View File

@ -364,7 +364,7 @@ bool ReportEnginePrivate::printToPDF(const QString &fileName)
void ReportEnginePrivate::previewReport(PreviewHints hints) void ReportEnginePrivate::previewReport(PreviewHints hints)
{ {
QTime start = QTime::currentTime(); // QTime start = QTime::currentTime();
try{ try{
dataManager()->setDesignTime(false); dataManager()->setDesignTime(false);
ReportPages pages = renderToPages(); ReportPages pages = renderToPages();