~bibledit/bibledit/ubuntu-cloud-beta

« back to all changes in this revision

Viewing changes to checks/index.cpp

  • Committer: Teus Benschop
  • Date: 2022-10-14 16:03:26 UTC
  • Revision ID: teusjannette@gmail.com-20221014160326-42ybrpft4bblpruk
new upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
string checks_index (void * webserver_request)
52
52
{
53
53
  Webserver_Request * request = static_cast<Webserver_Request *>(webserver_request);
54
 
  Database_Check database_check;
 
54
  Database_Check database_check {};
55
55
 
56
56
  
57
 
  string page;
 
57
  string page {};
58
58
  Assets_Header header = Assets_Header (translate("Checks"), webserver_request);
59
 
  header.addBreadCrumb (menu_logic_tools_menu (), menu_logic_tools_text ());
 
59
  header.add_bread_crumb (menu_logic_tools_menu (), menu_logic_tools_text ());
60
60
  page = header.run ();
61
 
  Assets_View view;
 
61
  Assets_View view {};
62
62
  
63
63
 
64
64
  if (request->query.count ("approve")) {
76
76
 
77
77
  
78
78
  // Get the Bibles the user has write-access to.
79
 
  vector <string> bibles;
 
79
  vector <string> bibles {};
80
80
  {
81
 
    vector <string> all_bibles = request->database_bibles()->getBibles ();
82
 
    for (auto bible : all_bibles) {
83
 
      if (AccessBible::Write (webserver_request, bible)) {
 
81
    const vector <string> & all_bibles = request->database_bibles()->getBibles ();
 
82
    for (const auto & bible : all_bibles) {
 
83
      if (access_bible::write (webserver_request, bible)) {
84
84
        bibles.push_back (bible);
85
85
      }
86
86
    }
87
87
  }
88
88
  
89
89
  
90
 
  stringstream resultblock;
91
 
  vector <Database_Check_Hit> hits = database_check.getHits ();
92
 
  for (auto hit : hits) {
 
90
  stringstream resultblock {};
 
91
  const vector <Database_Check_Hit> & hits = database_check.getHits ();
 
92
  for (const auto & hit : hits) {
93
93
    string bible = hit.bible;
94
94
    if (find (bibles.begin(), bibles.end (), bible) != bibles.end ()) {
95
95
      int id = hit.rowid;
121
121
 
122
122
 
123
123
  page += view.render ("checks", "index");
124
 
  page += Assets_Page::footer ();
 
124
  page += assets_page::footer ();
125
125
  return page;
126
126
}