From d07c44d6bb024df4552ef2b972d69c72896662fb Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Fri, 24 Jun 2016 23:06:35 +0300 Subject: [PATCH] ReportSetting has been added ReportSetting has been added --- include/lrglobal.cpp | 16 +++++++++++++++- include/lrglobal.h | 10 ++++++++++ limereport/lrglobal.cpp | 16 +++++++++++++++- limereport/lrglobal.h | 10 ++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/include/lrglobal.cpp b/include/lrglobal.cpp index 34bd880..47b31f0 100644 --- a/include/lrglobal.cpp +++ b/include/lrglobal.cpp @@ -31,10 +31,24 @@ #include #include "lrglobal.h" -QString LimeReport::extractClassName(QString className) +namespace LimeReport { + +QString extractClassName(QString className) { int startPos=className.lastIndexOf("::"); if(startPos==-1) startPos=0; else startPos+=2; return className.right(className.length()-startPos); } + +bool ReportSettings::suppressAbsentFieldsAndVarsWarnings() const +{ + return m_suppressAbsentFieldsAndVarsWarnings; +} + +void ReportSettings::setSuppressAbsentFieldsAndVarsWarnings(bool suppressAbsentFieldsAndVarsWarnings) +{ + m_suppressAbsentFieldsAndVarsWarnings = suppressAbsentFieldsAndVarsWarnings; +} + +} //namespace LimeReport diff --git a/include/lrglobal.h b/include/lrglobal.h index baf2bd8..4d1a456 100644 --- a/include/lrglobal.h +++ b/include/lrglobal.h @@ -84,6 +84,16 @@ namespace Const{ ReportError(const QString& message):std::runtime_error(message.toStdString()){} }; + class ReportSettings{ + public: + ReportSettings():m_suppressAbsentFieldsAndVarsWarnings(false){} + void setDefaultValues(){m_suppressAbsentFieldsAndVarsWarnings = false;} + bool suppressAbsentFieldsAndVarsWarnings() const; + void setSuppressAbsentFieldsAndVarsWarnings(bool suppressAbsentFieldsAndVarsWarnings); + private: + bool m_suppressAbsentFieldsAndVarsWarnings; + }; + } // namespace LimeReport diff --git a/limereport/lrglobal.cpp b/limereport/lrglobal.cpp index 34bd880..47b31f0 100644 --- a/limereport/lrglobal.cpp +++ b/limereport/lrglobal.cpp @@ -31,10 +31,24 @@ #include #include "lrglobal.h" -QString LimeReport::extractClassName(QString className) +namespace LimeReport { + +QString extractClassName(QString className) { int startPos=className.lastIndexOf("::"); if(startPos==-1) startPos=0; else startPos+=2; return className.right(className.length()-startPos); } + +bool ReportSettings::suppressAbsentFieldsAndVarsWarnings() const +{ + return m_suppressAbsentFieldsAndVarsWarnings; +} + +void ReportSettings::setSuppressAbsentFieldsAndVarsWarnings(bool suppressAbsentFieldsAndVarsWarnings) +{ + m_suppressAbsentFieldsAndVarsWarnings = suppressAbsentFieldsAndVarsWarnings; +} + +} //namespace LimeReport diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h index baf2bd8..4d1a456 100644 --- a/limereport/lrglobal.h +++ b/limereport/lrglobal.h @@ -84,6 +84,16 @@ namespace Const{ ReportError(const QString& message):std::runtime_error(message.toStdString()){} }; + class ReportSettings{ + public: + ReportSettings():m_suppressAbsentFieldsAndVarsWarnings(false){} + void setDefaultValues(){m_suppressAbsentFieldsAndVarsWarnings = false;} + bool suppressAbsentFieldsAndVarsWarnings() const; + void setSuppressAbsentFieldsAndVarsWarnings(bool suppressAbsentFieldsAndVarsWarnings); + private: + bool m_suppressAbsentFieldsAndVarsWarnings; + }; + } // namespace LimeReport