Skip to content

Commit

Permalink
Clearer task:: variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Sep 21, 2024
1 parent 2a5943d commit 2a29dde
Show file tree
Hide file tree
Showing 37 changed files with 222 additions and 222 deletions.
4 changes: 2 additions & 2 deletions bb/import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ std::string bible_import (Webserver_Request& webserver_request)
filter_url_file_put_contents (datafile, data);
success_message = translate("Import has started.");
view.set_variable ("journal", journal_logic_see_journal_for_progress ());
tasks_logic_queue (task::importbible, { datafile, bible, std::to_string (book), std::to_string (chapter) });
tasks_logic_queue (task::import_bible, { datafile, bible, std::to_string (book), std::to_string (chapter) });
} else {
error_message = translate("Please supply valid Unicode UTF-8 text.");
}
Expand All @@ -106,7 +106,7 @@ std::string bible_import (Webserver_Request& webserver_request)
filter_url_file_put_contents (datafile, data);
success_message = translate("Import has started.");
view.set_variable ("journal", journal_logic_see_journal_for_progress ());
tasks_logic_queue (task::importbible, { datafile, bible, std::to_string (book), std::to_string (chapter) });
tasks_logic_queue (task::import_bible, { datafile, bible, std::to_string (book), std::to_string (chapter) });
} else {
error_message = translate ("Nothing was uploaded");
}
Expand Down
2 changes: 1 addition & 1 deletion bb/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ std::string bible_settings (Webserver_Request& webserver_request)
const std::string resource = webserver_request.post["add"];
if (!resource.empty ()) {
if (write_access) {
tasks_logic_queue (task::importresource, { bible, resource });
tasks_logic_queue (task::import_resource, { bible, resource });
success_message = translate ("The resource will be imported into the Bible.") + " " + translate ("The journal shows the progress.");
}
}
Expand Down
2 changes: 1 addition & 1 deletion changes/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

void changes_logic_start ()
{
tasks_logic_queue (task::generatechanges);
tasks_logic_queue (task::generate_changes);
}


Expand Down
2 changes: 1 addition & 1 deletion changes/manage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::string changes_manage (Webserver_Request& webserver_request)
const int jobId = database_jobs.get_new_id ();
database_jobs.set_level (jobId, Filter_Roles::manager ());
database_jobs.set_start (jobId, translate ("Clearing change notifications."));
tasks_logic_queue (task::deletechanges, {std::to_string (jobId), username});
tasks_logic_queue (task::delete_changes, {std::to_string (jobId), username});
redirect_browser (webserver_request, jobs_index_url () + "?id=" + std::to_string (jobId));
return std::string();
}
Expand Down
2 changes: 1 addition & 1 deletion checks/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ void checks_logic_start_all ()

void checks_logic_start (const std::string& bible)
{
tasks_logic_queue (task::checkbible, {bible});
tasks_logic_queue (task::check_bible, {bible});
}
2 changes: 1 addition & 1 deletion collaboration/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ std::string collaboration_settings (Webserver_Request& webserver_request)
int jobId = database_jobs.get_new_id ();
database_jobs.set_level (jobId, Filter_Roles::admin ());
database_jobs.set_start (jobId, collaboration_link_header ());
tasks_logic_queue (task::linkgitrepository, {object, std::to_string (jobId), source});
tasks_logic_queue (task::link_git_repository, {object, std::to_string (jobId), source});
redirect_browser (webserver_request, jobs_index_url () + "?id=" + std::to_string (jobId));
return std::string();
}
Expand Down
2 changes: 1 addition & 1 deletion compare/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::string compare_index (Webserver_Request& webserver_request)
Database_Jobs database_jobs = Database_Jobs ();
const int job_id = database_jobs.get_new_id ();
database_jobs.set_level (job_id, Filter_Roles::consultant ());
tasks_logic_queue (task::compareusfm, {bible, compare, std::to_string (job_id)});
tasks_logic_queue (task::compare_usfm, {bible, compare, std::to_string (job_id)});
redirect_browser (webserver_request, jobs_index_url () + "?id=" + std::to_string (job_id));
return std::string();
}
Expand Down
4 changes: 2 additions & 2 deletions developer/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::string developer_index (Webserver_Request& webserver_request)
}

