Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/storage/mymoneymap.h
Context not available. | |||||
67 | 67 | | |||
---|---|---|---|---|---|
68 | void rollbackTransaction(void) { | 68 | void rollbackTransaction(void) { | ||
69 | if (m_stack.isEmpty()) | 69 | if (m_stack.isEmpty()) | ||
70 | throw MYMONEYEXCEPTION("No transaction started to rollback changes"); | 70 | throw MYMONEYEXCEPTION_CSTRING("No transaction started to rollback changes"); | ||
71 | 71 | | |||
72 | // undo all actions | 72 | // undo all actions | ||
73 | MyMoneyMapAction* action; | 73 | MyMoneyMapAction* action; | ||
Context not available. | |||||
80 | 80 | | |||
81 | bool commitTransaction(void) { | 81 | bool commitTransaction(void) { | ||
82 | if (m_stack.isEmpty()) | 82 | if (m_stack.isEmpty()) | ||
83 | throw MYMONEYEXCEPTION("No transaction started to commit changes"); | 83 | throw MYMONEYEXCEPTION_CSTRING("No transaction started to commit changes"); | ||
84 | 84 | | |||
85 | bool rc = m_stack.count() > 1; | 85 | bool rc = m_stack.count() > 1; | ||
86 | // remove all actions from the stack | 86 | // remove all actions from the stack | ||
Context not available. | |||||
94 | 94 | | |||
95 | void insert(const Key& key, const T& obj) { | 95 | void insert(const Key& key, const T& obj) { | ||
96 | if (m_stack.isEmpty()) | 96 | if (m_stack.isEmpty()) | ||
97 | throw MYMONEYEXCEPTION("No transaction started to insert new element into container"); | 97 | throw MYMONEYEXCEPTION_CSTRING("No transaction started to insert new element into container"); | ||
98 | 98 | | |||
99 | // check if information about the object identified by 'key' | 99 | // check if information about the object identified by 'key' | ||
100 | // is already present in the stack | 100 | // is already present in the stack | ||
Context not available. | |||||
109 | 109 | | |||
110 | void modify(const Key& key, const T& obj) { | 110 | void modify(const Key& key, const T& obj) { | ||
111 | if (m_stack.isEmpty()) | 111 | if (m_stack.isEmpty()) | ||
112 | throw MYMONEYEXCEPTION("No transaction started to modify element in container"); | 112 | throw MYMONEYEXCEPTION_CSTRING("No transaction started to modify element in container"); | ||
113 | 113 | | |||
114 | #if 0 | 114 | #if 0 | ||
115 | // had to take this out, because we use QPair in one instance as key | 115 | // had to take this out, because we use QPair in one instance as key | ||
116 | if (key.isEmpty()) | 116 | if (key.isEmpty()) | ||
117 | throw MYMONEYEXCEPTION("No key to update object"); | 117 | throw MYMONEYEXCEPTION_CSTRING("No key to update object"); | ||
118 | #endif | 118 | #endif | ||
119 | 119 | | |||
120 | // check if information about the object identified by 'key' | 120 | // check if information about the object identified by 'key' | ||
Context not available. | |||||
129 | 129 | | |||
130 | void remove(const Key& key) { | 130 | void remove(const Key& key) { | ||
131 | if (m_stack.isEmpty()) | 131 | if (m_stack.isEmpty()) | ||
132 | throw MYMONEYEXCEPTION("No transaction started to remove element from container"); | 132 | throw MYMONEYEXCEPTION_CSTRING("No transaction started to remove element from container"); | ||
133 | 133 | | |||
134 | #if 0 | 134 | #if 0 | ||
135 | // had to take this out, because we use QPair in one instance as key | 135 | // had to take this out, because we use QPair in one instance as key | ||
136 | if (key.isEmpty()) | 136 | if (key.isEmpty()) | ||
137 | throw MYMONEYEXCEPTION("No key to remove object"); | 137 | throw MYMONEYEXCEPTION_CSTRING("No key to remove object"); | ||
138 | #endif | 138 | #endif | ||
139 | 139 | | |||
140 | // check if information about the object identified by 'key' | 140 | // check if information about the object identified by 'key' | ||
Context not available. | |||||
149 | 149 | | |||
150 | MyMoneyMap<Key, T>& operator= (const QMap<Key, T>& m) { | 150 | MyMoneyMap<Key, T>& operator= (const QMap<Key, T>& m) { | ||
151 | if (!m_stack.isEmpty()) { | 151 | if (!m_stack.isEmpty()) { | ||
152 | throw MYMONEYEXCEPTION("Cannot assign whole container during transaction"); | 152 | throw MYMONEYEXCEPTION_CSTRING("Cannot assign whole container during transaction"); | ||
153 | } | 153 | } | ||
154 | QMap<Key, T>::operator=(m); | 154 | QMap<Key, T>::operator=(m); | ||
155 | return *this; | 155 | return *this; | ||
Context not available. |