Changeset View
Changeset View
Standalone View
Standalone View
kexi/plugins/reports/kexisourceselector.cpp
Show All 11 Lines | |||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * Lesser General Public License for more details. | 13 | * Lesser General Public License for more details. | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU Lesser General Public | 15 | * You should have received a copy of the GNU Lesser General Public | ||
16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "kexisourceselector.h" | 19 | #include "kexisourceselector.h" | ||
20 | #include "kexireportview.h" | ||||
21 | #include <kexiproject.h> | ||||
22 | #include "KexiDataSourceComboBox.h" | ||||
23 | #include <core/KexiMainWindowIface.h> | ||||
24 | #include <core/KexiWindow.h> | ||||
20 | 25 | | |||
21 | #include <kpushbutton.h> | 26 | #include <kpushbutton.h> | ||
22 | #include <klineedit.h> | 27 | #include <klineedit.h> | ||
23 | | ||||
24 | #include <QLabel> | | |||
25 | #include <klocale.h> | 28 | #include <klocale.h> | ||
26 | #include <kdebug.h> | 29 | #include <kdebug.h> | ||
30 | | ||||
27 | #include <QDomElement> | 31 | #include <QDomElement> | ||
28 | #include "KexiDataSourceComboBox.h" | 32 | #include <QLabel> | ||
29 | #include <kexiproject.h> | | |||
30 | 33 | | |||
31 | //#define NO_EXTERNAL_SOURCES | 34 | //#define NO_EXTERNAL_SOURCES | ||
32 | 35 | | |||
33 | #ifdef NO_EXTERNAL_SOURCES | 36 | #ifdef NO_EXTERNAL_SOURCES | ||
34 | #ifdef __GNUC__ | 37 | #ifdef __GNUC__ | ||
35 | #warning enable external data sources for 2.3 | 38 | #warning enable external data sources for 2.3 | ||
36 | #else | 39 | #else | ||
37 | #pragma WARNING( enable external data sources for 2.3 ) | 40 | #pragma WARNING( enable external data sources for 2.3 ) | ||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 175 | #ifndef KEXI_MOBILE | |||
173 | if (d->kexiMigrateData) { | 176 | if (d->kexiMigrateData) { | ||
174 | delete d->kexiMigrateData; | 177 | delete d->kexiMigrateData; | ||
175 | d->kexiMigrateData = 0; | 178 | d->kexiMigrateData = 0; | ||
176 | } | 179 | } | ||
177 | #endif | 180 | #endif | ||
178 | 181 | | |||
179 | //!@TODO Fix when enable external data | 182 | //!@TODO Fix when enable external data | ||
180 | #ifndef NO_EXTERNAL_SOURCES | 183 | #ifndef NO_EXTERNAL_SOURCES | ||
184 | KexiReportView *view = 0; | ||||
185 | if (KexiMainWindowIface::global()->currentWindow()) { | ||||
186 | view = qobject_cast<KexiReportView*>(KexiMainWindowIface::global()->currentWindow()->selectedView()); | ||||
187 | if (!view) { | ||||
188 | return 0; | ||||
189 | } | ||||
190 | } | ||||
181 | if (d->sourceType->itemData(d->sourceType->currentIndex()).toString() == "internal" && d->internalSource->isSelectionValid()) { | 191 | if (d->sourceType->itemData(d->sourceType->currentIndex()).toString() == "internal" && d->internalSource->isSelectionValid()) { | ||
182 | d->kexiDBData = new KexiDBReportData(d->internalSource->selectedName(), d->internalSource->selectedPartClass(), d->conn); | 192 | d->kexiDBData = new KexiDBReportData(d->internalSource->selectedName(), | ||
193 | d->internalSource->selectedPartClass(), | ||||
194 | d->conn, view); | ||||
183 | return d->kexiDBData; | 195 | return d->kexiDBData; | ||
184 | } | 196 | } | ||
185 | 197 | | |||
186 | #ifndef KEXI_MOBILE | 198 | #ifndef KEXI_MOBILE | ||
187 | if (d->sourceType->itemData(d->sourceType->currentIndex()).toString() == "external") { | 199 | if (d->sourceType->itemData(d->sourceType->currentIndex()).toString() == "external") { | ||
188 | d->kexiMigrateData = new KexiMigrateReportData(d->externalSource->text()); | 200 | d->kexiMigrateData = new KexiMigrateReportData(d->externalSource->text()); | ||
189 | return d->kexiMigrateData; | 201 | return d->kexiMigrateData; | ||
190 | } | 202 | } | ||
Show All 15 Lines |