Frequman widget gets a non owning reference to the database instead of copying (#1175)

-Get rid of -Weffc++ pointer member warnings by restricting copy of FreqManUIList
-Add null checks
-Remove unused macro
This commit is contained in:
E.T 2023-06-21 12:05:07 +02:00 committed by GitHub
parent 909f37f89b
commit e1c519d71e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View file

@ -49,6 +49,8 @@ class FreqManUIList : public Widget {
FreqManUIList()
: FreqManUIList{{}, {}} {
}
FreqManUIList(const FreqManUIList& other) = delete;
FreqManUIList& operator=(const FreqManUIList& other) = delete;
void paint(Painter& painter) override;
void on_focus() override;
@ -64,7 +66,7 @@ class FreqManUIList : public Widget {
private:
static constexpr int8_t char_height = 16;
bool instant_exec_{false};
freqman_db freqlist_db{};
freqman_db* freqlist_db{nullptr};
int current_index{0};
int highlighted_index{0};
int freqlist_nb_lines{0};