Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/importexport/csv/KexiCsvImportExportPlugin.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
72 | 72 | | |||
73 | bool KexiCsvImportExportPlugin::executeCommand(const char* commandName, | 73 | bool KexiCsvImportExportPlugin::executeCommand(const char* commandName, | ||
74 | QMap<QString, QString>* args) | 74 | QMap<QString, QString>* args) | ||
75 | { | 75 | { | ||
76 | if (0 == qstrcmp(commandName, "KexiCSVExport")) { | 76 | if (0 == qstrcmp(commandName, "KexiCSVExport")) { | ||
77 | KexiCSVExport::Options options; | 77 | KexiCSVExport::Options options; | ||
78 | if (!options.assign(args)) | 78 | if (!options.assign(args)) | ||
79 | return false; | 79 | return false; | ||
80 | KDbTableOrQuerySchema tableOrQuery( | 80 | KDbConnection *conn = KexiMainWindowIface::global()->project()->dbConnection(); | ||
81 | KexiMainWindowIface::global()->project()->dbConnection(), options.itemId); | 81 | KDbTableOrQuerySchema tableOrQuery(conn, options.itemId); | ||
82 | QTextStream *stream = 0; | 82 | QTextStream *stream = 0; | ||
83 | if (args->contains("textStream")) { | 83 | if (args->contains("textStream")) { | ||
84 | stream = KDbUtils::stringToPointer<QTextStream>(args->value("textStream")); | 84 | stream = KDbUtils::stringToPointer<QTextStream>(args->value("textStream")); | ||
85 | } | 85 | } | ||
86 | return KexiCSVExport::exportData(&tableOrQuery, options, -1, stream); | 86 | return KexiCSVExport::exportData(conn, &tableOrQuery, options, -1, stream); | ||
87 | } | 87 | } | ||
88 | return false; | 88 | return false; | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | #include "KexiCsvImportExportPlugin.moc" | 91 | #include "KexiCsvImportExportPlugin.moc" |