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

List:       kde-commits
Subject:    [kexi] src/plugins/reports: Missing commit from 2.9, ported to KDb 3
From:       Adam Pigg <null () kde ! org>
Date:       2017-05-16 21:54:20
Message-ID: E1dAkQ8-0006Pg-IQ () code ! kde ! org
[Download RAW message or body]

Git commit bc1f88131b360d3834b66c9b67844417936c9b19 by Adam Pigg.
Committed on 16/05/2017 at 21:54.
Pushed by piggz into branch 'master'.

Missing commit from 2.9, ported to KDb 3

Summary: Unable to test as scripting not yet implemented in Kexi

Test Plan: If it compiles, ship it!

Reviewers: staniek

Reviewed By: staniek

Tags: #kexi

Maniphest Tasks: T1744

Differential Revision: https://phabricator.kde.org/D5893

M  +13   -4    src/plugins/reports/krscriptfunctions.cpp

https://commits.kde.org/kexi/bc1f88131b360d3834b66c9b67844417936c9b19

diff --git a/src/plugins/reports/krscriptfunctions.cpp \
b/src/plugins/reports/krscriptfunctions.cpp index 6eb2f3df4..eb205178b 100644
--- a/src/plugins/reports/krscriptfunctions.cpp
+++ b/src/plugins/reports/krscriptfunctions.cpp
@@ -21,16 +21,25 @@
 
 #include <KDbConnection>
 #include <KDbCursor>
+#include <KDbNativeStatementBuilder>
 
 #include <QDebug>
 
-KRScriptFunctions::KRScriptFunctions(const KReportDataSource* kodata, KDbConnection* \
conn) +KRScriptFunctions::KRScriptFunctions(const KReportDataSource* datasource, \
KDbConnection* conn)  {
-    m_cursor = kodata;
+    m_cursor = datasource;
     m_connection = conn;
 
-    if (kodata) {
-        m_source = kodata->sourceName();
+    if (datasource) {
+        if (m_connection->containsTable(datasource->sourceName()) == true) {
+            m_source = datasource->sourceName();
+        } else if (m_connection->querySchema(datasource->sourceName())) {
+            KDbNativeStatementBuilder builder(conn);
+            KDbEscapedString source;
+            if (builder.generateSelectStatement(&source, \
m_connection->querySchema(datasource->sourceName()))) { +                m_source = \
source.toByteArray(); +            }
+        }
     }
 }
 


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

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