1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-23 11:52:59 +02:00

51 lines
834 B
C++
Raw Normal View History

2016-12-10 22:39:53 +00:00
#include "models/item.h"
#include "uuid.h"
using namespace jop;
Item::Item() {
isPartial_ = true;
}
void Item::fromSqlQuery(const QSqlQuery &q) {
int i_id = q.record().indexOf("id");
int i_title = q.record().indexOf("title");
int i_created_time = q.record().indexOf("created_time");
2016-12-11 16:09:39 +00:00
id_ = q.value(i_id).toString();
2016-12-10 22:39:53 +00:00
title_ = q.value(i_title).toString();
createdTime_ = q.value(i_created_time).toInt();
}
2016-12-11 16:09:39 +00:00
QString Item::id() const {
2016-12-10 22:39:53 +00:00
return id_;
}
QString Item::title() const {
return title_;
}
int Item::createdTime() const {
return createdTime_;
}
void Item::setId(const QString& v) {
2016-12-11 16:09:39 +00:00
id_ = v;
2016-12-10 22:39:53 +00:00
}
void Item::setTitle(const QString &v) {
title_ = v;
}
void Item::setCreatedTime(int v) {
createdTime_ = v;
}
void Item::setIsPartial(bool v) {
isPartial_ = v;
}
bool Item::isPartial() const {
return isPartial_;
}