Read all bookmarks from the database
| 96 | |
| 97 | /// Read all bookmarks from the database |
| 98 | static bool read_bookmarks(QSqlDatabase *db, Execution &ex) |
| 99 | { |
| 100 | const auto query = "select * from Bookmarks;"; |
| 101 | QSqlQuery select_bm_(*db); |
| 102 | select_bm_.prepare(query); |
| 103 | |
| 104 | bool success = select_bm_.exec(); |
| 105 | if(!success) return false; |
| 106 | |
| 107 | auto &ud = ex.userData(); |
| 108 | |
| 109 | while (select_bm_.next()) |
| 110 | { |
| 111 | const auto nid = NodeID(select_bm_.value(0).toInt()); |
| 112 | const auto bm_text = select_bm_.value(1).toString().toStdString(); |
| 113 | |
| 114 | ud.setBookmark(nid, bm_text); |
| 115 | } |
| 116 | |
| 117 | return success; |
| 118 | } |
| 119 | |
| 120 | /// Read all Info from the database |
| 121 | static bool read_info(QSqlDatabase *db, Execution &ex) |
no test coverage detected