mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2025-05-31 16:34:08 +02:00
Do not fetch activities if they are not enabled
Fixes #788 Fixes #834 If the activity app is not enabled we should not try to fetch the activities at all. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
a3d1bd3a42
commit
1d0bf08a1c
@ -291,18 +291,28 @@ void ActivityListModel::combineActivityLists()
|
|||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ActivityListModel::canFetchActivities() const {
|
||||||
|
return _accountState->isConnected() && _accountState->account()->capabilities().hasActivities();
|
||||||
|
}
|
||||||
|
|
||||||
void ActivityListModel::fetchMore(const QModelIndex &)
|
void ActivityListModel::fetchMore(const QModelIndex &)
|
||||||
{
|
{
|
||||||
if (_accountState->isConnected()) {
|
_activityLists = ActivityList();
|
||||||
_activityLists = ActivityList();
|
if (canFetchActivities()) {
|
||||||
startFetchJob();
|
startFetchJob();
|
||||||
|
} else {
|
||||||
|
combineActivityLists();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActivityListModel::slotRefreshActivity()
|
void ActivityListModel::slotRefreshActivity()
|
||||||
{
|
{
|
||||||
_activityLists.clear();
|
_activityLists.clear();
|
||||||
startFetchJob();
|
if (canFetchActivities()) {
|
||||||
|
startFetchJob();
|
||||||
|
} else {
|
||||||
|
combineActivityLists();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActivityListModel::slotRemoveAccount()
|
void ActivityListModel::slotRemoveAccount()
|
||||||
|
@ -67,6 +67,7 @@ signals:
|
|||||||
private:
|
private:
|
||||||
void startFetchJob();
|
void startFetchJob();
|
||||||
void combineActivityLists();
|
void combineActivityLists();
|
||||||
|
bool canFetchActivities() const;
|
||||||
|
|
||||||
ActivityList _activityLists;
|
ActivityList _activityLists;
|
||||||
ActivityList _syncFileItemLists;
|
ActivityList _syncFileItemLists;
|
||||||
|
@ -103,6 +103,10 @@ bool Capabilities::isValid() const
|
|||||||
return !_capabilities.isEmpty();
|
return !_capabilities.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Capabilities::hasActivities() const {
|
||||||
|
return _capabilities.contains("activity");
|
||||||
|
}
|
||||||
|
|
||||||
QList<QByteArray> Capabilities::supportedChecksumTypes() const
|
QList<QByteArray> Capabilities::supportedChecksumTypes() const
|
||||||
{
|
{
|
||||||
QList<QByteArray> list;
|
QList<QByteArray> list;
|
||||||
|
@ -59,6 +59,9 @@ public:
|
|||||||
/// returns true if the capabilities are loaded already.
|
/// returns true if the capabilities are loaded already.
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
|
/// return true if the activity app is enabled
|
||||||
|
bool hasActivities() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the checksum types the server understands.
|
* Returns the checksum types the server understands.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user