Has function for ActivityModel, typos

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Dominique Fuchs 2020-01-03 13:39:10 +01:00
parent 25e09815be
commit 687a99279d
4 changed files with 18 additions and 6 deletions

View file

@ -46,7 +46,7 @@ Systray::Systray() // TODO: make singleton, provide ::instance()
_trayEngine->addImageProvider("avatars", new ImageProvider);
_trayEngine->rootContext()->setContextProperty("userModelBackend", UserModel::instance());
_trayEngine->rootContext()->setContextProperty("systrayBackend", this);
_trayComponent = new QQmlComponent(_trayEngine, QUrl(QStringLiteral("qrc:/qml/src/gui/tray/window.qml")));
_trayComponent = new QQmlComponent(_trayEngine, QUrl(QStringLiteral("qrc:/qml/src/gui/tray/Window.qml")));
_trayContext = _trayEngine->contextForObject(_trayComponent->create());
// TODO: hack to pass the icon to QML

View file

@ -40,6 +40,14 @@ ActivityListModel::ActivityListModel(AccountState *accountState, QObject* parent
{
}
QHash<int, QByteArray> ActivityListModel::roleNames() const
{
QHash<int, QByteArray> roles;
roles[PathRole] = "path";
roles[MessageRole] = "message";
return roles;
}
QVariant ActivityListModel::data(const QModelIndex &index, int role) const
{
Activity a;

View file

@ -17,7 +17,7 @@
#include <QtCore>
#include "activitydata.h"
#include "ActivityData.h"
class QJsonDocument;
@ -48,8 +48,9 @@ public:
iconStateSync
};
enum datarole { ActionIconRole = Qt::UserRole + 1,
UserIconRole,
enum datarole {
ActionIconRole = Qt::UserRole + 1,
UserIconRole,
AccountRole,
ObjectTypeRole,
ActionsLinksRole,
@ -95,6 +96,9 @@ private slots:
signals:
void activityJobStatusCode(int statusCode);
protected:
QHash<int, QByteArray> roleNames() const;
private:
void startFetchJob();
void combineActivityLists();

View file

@ -397,12 +397,12 @@ Window {
Layout.alignment: Qt.AlignLeft
Text {
id: activityTextTitle
text: filename
text: path
font.pointSize: 9
}
Text {
id: activityTextInfo
text: info
text: message
font.pointSize: 8
}
}