[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kreport] src: Add const
From:       Adam Pigg <adam () piggz ! co ! uk>
Date:       2016-04-25 20:45:08
Message-ID: E1aunNU-0004h7-3j () scm ! kde ! org
[Download RAW message or body]

Git commit cfd577120ae6f2d5e333fc0b5f7edf6113d053d0 by Adam Pigg.
Committed on 25/04/2016 at 20:44.
Pushed by piggz into branch 'master'.

Add const

M  +1    -1    src/common/KReportData.cpp
M  +1    -1    src/common/KReportData.h
M  +1    -1    src/plugins/chart/KReportItemChart.cpp
M  +2    -2    src/plugins/chart/KReportItemChart.h

http://commits.kde.org/kreport/cfd577120ae6f2d5e333fc0b5f7edf6113d053d0

diff --git a/src/common/KReportData.cpp b/src/common/KReportData.cpp
index ad02579..742a1db 100644
--- a/src/common/KReportData.cpp
+++ b/src/common/KReportData.cpp
@@ -72,7 +72,7 @@ QStringList KReportData::dataSourceNames() const
     return dataSources();
 }
 
-KReportData* KReportData::create(const QString &source)
+KReportData* KReportData::create(const QString &source) const
 {
     Q_UNUSED(source);
     return 0;
diff --git a/src/common/KReportData.h b/src/common/KReportData.h
index 46795ef..47fbbd2 100644
--- a/src/common/KReportData.h
+++ b/src/common/KReportData.h
@@ -114,7 +114,7 @@ public:
     //! Creates a new instance with data source. Default implementation returns @c nullptr.
     //! @a source is a driver-specific identifier.
     //! Owner of the returned pointer is the caller.
-    virtual KReportData* create(const QString &source);
+    virtual KReportData* create(const QString &source) const Q_REQUIRED_RESULT;
 };
 
 #endif
diff --git a/src/plugins/chart/KReportItemChart.cpp b/src/plugins/chart/KReportItemChart.cpp
index a8e0e9f..06d642b 100644
--- a/src/plugins/chart/KReportItemChart.cpp
+++ b/src/plugins/chart/KReportItemChart.cpp
@@ -214,7 +214,7 @@ void KReportItemChart::setColorScheme(const QString &cs)
     }
 }
 
-void KReportItemChart::setConnection(KReportData *c)
+void KReportItemChart::setConnection(const KReportData *c)
 {
     m_reportData = c;
     populateData();
diff --git a/src/plugins/chart/KReportItemChart.h b/src/plugins/chart/KReportItemChart.h
index a21b946..0c1a1c7 100644
--- a/src/plugins/chart/KReportItemChart.h
+++ b/src/plugins/chart/KReportItemChart.h
@@ -52,7 +52,7 @@ public:
     @brief Perform the query for the chart and set the charts data
     */
     void populateData();
-    void setConnection(KReportData*);
+    void setConnection(const KReportData *c);
 
     /**
     @brief Set the value of a field from the master (report) data set
@@ -105,7 +105,7 @@ protected:
 
 private:
     virtual void createProperties();
-    KReportData *m_reportData;
+    const KReportData *m_reportData;
 
     friend class Scripting::Chart;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic