| 103 | } |
| 104 | |
| 105 | void |
| 106 | Editables::del (db::Transaction *transaction) |
| 107 | { |
| 108 | std::unique_ptr<db::Transaction> trans_holder (transaction ? transaction : new db::Transaction (manager (), tl::to_string (tr ("Delete")))); |
| 109 | |
| 110 | if (has_selection ()) { |
| 111 | |
| 112 | try { |
| 113 | |
| 114 | trans_holder->open (); |
| 115 | |
| 116 | cancel_edits (); |
| 117 | |
| 118 | // this dummy operation will update the screen: |
| 119 | if (manager ()) { |
| 120 | manager ()->queue (this, new db::Op ()); |
| 121 | } |
| 122 | |
| 123 | for (iterator e = begin (); e != end (); ++e) { |
| 124 | e->del (); |
| 125 | } |
| 126 | |
| 127 | signal_selection_changed (); |
| 128 | |
| 129 | } catch (...) { |
| 130 | trans_holder->cancel (); |
| 131 | throw; |
| 132 | } |
| 133 | |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void |
| 138 | Editables::cut () |
no test coverage detected