Added model for notes.

This commit is contained in:
Robert Borzecki committed 2019-08-13 08:09:07 +02:00
1 parent b7808ec50c
commit 4dccaf3370
17 files changed
+195 -30

No files matched your search

+21 -1
View File
@@ -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;
}