Remove unneeded interface class

This commit is contained in:
Scharel Clemens 2020-05-07 21:18:40 +02:00
parent 6818edd94a
commit aa8daf89f5
5 changed files with 3 additions and 50 deletions

View file

@ -18,7 +18,6 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\"
HEADERS += src/note.h \
src/notesapi.h \
src/notesinterface.h \
src/notesmodel.h \
src/notesstore.h

View file

@ -10,8 +10,6 @@
#include <QTimer>
#include <QDebug>
#include "notesinterface.h"
#define STATUS_ENDPOINT "/status.php"
#define LOGIN_ENDPOINT "/index.php/login/v2"
#define NOTES_ENDPOINT "/index.php/apps/notes/api/v0.2/notes"
@ -19,7 +17,7 @@
#define EXCLUDE_QUERY "exclude="
#define POLL_INTERVALL 5000
class NotesApi : public QObject, public NotesInterface
class NotesApi : public QObject
{
Q_OBJECT

View file

@ -1,41 +0,0 @@
#ifndef NOTESINTERFACE_H
#define NOTESINTERFACE_H
//#include <QObject>
#include <QList>
class NotesInterface
{
//Q_CLASSINFO("author", "Scharel Clemens")
//Q_CLASSINFO("url", "https://github.com/scharel/harbour-nextcloudnotes")
Q_PROPERTY(QString account READ account WRITE setAccount NOTIFY accountChanged)
public:
explicit NotesInterface() {
}
virtual QString account() const = 0;
virtual void setAccount(const QString& account) = 0;
virtual const QList<int> noteIds() = 0;
virtual bool noteExists(const int id) = 0;
virtual int noteModified(const int id) = 0;
public slots:
Q_INVOKABLE virtual bool getAllNotes(const QStringList& exclude = QStringList()) = 0;
Q_INVOKABLE virtual bool getNote(const int id, const QStringList& exclude = QStringList()) = 0;
Q_INVOKABLE virtual bool createNote(const QJsonObject& note) = 0;
Q_INVOKABLE virtual bool updateNote(const int id, const QJsonObject& note) = 0;
Q_INVOKABLE virtual bool deleteNote(const int id) = 0;
signals:
virtual void accountChanged(const QString& account) = 0;
virtual void allNotesChanged(const QList<int>& ids) = 0;
virtual void noteCreated(const int id, const QJsonObject& note) = 0;
virtual void noteUpdated(const int id, const QJsonObject& note) = 0;
virtual void noteDeleted(const int id) = 0;
};
#endif // NOTESINTERFACE_H

View file

@ -6,7 +6,6 @@
#include <QJsonArray>
#include <QDateTime>
#include "note.h"
#include "notesinterface.h"
#include "notesapi.h"
#include "notesstore.h"
@ -36,7 +35,7 @@ private:
bool m_favoritesOnTop;
};
class NotesModel : public QAbstractListModel, public NotesInterface {
class NotesModel : public QAbstractListModel {
Q_OBJECT
public:

View file

@ -7,9 +7,7 @@
#include <QDir>
#include <QStandardPaths>
#include "notesinterface.h"
class NotesStore : public QObject, public NotesInterface
class NotesStore : public QObject
{
Q_OBJECT