You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaces the legacy select_notes function with a new version that takes a selector struct, simplifying and clarifying the API for selecting notes. Updates all usages throughout the codebase, including tests, to use the new selector-based approach. Removes the bible_selector field from the selector struct and adjusts logic to handle Bible filtering via the bibles vector. Cleans up related comments and improves code readability.
#1046
Copy file name to clipboardExpand all lines: database/notes.cpp
+8-197Lines changed: 8 additions & 197 deletions
Original file line number
Diff line number
Diff line change
@@ -596,190 +596,7 @@ int Database_Notes::store_new_note (const std::string& bible, int book, int chap
596
596
}
597
597
598
598
599
-
// Returns an array of note identifiers selected.
600
-
std::vector <int> Database_Notes::select_notes (std::vector <std::string> bibles, int book, int chapter, int verse, int passage_selector, int edit_selector, int non_edit_selector, const std::vector<std::string>& status_selectors, std::string bible_selector, std::string assignment_selector, bool subscription_selector, int severity_selector, int text_selector, const std::string& search_text, int limit)// Todo phase out.
Copy file name to clipboardExpand all lines: database/notes.h
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,9 @@ class Database_Notes
71
71
72
72
public:
73
73
structselector {
74
-
// Contaiiner of Bible names the user has read access to.
74
+
// Container of Bible names that is going to be searched.
75
+
// Can contains all Bibles the user has read access to.
76
+
// Or can contain one Bible to be searched.
75
77
std::vector<std::string> bibles{};
76
78
// Four related selectors that can limit the selection.
77
79
int book{};
@@ -81,10 +83,8 @@ class Database_Notes
81
83
// Optionally constrains selection based on modification time.
82
84
int edit_selector{}; // Todo default and enum?
83
85
int non_edit_selector{}; // Todo default and enum?
84
-
// Optionally constrains selection based on note status.
86
+
// Optionally constrains selection based on list of note statuses.
85
87
std::vector<std::string> status_selectors; // Todo enums?
86
-
// Optionally constrains the selection, based on the note's Bible.
87
-
std::string bible_selector{};
88
88
// Optionally constrains the selection based on a note being assigned to somebody.
89
89
std::string assignment_selector{};
90
90
// Optionally limits the selection based on a note's subscription.
@@ -98,7 +98,6 @@ class Database_Notes
98
98
// If >= 0, it indicates the starting limit for the selection.
99
99
int limit{0};
100
100
};
101
-
std::vector <int> select_notes (std::vector <std::string> bibles, int book, int chapter, int verse, int passage_selector, int edit_selector, int non_edit_selector, const std::vector<std::string>& status_selectors, std::string bible_selector, std::string assignment_selector, bool subscription_selector, int severity_selector, int text_selector, const std::string& search_text, int limit);
0 commit comments