Changeset View
Changeset View
Standalone View
Standalone View
src/KDbQuerySchema_p.cpp
Show All 19 Lines | |||||
20 | #include "KDbQuerySchema_p.h" | 20 | #include "KDbQuerySchema_p.h" | ||
21 | #include "KDbOrderByColumn.h" | 21 | #include "KDbOrderByColumn.h" | ||
22 | 22 | | |||
23 | KDbQuerySchema::Private::Private(KDbQuerySchema* q, Private* copy) | 23 | KDbQuerySchema::Private::Private(KDbQuerySchema* q, Private* copy) | ||
24 | : query(q) | 24 | : query(q) | ||
25 | , masterTable(nullptr) | 25 | , masterTable(nullptr) | ||
26 | , fakeRecordIdField(nullptr) | 26 | , fakeRecordIdField(nullptr) | ||
27 | , fakeRecordIdCol(nullptr) | 27 | , fakeRecordIdCol(nullptr) | ||
28 | , conn(nullptr) | | |||
29 | , maxIndexWithAlias(-1) | 28 | , maxIndexWithAlias(-1) | ||
30 | , visibility(64) | 29 | , visibility(64) | ||
31 | , fieldsExpanded(nullptr) | 30 | , fieldsExpanded(nullptr) | ||
32 | , visibleFieldsExpanded(nullptr) | 31 | , visibleFieldsExpanded(nullptr) | ||
33 | , internalFields(nullptr) | 32 | , internalFields(nullptr) | ||
34 | , fieldsExpandedWithInternalAndRecordId(nullptr) | 33 | , fieldsExpandedWithInternalAndRecordId(nullptr) | ||
35 | , visibleFieldsExpandedWithInternalAndRecordId(nullptr) | 34 | , visibleFieldsExpandedWithInternalAndRecordId(nullptr) | ||
36 | , fieldsExpandedWithInternal(nullptr) | 35 | , fieldsExpandedWithInternal(nullptr) | ||
Show All 28 Lines | 49 | if (copy) { | |||
65 | ownedVisibleColumns = nullptr; | 64 | ownedVisibleColumns = nullptr; | ||
66 | fieldsExpandedWithInternalAndRecordId = nullptr; | 65 | fieldsExpandedWithInternalAndRecordId = nullptr; | ||
67 | visibleFieldsExpandedWithInternalAndRecordId = nullptr; | 66 | visibleFieldsExpandedWithInternalAndRecordId = nullptr; | ||
68 | fieldsExpandedWithInternal = nullptr; | 67 | fieldsExpandedWithInternal = nullptr; | ||
69 | visibleFieldsExpandedWithInternal = nullptr; | 68 | visibleFieldsExpandedWithInternal = nullptr; | ||
70 | pkeyFieldsOrder = nullptr; | 69 | pkeyFieldsOrder = nullptr; | ||
71 | fakeRecordIdCol = nullptr; | 70 | fakeRecordIdCol = nullptr; | ||
72 | fakeRecordIdField = nullptr; | 71 | fakeRecordIdField = nullptr; | ||
73 | conn = nullptr; | | |||
74 | ownedVisibleColumns = nullptr; | 72 | ownedVisibleColumns = nullptr; | ||
75 | // </clear, so computeFieldsExpanded() will re-create it> | 73 | // </clear, so computeFieldsExpanded() will re-create it> | ||
76 | if (!copy->whereExpr.isNull()) { | 74 | if (!copy->whereExpr.isNull()) { | ||
77 | whereExpr = copy->whereExpr.clone(); | 75 | whereExpr = copy->whereExpr.clone(); | ||
78 | } | 76 | } | ||
79 | // "*this = *copy" causes copying pointers; pull of them without destroying, | 77 | // "*this = *copy" causes copying pointers; pull of them without destroying, | ||
80 | // will be deep-copied in the KDbQuerySchema ctor. | 78 | // will be deep-copied in the KDbQuerySchema ctor. | ||
81 | asterisks.setAutoDelete(false); | 79 | asterisks.setAutoDelete(false); | ||
Show All 25 Lines | 103 | if (internalFields) { | |||
107 | delete internalFields; | 105 | delete internalFields; | ||
108 | } | 106 | } | ||
109 | delete fieldsExpandedWithInternalAndRecordId; | 107 | delete fieldsExpandedWithInternalAndRecordId; | ||
110 | delete visibleFieldsExpandedWithInternalAndRecordId; | 108 | delete visibleFieldsExpandedWithInternalAndRecordId; | ||
111 | delete fieldsExpandedWithInternal; | 109 | delete fieldsExpandedWithInternal; | ||
112 | delete visibleFieldsExpandedWithInternal; | 110 | delete visibleFieldsExpandedWithInternal; | ||
113 | } | 111 | } | ||
114 | 112 | | |||
115 | //static | | |||
116 | KDbQuerySchema* KDbQuerySchema::Private::createQuery(KDbConnection *conn) | | |||
117 | { | | |||
118 | return new KDbQuerySchema(conn); | | |||
119 | } | | |||
120 | | ||||
121 | void KDbQuerySchema::Private::clear() | 113 | void KDbQuerySchema::Private::clear() | ||
122 | { | 114 | { | ||
123 | columnAliases.clear(); | 115 | columnAliases.clear(); | ||
124 | tableAliases.clear(); | 116 | tableAliases.clear(); | ||
125 | asterisks.clear(); | 117 | asterisks.clear(); | ||
126 | relations.clear(); | 118 | relations.clear(); | ||
127 | masterTable = nullptr; | 119 | masterTable = nullptr; | ||
128 | tables.clear(); | 120 | tables.clear(); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |