move to new models and lists and start testing mauikit syncing
Showing
src/db/dbactions.cpp
deleted
100644 → 0
src/db/dbactions.h
deleted
100644 → 0
src/models/baselist.cpp
0 → 100644
src/models/baselist.h
0 → 100644
#ifndef LINKSMODEL_H | ||
#define LINKSMODEL_H | ||
#ifndef NOTESMODEL_H | ||
#define NOTESMODEL_H | ||
#include <QAbstractListModel> | ||
#include <QList> | ||
#include "owl.h" | ||
class Links; | ||
class LinksModel : public QAbstractListModel | ||
class Notes; | ||
class BaseList; | ||
class BaseModel : public QAbstractListModel | ||
{ | ||
Q_OBJECT | ||
Q_PROPERTY(BaseList *list READ getList WRITE setList) | ||
public: | ||
explicit LinksModel(QObject *parent = nullptr); | ||
enum | ||
{ | ||
title, | ||
body | ||
}; | ||
explicit BaseModel(QObject *parent = nullptr); | ||
// Basic functionality: | ||
int rowCount(const QModelIndex &parent = QModelIndex()) const override; | ||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | ||
Q_INVOKABLE QVariantMap get(const int &index); | ||
Q_INVOKABLE void sortBy(const int &index, const QString &order); | ||
Q_INVOKABLE bool insert(const QVariantMap &link); | ||
Q_INVOKABLE bool remove(const int &index); | ||
Q_INVOKABLE QVariantList getTags(const int &index); | ||
// Editable: | ||
bool setData(const QModelIndex &index, const QVariant &value, | ||
int role = Qt::EditRole) override; | ||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | ||
Qt::ItemFlags flags(const QModelIndex& index) const override; | ||
virtual QHash<int, QByteArray> roleNames() const override; | ||
< |