Changeset View
Changeset View
Standalone View
Standalone View
src/KDbProperties.cpp
Show All 38 Lines | 37 | const tristate result = m_conn->resultExists( | |||
---|---|---|---|---|---|
39 | .arg(m_conn->escapeString(name))); | 39 | .arg(m_conn->escapeString(name))); | ||
40 | if (~result) { | 40 | if (~result) { | ||
41 | m_result = m_conn->result(); | 41 | m_result = m_conn->result(); | ||
42 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | 42 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | ||
43 | return false; | 43 | return false; | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | if (result == true) { | 46 | if (result == true) { | ||
47 | if (!m_conn->executeVoidSQL( | 47 | if (!m_conn->executeSql( | ||
48 | KDbEscapedString("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2") | 48 | KDbEscapedString("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2") | ||
49 | .arg(m_conn->escapeString(value.toString())) | 49 | .arg(m_conn->escapeString(value.toString())) | ||
50 | .arg(m_conn->escapeString(name)))) | 50 | .arg(m_conn->escapeString(name)))) | ||
51 | { | 51 | { | ||
52 | m_result = m_conn->result(); | 52 | m_result = m_conn->result(); | ||
53 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | 53 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | ||
54 | return false; | 54 | return false; | ||
55 | } | 55 | } | ||
56 | return true; | 56 | return true; | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | if (!m_conn->executeVoidSQL( | 59 | if (!m_conn->executeSql( | ||
60 | KDbEscapedString("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)") | 60 | KDbEscapedString("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)") | ||
61 | .arg(m_conn->escapeString(name)) | 61 | .arg(m_conn->escapeString(name)) | ||
62 | .arg(m_conn->escapeString(value.toString())))) | 62 | .arg(m_conn->escapeString(value.toString())))) | ||
63 | { | 63 | { | ||
64 | m_result = m_conn->result(); | 64 | m_result = m_conn->result(); | ||
65 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | 65 | m_result.prependMessage(tr("Could not set value of database property \"%1\".").arg(name)); | ||
66 | return false; | 66 | return false; | ||
67 | } | 67 | } | ||
Show All 11 Lines | 78 | KDbEscapedString("SELECT 1 FROM kexi__db WHERE db_property=%1") | |||
79 | .arg(m_conn->escapeString(name))); | 79 | .arg(m_conn->escapeString(name))); | ||
80 | if (~result) { | 80 | if (~result) { | ||
81 | m_result = m_conn->result(); | 81 | m_result = m_conn->result(); | ||
82 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | 82 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | ||
83 | return false; | 83 | return false; | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | if (result == true) { | 86 | if (result == true) { | ||
87 | if (!m_conn->executeVoidSQL( | 87 | if (!m_conn->executeSql( | ||
88 | KDbEscapedString("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2") | 88 | KDbEscapedString("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2") | ||
89 | .arg(m_conn->escapeString(caption)) | 89 | .arg(m_conn->escapeString(caption)) | ||
90 | .arg(m_conn->escapeString(name)))) { | 90 | .arg(m_conn->escapeString(name)))) { | ||
91 | m_result = m_conn->result(); | 91 | m_result = m_conn->result(); | ||
92 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | 92 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | ||
93 | return false; | 93 | return false; | ||
94 | } | 94 | } | ||
95 | return true; | 95 | return true; | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | if (!m_conn->executeVoidSQL( | 98 | if (!m_conn->executeSql( | ||
99 | KDbEscapedString("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)") | 99 | KDbEscapedString("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)") | ||
100 | .arg(m_conn->escapeString(name)) | 100 | .arg(m_conn->escapeString(name)) | ||
101 | .arg(m_conn->escapeString(caption)))) { | 101 | .arg(m_conn->escapeString(caption)))) { | ||
102 | m_result = m_conn->result(); | 102 | m_result = m_conn->result(); | ||
103 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | 103 | m_result.prependMessage(tr("Could not set caption for database property \"%1\".").arg(name)); | ||
104 | return false; | 104 | return false; | ||
105 | } | 105 | } | ||
106 | return true; | 106 | return true; | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |