diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-05 00:00:35 +0300 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-05 00:00:35 +0300 |
commit | 90cbd461ab3e7ce6c4a5bf5aa03117409f65e2ab (patch) | |
tree | 3adc74ecbe1ec5061a902fdb8a65bd3a6a169e53 /src/gui/sharee.h | |
parent | 6fb4e59120f1fd6cc4a2926bf766d5f9d29ad195 (diff) |
[Sharing] Allow sharing with users/groups from desktop
Diffstat (limited to 'src/gui/sharee.h')
-rw-r--r-- | src/gui/sharee.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gui/sharee.h b/src/gui/sharee.h index 86fcc8e79..33a308bdc 100644 --- a/src/gui/sharee.h +++ b/src/gui/sharee.h @@ -11,9 +11,12 @@ * for more details. */ +#ifndef SHAREE_H +#define SHAREE_H + #include <QObject> #include <QFlags> -#include <QAbstractTableModel> +#include <QAbstractListModel> #include <QModelIndex> #include <QVariant> #include <QSharedPointer> @@ -23,7 +26,7 @@ namespace OCC { -class Sharee : public QObject { +class Sharee { public: enum Type { @@ -37,10 +40,10 @@ public: const QString displayName, const Type type); + QString format() const; QString shareWith() const; QString displayName() const; Type type() const; - private: QString _shareWith; @@ -48,7 +51,7 @@ private: Type _type; }; -class ShareeModel : public QAbstractTableModel { +class ShareeModel : public QAbstractListModel { Q_OBJECT public: explicit ShareeModel(AccountPtr account, @@ -56,17 +59,21 @@ public: const QString type, QObject *parent = 0); + void fetch(); int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole); - QSharedPointer<Sharee> parseSharee(const QVariantMap &data); + QSharedPointer<Sharee> getSharee(int at); + +signals: + void shareesReady(); private slots: void shareesFetched(const QVariantMap &reply); private: + QSharedPointer<Sharee> parseSharee(const QVariantMap &data); + AccountPtr _account; QString _search; QString _type; @@ -75,3 +82,5 @@ private: }; } + +#endif //SHAREE_H |