Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/scripting/kexidb/kexidbparser.cpp
Show All 35 Lines | |||||
36 | KexiDBParser::~KexiDBParser() | 36 | KexiDBParser::~KexiDBParser() | ||
37 | { | 37 | { | ||
38 | if (m_owner) | 38 | if (m_owner) | ||
39 | delete m_parser; | 39 | delete m_parser; | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | bool KexiDBParser::parse(const QString& sql) | 42 | bool KexiDBParser::parse(const QString& sql) | ||
43 | { | 43 | { | ||
44 | return m_parser->parse(sql); | 44 | return m_parser->parse(KDbEscapedString(sql)); | ||
45 | } | 45 | } | ||
46 | void KexiDBParser::clear() | 46 | void KexiDBParser::clear() | ||
47 | { | 47 | { | ||
48 | m_parser->clear(); | 48 | m_parser->reset(); | ||
49 | } | 49 | } | ||
50 | const QString KexiDBParser::operation() | 50 | QString KexiDBParser::operation() const | ||
staniek: const QString -> QString | |||||
51 | { | 51 | { | ||
52 | return m_parser->operationString(); | 52 | return m_parser->statementTypeString(); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | QObject* KexiDBParser::table() | 55 | QObject* KexiDBParser::table() | ||
56 | { | 56 | { | ||
57 | KDbTableSchema* t = m_parser->table(); | 57 | KDbTableSchema* t = m_parser->table(); | ||
58 | return t ? new KexiDBTableSchema(this, t, false) : 0; | 58 | return t ? new KexiDBTableSchema(this, t, false) : 0; | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | QObject* KexiDBParser::query() | 61 | QObject* KexiDBParser::query() | ||
62 | { | 62 | { | ||
63 | KDbQuerySchema* q = m_parser->query(); | 63 | KDbQuerySchema* q = m_parser->query(); | ||
64 | return q ? new KexiDBQuerySchema(this, q, false) : 0; | 64 | return q ? new KexiDBQuerySchema(this, q, false) : 0; | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | QObject* KexiDBParser::connection() | 67 | QObject* KexiDBParser::connection() | ||
68 | { | 68 | { | ||
69 | return m_connection; | 69 | return m_connection; | ||
70 | } | 70 | } | ||
71 | const QString KexiDBParser::statement() | 71 | QString KexiDBParser::statement() const | ||
staniek: const QString -> QString | |||||
72 | { | 72 | { | ||
73 | return m_parser->statement(); | 73 | return m_parser->statement().toString(); | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | const QString KexiDBParser::errorType() | 76 | QString KexiDBParser::errorType() const | ||
staniek: const QString -> QString | |||||
77 | { | 77 | { | ||
78 | return m_parser->error().type(); | 78 | return m_parser->error().type(); | ||
79 | } | 79 | } | ||
80 | const QString KexiDBParser::errorMsg() | 80 | QString KexiDBParser::errorMsg() const | ||
staniek: const QString -> QString | |||||
81 | { | 81 | { | ||
82 | return m_parser->error().error(); | 82 | return m_parser->error().message(); | ||
83 | } | 83 | } | ||
84 | int KexiDBParser::errorAt() | 84 | int KexiDBParser::errorAt() const | ||
85 | { | 85 | { | ||
86 | return m_parser->error().at(); | 86 | return m_parser->error().position(); | ||
87 | } | 87 | } | ||
88 | 88 | |
const QString -> QString