You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-03 23:50:33 +02:00
40 lines
705 B
C++
Executable File
40 lines
705 B
C++
Executable File
#include "models/folder.h"
|
|
|
|
#include "database.h"
|
|
#include "uuid.h"
|
|
|
|
using namespace jop;
|
|
|
|
Folder::Folder() : Item() {}
|
|
|
|
Table Folder::table() const {
|
|
return jop::FoldersTable;
|
|
}
|
|
|
|
bool Folder::primaryKeyIsUuid() const {
|
|
return true;
|
|
}
|
|
|
|
bool Folder::trackChanges() const {
|
|
return true;
|
|
}
|
|
|
|
int Folder::count() {
|
|
return BaseModel::count(jop::FoldersTable);
|
|
}
|
|
|
|
QVector<Folder> Folder::all(const QString &orderBy) {
|
|
QSqlQuery q = jop::db().query("SELECT " + BaseModel::tableFieldNames(jop::FoldersTable).join(",") + " FROM folders ORDER BY " + orderBy);
|
|
q.exec();
|
|
|
|
QVector<Folder> output;
|
|
|
|
while (q.next()) {
|
|
Folder folder;
|
|
folder.loadSqlQuery(q);
|
|
output.push_back(folder);
|
|
}
|
|
|
|
return output;
|
|
}
|