MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / read_bookmarks

Function read_bookmarks

cp-profiler/src/cpprofiler/db_handler.cpp:98–118  ·  view source on GitHub ↗

Read all bookmarks from the database

Source from the content-addressed store, hash-verified

96
97/// Read all bookmarks from the database
98static 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
121static bool read_info(QSqlDatabase *db, Execution &ex)

Callers 1

load_executionFunction · 0.85

Calls 5

nextMethod · 0.80
setBookmarkMethod · 0.80
NodeIDClass · 0.50
valueMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected