mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-24 15:38:30 -04:00
Added model for notes.
This commit is contained in:
1 parent
b7808ec50c
commit
4dccaf3370
17 files changed
+195
-30
No files matched your search
@@ -7,7 +7,7 @@
|
||||
* @details
|
||||
*/
|
||||
#include "service-db/api/DBServiceAPI.hpp"
|
||||
|
||||
#include "widgets/NotesItem.hpp"
|
||||
|
||||
#include "NotesModel.hpp"
|
||||
|
||||
@@ -45,3 +45,23 @@ bool NotesModel::updateRecords( std::unique_ptr<std::vector<NotesRecord>> record
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
gui::ListItem* NotesModel::getItem( int index ) {
|
||||
std::shared_ptr<NotesRecord> note = getRecord( index );
|
||||
|
||||
SettingsRecord& settings = application->getSettings();
|
||||
|
||||
if( note == nullptr )
|
||||
return nullptr;
|
||||
|
||||
gui::NotesItem* item = new gui::NotesItem(this, !settings.timeFormat12 );
|
||||
if( item != nullptr ) {
|
||||
item->setNote(note);
|
||||
return item;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
int NotesModel::getItemCount() {
|
||||
return recordsCount;
|
||||
}
|
||||
Reference in new issue
Block a user