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

List:       kde-commits
Subject:    [kexi] src/plugins/reports: Disable unimplemented report exports
From:       Adam Pigg <null () kde ! org>
Date:       2017-05-13 22:36:23
Message-ID: E1d9feB-0005WC-9G () code ! kde ! org
[Download RAW message or body]

Git commit 4702bbe10c639e2e3b0aa8b72803e218394b302e by Adam Pigg.
Committed on 13/05/2017 at 22:35.
Pushed by piggz into branch 'master'.

Disable unimplemented report exports

Summary: ifdef out the unimented functions

Reviewers: staniek

Reviewed By: staniek

Tags: #kexi

Maniphest Tasks: T4075

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

M  +12   -3    src/plugins/reports/kexireportview.cpp
M  +3    -1    src/plugins/reports/kexireportview.h

https://commits.kde.org/kexi/4702bbe10c639e2e3b0aa8b72803e218394b302e

diff --git a/src/plugins/reports/kexireportview.cpp \
b/src/plugins/reports/kexireportview.cpp index 88f174b1a..2fa3399f6 100644
--- a/src/plugins/reports/kexireportview.cpp
+++ b/src/plugins/reports/kexireportview.cpp
@@ -94,12 +94,14 @@ KexiReportView::KexiReportView(QWidget *parent)
     exportMenu->setDelayed(false);
 #endif
 
+#ifdef KEXI_SHOW_UNFINISHED
 #ifdef KEXI_MOBILE
     viewActions << (a = new QAction(xi18n("Export:"), this));
     a->setEnabled(false); //!TODO this is a bit of a dirty way to add what looks \
                like a label to the toolbar!
     // " ", not "", is said to be needed in maemo, the icon didn't display properly \
                without it
     viewActions << (a = new \
QAction(koIcon("application-vnd.oasis.opendocument.text"), QLatin1String(" "), \
this));  #else
+
     exportMenu->addAction(a = new \
                QAction(koIcon("application-vnd.oasis.opendocument.text"),
                                           xi18nc("open dialog to export as text \
document", "Text Document..."), this));  #endif
@@ -108,6 +110,7 @@ KexiReportView::KexiReportView(QWidget *parent)
     a->setWhatsThis(xi18n("Exports the report as a text document (in OpenDocument \
Text format)."));  a->setEnabled(true);
     connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsTextDocument()));
+#endif
 
 #ifdef KEXI_MOBILE
     viewActions << (a = new QAction(koIcon("application-pdf"), QLatin1String(" "), \
this)); @@ -121,6 +124,7 @@ KexiReportView::KexiReportView(QWidget *parent)
     a->setEnabled(true);
     connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsPdf()));
 
+#ifdef KEXI_SHOW_UNFINISHED
 #ifdef KEXI_MOBILE
     viewActions << (a = new \
QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"), QLatin1String(" "), \
this));  #else
@@ -133,6 +137,8 @@ KexiReportView::KexiReportView(QWidget *parent)
     a->setEnabled(true);
     connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsSpreadsheet()));
 
+#endif
+
 #ifdef KEXI_MOBILE
     viewActions << (a = new QAction(koIcon("text-html"), QLatin1String(" "), this));
 #else
@@ -246,6 +252,8 @@ void KexiReportView::openExportedDocument(const QUrl \
&destination)  }
 }
 
+#ifdef KEXI_SHOW_UNFINISHED
+
 void KexiReportView::slotExportAsSpreadsheet()
 {
     QScopedPointer<KReportRendererBase> renderer(m_factory.createInstance("ods"));
@@ -293,6 +301,7 @@ void KexiReportView::slotExportAsTextDocument()
         }
     }
 }
+#endif
 
 void KexiReportView::slotExportAsWebPage()
 {
@@ -368,18 +377,18 @@ tristate KexiReportView::afterSwitchFrom(Kexi::ViewMode mode)
             //If using a kexidb source, add a functions scripting object
             if (tempData()->connectionDefinition.attribute("type") == "internal") {
                 m_functions = new KRScriptFunctions(reportData, \
                KexiMainWindowIface::global()->project()->dbConnection());
-            
+
                 m_preRenderer->registerScriptObject(m_functions, "field");
                 connect(m_preRenderer, SIGNAL(groupChanged(QMap<QString, \
                QVariant>)),
                         m_functions, SLOT(setGroupData(QMap<QString, QVariant>)));
             }
             connect(m_preRenderer, SIGNAL(finishedAllASyncItems()), this, \
                SLOT(finishedAllASyncItems()));
-            
+
             if (!m_preRenderer->generateDocument()) {
                 qWarning() << "Could not generate report document";
                 return false;
             }
-            
+
             m_reportView->setDocument(m_preRenderer->document());
 #ifndef KEXI_MOBILE
             m_pageSelector->setRecordCount(m_reportView->pageCount());
diff --git a/src/plugins/reports/kexireportview.h \
b/src/plugins/reports/kexireportview.h index 96c33fdd8..607810daf 100644
--- a/src/plugins/reports/kexireportview.h
+++ b/src/plugins/reports/kexireportview.h
@@ -81,9 +81,11 @@ private:
 private Q_SLOTS:
     void slotPrintReport();
     void slotExportAsPdf();
-    void slotExportAsSpreadsheet();
     void slotExportAsWebPage();
+#ifdef KEXI_SHOW_UNFINISHED
+    void slotExportAsSpreadsheet();
     void slotExportAsTextDocument();
+#endif
     void openExportedDocument(const QUrl &destination);
     void finishedAllASyncItems();
 };


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

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