if (debug == "receive") {
tasks_logic_queue (task::receiveemail);
tasks_logic_queue (task::receive_email);
view.set_variable ("success", "Receiving email and running tasks that send mail");
}

Expand All @@ -130,7 +130,7 @@ std::string developer_index (Webserver_Request& webserver_request)
}

if (debug == "maintain") {
tasks_logic_queue (task::maintaindatabase);
tasks_logic_queue (task::maintain_database);
view.set_variable ("success", "Starting to maintain the databases");
}

Expand Down
2 changes: 1 addition & 1 deletion email/send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void email_schedule (std::string to, std::string subject, std::string body, int
Database_Mail database_mail (webserver_request);
database_mail.send (to, subject, body, time);
// Schedule a task to send the scheduled mail right away.
tasks_logic_queue (task::sendemail);
tasks_logic_queue (task::send_email);
}


Expand Down
22 changes: 11 additions & 11 deletions export/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Schedule all Bibles for exports.
void export_logic::schedule_all ()
{
tasks_logic_queue (task::exportall);
tasks_logic_queue (task::export_all);
}


Expand All @@ -42,15 +42,15 @@ void export_logic::schedule_text_and_basic_usfm (const std::string& bible, bool
{
std::vector <int> books = database::bibles::get_books (bible);
for (auto book : books) {
tasks_logic_queue (task::exporttextusfm, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_text_usfm, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
}
}


// Schedule a Bible for export to USFM format.
void export_logic::schedule_usfm (const std::string& bible, bool log)
{
tasks_logic_queue (task::exportusfm, {bible, filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_usfm, {bible, filter::strings::convert_to_string (log)});
}


Expand All @@ -62,18 +62,18 @@ void export_logic::schedule_open_document (const std::string& bible, bool log)
std::vector <int> books = database::bibles::get_books (bible);
// Export the books, one OpenDocument file per book.
for (auto book : books) {
tasks_logic_queue (task::exportodt, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_odt, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
}
// Export the whole Bible to one OpenDocument file.
tasks_logic_queue (task::exportodt, {bible, "0", filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_odt, {bible, "0", filter::strings::convert_to_string (log)});
}


// Schedule creation info documents.
// $bible: Bible.
void export_logic::schedule_info (const std::string& bible, bool log)
{
tasks_logic_queue (task::exportinfo, {bible, filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_info, {bible, filter::strings::convert_to_string (log)});
}


Expand All @@ -83,7 +83,7 @@ void export_logic::schedule_html (const std::string& bible, bool log)
{
std::vector <int> books = database::bibles::get_books (bible);
for (auto book : books) {
tasks_logic_queue (task::exporthtml, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_html, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
}
}

Expand All @@ -94,7 +94,7 @@ void export_logic::schedule_web (const std::string& bible, bool log)
{
std::vector <int> books = database::bibles::get_books (bible);
for (auto book : books) {
tasks_logic_queue (task::exportwebmain, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_web_main, {bible, std::to_string (book), filter::strings::convert_to_string (log)});
}
}

Expand All @@ -103,19 +103,19 @@ void export_logic::schedule_web (const std::string& bible, bool log)
// $bible: Bible.
void export_logic::schedule_web_index (const std::string& bible, bool log)
{
tasks_logic_queue (task::exportwebindex, {bible, filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_web_index, {bible, filter::strings::convert_to_string (log)});
}


void export_logic::schedule_online_bible (const std::string& bible, bool log)
{
tasks_logic_queue (task::exportonlinebible, {bible, filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_online_bible, {bible, filter::strings::convert_to_string (log)});
}


void export_logic::schedule_e_sword (const std::string& bible, bool log)
{
tasks_logic_queue (task::exportesword, {bible, filter::strings::convert_to_string (log)});
tasks_logic_queue (task::export_esword, {bible, filter::strings::convert_to_string (log)});
}


Expand Down
2 changes: 1 addition & 1 deletion images/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::string images_index (Webserver_Request& webserver_request)
std::string extension = filter_url_get_extension (file);
extension = filter::strings::unicode_string_casefold (extension);
if (background_import) {
tasks_logic_queue (task::importbibleimages, { file });
tasks_logic_queue (task::import_bible_images, { file });
success = translate("The file was uploaded and is being processed.");
view.set_variable ("journal", journal_logic_see_journal_for_progress ());
} else {
Expand Down
2 changes: 1 addition & 1 deletion nmt/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ std::string nmt_index (Webserver_Request& webserver_request)


if (webserver_request.query.count ("export")) {
tasks_logic_queue (task::export2nmt, {referencebible, translatingbible});
tasks_logic_queue (task::export_to_nmt, {referencebible, translatingbible});
redirect_browser (webserver_request, journal_index_url ());
return std::string();
}
Expand Down
2 changes: 1 addition & 1 deletion paratext/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ std::string paratext_index (Webserver_Request& webserver_request)
return page;
} else {
// Set collaboration up.
tasks_logic_queue (task::setupparatext, { bible, master });
tasks_logic_queue (task::setup_paratext, { bible, master });
success = translate ("The collaboration will be set up");
if (database::config::general::get_repeat_send_receive () == 0) {
database::config::general::set_repeat_send_receive (2);
Expand Down
2 changes: 1 addition & 1 deletion paratext/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void Paratext_Logic::copyParatext2Bibledit (std::string bible)

// It is easiest to schedule an import task.
// The task will take care of everything, including recording what to send to the Cloud.
tasks_logic_queue (task::importbible, { path, bible });
tasks_logic_queue (task::import_bible, { path, bible });

// Ancestor data needed for future merge.
// The Paratext files have cr+lf at the end, and the ancestor data should only have lf at the end of each line.
Expand Down
2 changes: 1 addition & 1 deletion resource/bb2resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::string resource_bible2resource (Webserver_Request& webserver_request)

if (webserver_request.query.count ("convert")) {
if (access_bible::write (webserver_request, bible)) {
tasks_logic_queue (task::convertbible2resource, {bible});
tasks_logic_queue (task::convert_bible_to_resource, {bible});
redirect_browser (webserver_request, journal_index_url ());
return std::string();
} else {
Expand Down
2 changes: 1 addition & 1 deletion resource/convert2bible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void convert_resource_to_bible (std::string resource)


// The Cloud updates the list of available USFM resources for the clients.
tasks_logic_queue (task::listusfmresources);
tasks_logic_queue (task::list_usfm_resources);


Database_Logs::log (translate("Conversion completed"));
Expand Down
2 changes: 1 addition & 1 deletion resource/convert2resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void convert_bible_to_resource (std::string bible)


// The Cloud updates the list of available USFM resources for the clients.
tasks_logic_queue (task::listusfmresources);
tasks_logic_queue (task::list_usfm_resources);


Database_Logs::log (translate("Completed"), Filter_Roles::manager ());
Expand Down
2 changes: 1 addition & 1 deletion resource/download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::string resource_download (Webserver_Request& webserver_request)
resources.push_back (name);
database::config::general::set_resources_to_cache (resources);
}
tasks_logic_queue (task::syncresources);
tasks_logic_queue (task::sync_resources);
redirect_browser (webserver_request, journal_index_url ());
return std::string();
}
Expand Down
2 changes: 1 addition & 1 deletion resource/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std::string resource_image (Webserver_Request& webserver_request)
extension = filter::strings::unicode_string_casefold (extension);
if (extension == "pdf") background_import = true;
if (background_import) {
tasks_logic_queue (task::importimages, { name, file });
tasks_logic_queue (task::import_images, { name, file });
success = translate("The file was uploaded and is being processed.");
view.set_variable ("journal", journal_logic_see_journal_for_progress ());
} else {
Expand Down
2 changes: 1 addition & 1 deletion resource/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ void resource_logic_create_cache ()
resource_logic_create_cache_running = false;

// If there's another resource database waiting to be cached, schedule it for caching.
if (!signatures.empty ()) tasks_logic_queue (task::cacheresources);
if (!signatures.empty ()) tasks_logic_queue (task::cache_resources);
}


Expand Down
4 changes: 2 additions & 2 deletions resource/manage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::string resource_manage (Webserver_Request& webserver_request)
if (access_bible::write (webserver_request, remove)) {
database_usfmresources.deleteResource (remove);
// The Cloud updates the list of available USFM resources for the clients.
tasks_logic_queue (task::listusfmresources);
tasks_logic_queue (task::list_usfm_resources);
} else {
view.set_variable ("error", translate("You do not have write access to this resource"));
}
Expand All @@ -91,7 +91,7 @@ std::string resource_manage (Webserver_Request& webserver_request)
return page;
} if (confirm == "yes") {
if (access_bible::write (webserver_request, convert)) {
tasks_logic_queue (task::convertresource2bible, {convert});
tasks_logic_queue (task::convert_resource_to_bible, {convert});
redirect_browser (webserver_request, journal_index_url ());
return std::string();
} else {
Expand Down
2 changes: 1 addition & 1 deletion resource/organize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ std::string resource_organize (Webserver_Request& webserver_request)
}
}
}
tasks_logic_queue (task::syncresources);
tasks_logic_queue (task::sync_resources);
view.set_variable ("success", translate ("Will install the resources.") + " " + translate ("The journal displays the progress."));
}

Expand Down
2 changes: 1 addition & 1 deletion resource/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ std::string resource_print (Webserver_Request& webserver_request)
int jobId = database_jobs.get_new_id ();
database_jobs.set_level (jobId, Filter_Roles::consultant ());
const std::string& username = webserver_request.session_logic ()->get_username ();
tasks_logic_queue (task::printresources, {std::to_string (jobId), username, bible});
tasks_logic_queue (task::print_resources, {std::to_string (jobId), username, bible});
redirect_browser (webserver_request, jobs_index_url () + "?id=" + std::to_string (jobId));
return std::string();
}
Expand Down
4 changes: 2 additions & 2 deletions resource/sword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ bool resource_sword_acl (Webserver_Request& webserver_request)
std::string resource_sword (Webserver_Request& webserver_request)
{
if (webserver_request.query.count ("refresh")) {
tasks_logic_queue (task::refreshswordmodules);
tasks_logic_queue (task::refresh_sword_modules);
redirect_browser (webserver_request, journal_index_url ());
}


if (webserver_request.query.count ("update")) {
tasks_logic_queue (task::updateswordmodules, {});
tasks_logic_queue (task::update_sword_modules, {});
redirect_browser (webserver_request, journal_index_url ());
}

Expand Down
2 changes: 1 addition & 1 deletion rss/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void rss_logic_schedule_update (std::string user, std::string bible, int book, i
parameters.push_back (std::to_string (chapter));
parameters.push_back (oldusfm);
parameters.push_back (newusfm);
tasks_logic_queue (task::rssfeedupdatechapter, parameters);
tasks_logic_queue (task::rss_feed_update_chapter, parameters);
}


Expand Down
2 changes: 1 addition & 1 deletion sendreceive/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void sendreceive_files ()
if (sendreceive_logic_prioritized_task_is_active ()) {
sendreceive_files_done ();
std::this_thread::sleep_for (std::chrono::seconds (5));
tasks_logic_queue (task::syncfiles);
tasks_logic_queue (task::sync_files);
return;
}

Expand Down
Loading

0 comments on commit 2a29dde

Please sign in to comment.