Commit f05a19ec authored by camilo higuita's avatar camilo higuita

set the boilerplate code to make it compile again

parent 4e429e7c
#include "booklet.h" #include "booklet.h"
Booklet::Booklet() Booklet::Booklet(QObject *parent) : MauiList(parent)
{
}
FMH::MODEL_LIST Booklet::items() const
{
return this->m_list;
}
void Booklet::setSortBy(const Booklet::SORTBY &sort)
{
}
Booklet::SORTBY Booklet::getSortBy() const
{
return this->sort;
}
void Booklet::setOrder(const Booklet::ORDER &order)
{
}
Booklet::ORDER Booklet::getOrder() const
{
return this->order;
}
void Booklet::sortList()
{ {
} }
...@@ -15,6 +15,39 @@ FMH::MODEL_LIST Books::items() const ...@@ -15,6 +15,39 @@ FMH::MODEL_LIST Books::items() const
return this->m_list; return this->m_list;
} }
void Books::setSortBy(const Books::SORTBY &sort)
{
}
Books::SORTBY Books::getSortBy() const
{
return this->sort;
}
void Books::setOrder(const Books::ORDER &order)
{
}
Books::ORDER Books::getOrder() const
{
return this->order;
}
void Books::sortList()
{
}
QVariantMap Books::get(const int &index) const
{
if(index >= this->m_list.size() || index < 0)
return QVariantMap();
return FMH::toMap(this->m_list.at(index));
}
bool Books::insert(const QVariantMap &book) bool Books::insert(const QVariantMap &book)
{ {
emit this->preItemAppended(); emit this->preItemAppended();
...@@ -30,3 +63,13 @@ bool Books::insert(const QVariantMap &book) ...@@ -30,3 +63,13 @@ bool Books::insert(const QVariantMap &book)
emit this->postItemAppended(); emit this->postItemAppended();
return true; return true;
} }
bool Books::update(const QVariantMap &data, const int &index)
{
return false;
}
bool Books::remove(const int &index)
{
return false;
}
...@@ -71,7 +71,7 @@ public slots: ...@@ -71,7 +71,7 @@ public slots:
* @param note * @param note
* @return * @return
*/ */
bool insert(const QVariantMap &note); bool insert(const QVariantMap &book);
bool update(const QVariantMap &data, const int &index); bool update(const QVariantMap &data, const int &index);
bool remove(const int &index); bool remove(const int &index);
}; };
......
...@@ -135,7 +135,7 @@ bool Notes::insert(const QVariantMap &note) ...@@ -135,7 +135,7 @@ bool Notes::insert(const QVariantMap &note)
{ {
emit this->preItemAppended(); emit this->preItemAppended();
auto __note = FM::toModel(note); auto __note = FMH::toModel(note);
__note[FMH::MODEL_KEY::MODIFIED] = QDateTime::currentDateTime().toString(Qt::TextDate); __note[FMH::MODEL_KEY::MODIFIED] = QDateTime::currentDateTime().toString(Qt::TextDate);
__note[FMH::MODEL_KEY::ADDDATE] = QDateTime::currentDateTime().toString(Qt::TextDate); __note[FMH::MODEL_KEY::ADDDATE] = QDateTime::currentDateTime().toString(Qt::TextDate);
...@@ -209,12 +209,5 @@ QVariantMap Notes::get(const int &index) const ...@@ -209,12 +209,5 @@ QVariantMap Notes::get(const int &index) const
{ {
if(index >= this->notes.size() || index < 0) if(index >= this->notes.size() || index < 0)
return QVariantMap(); return QVariantMap();
return FMH::toMap(this->notes.at(index));
QVariantMap res;
const auto note = this->notes.at(index);
for(auto key : note.keys())
res.insert(FMH::MODEL_NAME[key], note[key]);
return res;
} }
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <MauiKit/mauilist.h> #include <MauiKit/mauilist.h>
#endif #endif
class Syncer; class Syncer;
class Notes : public MauiList class Notes : public MauiList
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment