Changeset View
Changeset View
Standalone View
Standalone View
kexi/plugins/queries/kexiquerypart.cpp
1 | /* This file is part of the KDE project | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | Copyright (C) 2004 Lucijan Busch <lucijan@kde.org> | 2 | Copyright (C) 2004 Lucijan Busch <lucijan@kde.org> | ||
3 | Copyright (C) 2004-2010 Jarosław Staniek <staniek@kde.org> | 3 | Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org> | ||
4 | 4 | | |||
5 | This program is free software; you can redistribute it and/or | 5 | This program is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. | ||
9 | 9 | | |||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Line(s) | |||||
173 | } | 173 | } | ||
174 | 174 | | |||
175 | //---------------- | 175 | //---------------- | ||
176 | 176 | | |||
177 | KexiQueryPart::TempData::TempData(KexiWindow* window, KexiDB::Connection *conn) | 177 | KexiQueryPart::TempData::TempData(KexiWindow* window, KexiDB::Connection *conn) | ||
178 | : KexiWindowData(window) | 178 | : KexiWindowData(window) | ||
179 | , KexiDB::Connection::TableSchemaChangeListenerInterface() | 179 | , KexiDB::Connection::TableSchemaChangeListenerInterface() | ||
180 | , m_query(0) | 180 | , m_query(0) | ||
181 | , m_queryChangedInPreviousView(false) | 181 | , m_queryChangedInView(Kexi::NoViewMode) | ||
182 | { | 182 | { | ||
183 | this->conn = conn; | 183 | this->conn = conn; | ||
184 | } | 184 | } | ||
185 | 185 | | |||
186 | KexiQueryPart::TempData::~TempData() | 186 | KexiQueryPart::TempData::~TempData() | ||
187 | { | 187 | { | ||
188 | conn->unregisterForTablesSchemaChanges(*this); | 188 | conn->unregisterForTablesSchemaChanges(*this); | ||
189 | } | 189 | } | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 230 | if (m_query | |||
231 | /* query not owned by window */ | 231 | /* query not owned by window */ | ||
232 | && (static_cast<KexiWindow*>(parent())->schemaData() != static_cast<KexiDB::SchemaData*>(m_query))) | 232 | && (static_cast<KexiWindow*>(parent())->schemaData() != static_cast<KexiDB::SchemaData*>(m_query))) | ||
233 | { | 233 | { | ||
234 | delete m_query; | 234 | delete m_query; | ||
235 | } | 235 | } | ||
236 | m_query = query; | 236 | m_query = query; | ||
237 | } | 237 | } | ||
238 | 238 | | |||
239 | bool KexiQueryPart::TempData::queryChangedInPreviousView() const | 239 | Kexi::ViewMode KexiQueryPart::TempData::queryChangedInView() const | ||
240 | { | 240 | { | ||
241 | return m_queryChangedInPreviousView; | 241 | return m_queryChangedInView; | ||
242 | } | 242 | } | ||
243 | 243 | | |||
244 | void KexiQueryPart::TempData::setQueryChangedInPreviousView(bool set) | 244 | void KexiQueryPart::TempData::setQueryChangedInView(bool set) | ||
245 | { | 245 | { | ||
246 | m_queryChangedInPreviousView = set; | 246 | m_queryChangedInView = set ? qobject_cast<KexiWindow*>(parent())->currentViewMode() | ||
247 | : Kexi::NoViewMode; | ||||
247 | } | 248 | } | ||
248 | 249 | | |||
249 | //---------------- | 250 | //---------------- | ||
250 | 251 | | |||
251 | K_EXPORT_KEXIPART_PLUGIN( KexiQueryPart, query ) | 252 | K_EXPORT_KEXIPART_PLUGIN( KexiQueryPart, query ) | ||
252 | 253 | | |||
253 | #include "kexiquerypart.moc" | 254 | #include "kexiquerypart.moc" |