View | Details | Raw Unified | Return to bug 233260 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-14 / +20 lines)
Lines 2-10 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	nextcloudclient
4
PORTNAME=	nextcloudclient
5
PORTVERSION=	0.0.0.20180323
5
PORTVERSION=	2.5.0
6
#DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
PORTREVISION=	2
8
CATEGORIES=	deskutils
7
CATEGORIES=	deskutils
9
8
10
MAINTAINER=	mr@FreeBSD.org
9
MAINTAINER=	mr@FreeBSD.org
Lines 17-47 Link Here
17
16
18
USES=		cmake:outsource,noninja compiler:c++11-lib gmake iconv \
17
USES=		cmake:outsource,noninja compiler:c++11-lib gmake iconv \
19
		localbase:ldflags pkgconfig qt:5 sqlite ssl
18
		localbase:ldflags pkgconfig qt:5 sqlite ssl
20
USE_QT=		buildtools_build concurrent core dbus gui linguist_build network \
19
USE_QT=		buildtools_build concurrent core dbus declarative gui \
21
		qmake_build sql webkit widgets xml
20
		linguist_build location network printsupport qmake_build \
21
		sql webchannel webengine webkit widgets xml
22
22
CMAKE_ARGS=	-DBUILD_WITH_QT4:BOOL=OFF \
23
CMAKE_ARGS=	-DBUILD_WITH_QT4:BOOL=OFF \
23
		-DCMAKE_INSTALL_MANDIR:STRING=man \
24
		-DCMAKE_INSTALL_MANDIR:STRING=man \
24
		-DWITH_STACK_PROTECTOR:BOOL=OFF
25
		-DWITH_STACK_PROTECTOR:BOOL=OFF
25
USE_LDCONFIG=	yes
26
USE_LDCONFIG=	yes
26
INSTALLS_ICONS=	yes
27
27
28
USE_GITHUB=	yes
28
USE_GITHUB=	yes
29
GH_ACCOUNT=	nextcloud
29
GH_ACCOUNT=	nextcloud
30
GH_PROJECT=	client
30
GH_PROJECT=	desktop
31
GH_TAGNAME=	4c40789dcafe5b193e125620b63dcc95e08ffba5
32
31
33
#OPTIONS_DEFINE=		DEBUG DOCS
32
#OPTIONS_DEFINE=	DOCS
34
OPTIONS_DEFINE=		DEBUG # DOCS doesn't build currently
35
33
36
#DOCS_BUILD_DEPENDS=	sphinx-build:textproc/py-sphinx \
34
#DOCS_BUILD_DEPENDS=	sphinx-build:textproc/py-sphinx \
37
#			doxygen:devel/doxygen
35
#			doxygen:devel/doxygen
38
#DOCS_USE=		tex=dvipsk:build,latex:build
36
#DOCS_USE=		tex=dvipsk:build,latex:build
39
#DOCS_CMAKE_ON=		-DWITH_DOC:BOOL=ON
37
#DOCS_CMAKE_ON=	-DWITH_DOC:BOOL=ON
40
38
41
DEBUG_CMAKE_ON=		-DCMAKE_BUILD_TYPE:STRING=Debug
42
43
PLIST_SUB=	VERSION=${PORTVERSION}
39
PLIST_SUB=	VERSION=${PORTVERSION}
44
40
41
.include <bsd.port.pre.mk>
42
43
.ifdef WITH_DEBUG
44
CMAKE_ARGS+=		-DCMAKE_BUILD_TYPE:STRING=Debug
45
.endif
46
47
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1200085 && !${SSL_DEFAULT:Mopenssl111}
48
BROKEN=	nextcloudclient requires OpenSSL 1.1.0, add DEFAULT_VERSIONS+=ssl=openssl111 to /etc/make.conf
49
.endif
50
45
post-patch:
51
post-patch:
46
	@${REINPLACE_CMD} -e \
52
	@${REINPLACE_CMD} -e \
47
		's|.lst |.lst.sample |' ${WRKSRC}/CMakeLists.txt
53
		's|.lst |.lst.sample |' ${WRKSRC}/CMakeLists.txt
Lines 49-52 Link Here
49
pre-configure:
55
pre-configure:
50
	@(cd ${WRKSRC} && ${CP} -f sync-exclude.lst sync-exclude.lst.sample)
56
	@(cd ${WRKSRC} && ${CP} -f sync-exclude.lst sync-exclude.lst.sample)
51
57
52
.include <bsd.port.mk>
58
.include <bsd.port.post.mk>
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1521915864
1
TIMESTAMP = 1542203394
2
SHA256 (nextcloud-client-0.0.0.20180323-4c40789dcafe5b193e125620b63dcc95e08ffba5_GH0.tar.gz) = 311028a8dadc9137699255f9b1d619c45f5ce820f2942697285339bfc6c0e836
2
SHA256 (nextcloud-desktop-v2.5.0_GH0.tar.gz) = 4d639f43e49fd4367cd1b99bf21aecb2eac3bd89a7b0d96c7d2a0975baad6528
3
SIZE (nextcloud-client-0.0.0.20180323-4c40789dcafe5b193e125620b63dcc95e08ffba5_GH0.tar.gz) = 18378272
3
SIZE (nextcloud-desktop-v2.5.0_GH0.tar.gz) = 18914632
(-)files/patch-Fix_activity_flood (+96 lines)
Line 0 Link Here
1
From 1d0bf08a1cc1c1091f195500546a1feec9c84997 Mon Sep 17 00:00:00 2001
2
From: Roeland Jago Douma <roeland@famdouma.nl>
3
Date: Mon, 19 Nov 2018 14:13:51 +0100
4
Subject: [PATCH] Do not fetch activities if they are not enabled
5
6
Fixes #788
7
Fixes #834
8
9
If the activity app is not enabled we should not try to fetch the
10
activities at all.
11
12
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
13
---
14
 src/gui/activitylistmodel.cpp | 16 +++++++++++++---
15
 src/gui/activitylistmodel.h   |  1 +
16
 src/libsync/capabilities.cpp  |  4 ++++
17
 src/libsync/capabilities.h    |  3 +++
18
 4 files changed, 21 insertions(+), 3 deletions(-)
19
20
diff --git a/src/gui/activitylistmodel.cpp b/src/gui/activitylistmodel.cpp
21
index d8bbbeea8..d4f993b55 100644
22
--- src/gui/activitylistmodel.cpp
23
+++ src/gui/activitylistmodel.cpp
24
@@ -291,18 +291,28 @@ void ActivityListModel::combineActivityLists()
25
     endInsertRows();
26
 }
27
 
28
+bool ActivityListModel::canFetchActivities() const {
29
+    return _accountState->isConnected() && _accountState->account()->capabilities().hasActivities();
30
+}
31
+
32
 void ActivityListModel::fetchMore(const QModelIndex &)
33
 {
34
-    if (_accountState->isConnected()) {
35
-        _activityLists = ActivityList();
36
+    _activityLists = ActivityList();
37
+    if (canFetchActivities()) {
38
         startFetchJob();
39
+    } else {
40
+        combineActivityLists();
41
     }
42
 }
43
 
44
 void ActivityListModel::slotRefreshActivity()
45
 {
46
     _activityLists.clear();
47
-    startFetchJob();
48
+    if (canFetchActivities()) {
49
+        startFetchJob();
50
+    } else {
51
+        combineActivityLists();
52
+    }
53
 }
54
 
55
 void ActivityListModel::slotRemoveAccount()
56
diff --git a/src/gui/activitylistmodel.h b/src/gui/activitylistmodel.h
57
index 952dc82d5..9b66da135 100644
58
--- src/gui/activitylistmodel.h
59
+++ src/gui/activitylistmodel.h
60
@@ -67,6 +67,7 @@ private slots:
61
 private:
62
     void startFetchJob();
63
     void combineActivityLists();
64
+    bool canFetchActivities() const;
65
 
66
     ActivityList _activityLists;
67
     ActivityList _syncFileItemLists;
68
diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp
69
index 89942885c..39df7d167 100644
70
--- src/libsync/capabilities.cpp
71
+++ src/libsync/capabilities.cpp
72
@@ -103,6 +103,10 @@ bool Capabilities::isValid() const
73
     return !_capabilities.isEmpty();
74
 }
75
 
76
+bool Capabilities::hasActivities() const {
77
+    return _capabilities.contains("activity");
78
+}
79
+
80
 QList<QByteArray> Capabilities::supportedChecksumTypes() const
81
 {
82
     QList<QByteArray> list;
83
diff --git a/src/libsync/capabilities.h b/src/libsync/capabilities.h
84
index 88ad84c11..8f8fd826a 100644
85
--- src/libsync/capabilities.h
86
+++ src/libsync/capabilities.h
87
@@ -59,6 +59,9 @@ class OWNCLOUDSYNC_EXPORT Capabilities
88
     /// returns true if the capabilities are loaded already.
89
     bool isValid() const;
90
 
91
+    /// return true if the activity app is enabled
92
+    bool hasActivities() const;
93
+
94
     /**
95
      * Returns the checksum types the server understands.
96
      *
(-)files/patch-Fix_activity_loop (+120 lines)
Line 0 Link Here
1
diff --git a/src/gui/activitylistmodel.cpp b/src/gui/activitylistmodel.cpp
2
index d4f993b55..d74e8597b 100644
3
--- src/gui/activitylistmodel.cpp
4
+++ src/gui/activitylistmodel.cpp
5
@@ -150,16 +150,12 @@ int ActivityListModel::rowCount(const QModelIndex &) const
6
     return _finalList.count();
7
 }
8
 
9
-// current strategy: Fetch 100 items per Account
10
-// ATTENTION: This method is const and thus it is not possible to modify
11
-// the _activityLists hash or so. Doesn't make it easier...
12
 bool ActivityListModel::canFetchMore(const QModelIndex &) const
13
 {
14
-    if (_activityLists.count() == 0)
15
-        return true;
16
-
17
+    // We need to be connected to be able to fetch more
18
     if (_accountState && _accountState->isConnected()) {
19
-        if (_activityLists.count() == 0 && !_currentlyFetching) {
20
+        // If the fetching is reported to be done or we are currently fetching we can't fetch more
21
+        if (!_doneFetching && !_currentlyFetching) {
22
             return true;
23
         }
24
     }
25
@@ -177,8 +173,8 @@ void ActivityListModel::startFetchJob()
26
         this, &ActivityListModel::slotActivitiesReceived);
27
 
28
     QUrlQuery params;
29
-    params.addQueryItem(QLatin1String("page"), QLatin1String("0"));
30
-    params.addQueryItem(QLatin1String("pagesize"), QLatin1String("100"));
31
+    params.addQueryItem(QLatin1String("start"), QString::number(_currentItem));
32
+    params.addQueryItem(QLatin1String("count"), QString::number(100));
33
     job->addQueryParams(params);
34
 
35
     _currentlyFetching = true;
36
@@ -192,10 +188,16 @@ void ActivityListModel::slotActivitiesReceived(const QJsonDocument &json, int st
37
 
38
     ActivityList list;
39
     auto ast = _accountState;
40
-    if (!ast)
41
+    if (!ast) {
42
         return;
43
+    }
44
 
45
-    _currentlyFetching = 0;
46
+    if (activities.size() == 0) {
47
+        _doneFetching = true;
48
+    }
49
+
50
+    _currentlyFetching = false;
51
+    _currentItem += activities.size();
52
 
53
     foreach (auto activ, activities) {
54
         auto json = activ.toObject();
55
@@ -212,7 +214,7 @@ void ActivityListModel::slotActivitiesReceived(const QJsonDocument &json, int st
56
         list.append(a);
57
     }
58
 
59
-    _activityLists = list;
60
+    _activityLists.append(list);
61
 
62
     emit activityJobStatusCode(statusCode);
63
 
64
@@ -234,6 +236,7 @@ void ActivityListModel::addNotificationToActivityList(Activity activity) {
65
 void ActivityListModel::removeActivityFromActivityList(int row) {
66
     Activity activity =  _finalList.at(row);
67
     removeActivityFromActivityList(activity);
68
+    combineActivityLists();
69
 }
70
 
71
 void ActivityListModel::addSyncFileItemToActivityList(Activity activity) {
72
@@ -297,10 +300,10 @@ bool ActivityListModel::canFetchActivities() const {
73
 
74
 void ActivityListModel::fetchMore(const QModelIndex &)
75
 {
76
-    _activityLists = ActivityList();
77
     if (canFetchActivities()) {
78
         startFetchJob();
79
     } else {
80
+        _doneFetching = true;
81
         combineActivityLists();
82
     }
83
 }
84
@@ -308,9 +311,13 @@ void ActivityListModel::fetchMore(const QModelIndex &)
85
 void ActivityListModel::slotRefreshActivity()
86
 {
87
     _activityLists.clear();
88
+    _doneFetching = false;
89
+    _currentItem = 0;
90
+
91
     if (canFetchActivities()) {
92
         startFetchJob();
93
     } else {
94
+        _doneFetching = true;
95
         combineActivityLists();
96
     }
97
 }
98
@@ -320,5 +327,7 @@ void ActivityListModel::slotRemoveAccount()
99
     _finalList.clear();
100
     _activityLists.clear();
101
     _currentlyFetching = false;
102
+    _doneFetching = false;
103
+    _currentItem = 0;
104
 }
105
 }
106
diff --git a/src/gui/activitylistmodel.h b/src/gui/activitylistmodel.h
107
index 9b66da135..0c7606a0c 100644
108
--- src/gui/activitylistmodel.h
109
+++ src/gui/activitylistmodel.h
110
@@ -75,7 +75,9 @@ private slots:
111
     ActivityList _notificationErrorsLists;
112
     ActivityList _finalList;
113
     AccountState *_accountState;
114
-    bool _currentlyFetching = true;
115
+    bool _currentlyFetching = false;
116
+    bool _doneFetching = false;
117
+    int _currentItem = 0;
118
 };
119
 }
120
 #endif // ACTIVITYLISTMODEL_H
(-)pkg-plist (+13 lines)
Lines 86-98 Link Here
86
share/nautilus-python/extensions/syncstate-Nextcloud.py
86
share/nautilus-python/extensions/syncstate-Nextcloud.py
87
share/nemo-python/extensions/syncstate-Nextcloud.py
87
share/nemo-python/extensions/syncstate-Nextcloud.py
88
share/nextcloud/i18n/client_TW.qm
88
share/nextcloud/i18n/client_TW.qm
89
share/nextcloud/i18n/client_bg.qm
89
share/nextcloud/i18n/client_ca.qm
90
share/nextcloud/i18n/client_ca.qm
90
share/nextcloud/i18n/client_cs.qm
91
share/nextcloud/i18n/client_cs.qm
91
share/nextcloud/i18n/client_de.qm
92
share/nextcloud/i18n/client_de.qm
92
share/nextcloud/i18n/client_el.qm
93
share/nextcloud/i18n/client_el.qm
93
share/nextcloud/i18n/client_en.qm
94
share/nextcloud/i18n/client_en.qm
95
share/nextcloud/i18n/client_en_GB.qm
94
share/nextcloud/i18n/client_es.qm
96
share/nextcloud/i18n/client_es.qm
95
share/nextcloud/i18n/client_es_AR.qm
97
share/nextcloud/i18n/client_es_AR.qm
98
share/nextcloud/i18n/client_es_CL.qm
99
share/nextcloud/i18n/client_es_CO.qm
100
share/nextcloud/i18n/client_es_CR.qm
101
share/nextcloud/i18n/client_es_DO.qm
102
share/nextcloud/i18n/client_es_EC.qm
103
share/nextcloud/i18n/client_es_GT.qm
104
share/nextcloud/i18n/client_es_HN.qm
105
share/nextcloud/i18n/client_es_MX.qm
106
share/nextcloud/i18n/client_es_SV.qm
96
share/nextcloud/i18n/client_et.qm
107
share/nextcloud/i18n/client_et.qm
97
share/nextcloud/i18n/client_eu.qm
108
share/nextcloud/i18n/client_eu.qm
98
share/nextcloud/i18n/client_fa.qm
109
share/nextcloud/i18n/client_fa.qm
Lines 100-107 Link Here
100
share/nextcloud/i18n/client_fr.qm
111
share/nextcloud/i18n/client_fr.qm
101
share/nextcloud/i18n/client_gl.qm
112
share/nextcloud/i18n/client_gl.qm
102
share/nextcloud/i18n/client_hu.qm
113
share/nextcloud/i18n/client_hu.qm
114
share/nextcloud/i18n/client_is.qm
103
share/nextcloud/i18n/client_it.qm
115
share/nextcloud/i18n/client_it.qm
104
share/nextcloud/i18n/client_ja.qm
116
share/nextcloud/i18n/client_ja.qm
117
share/nextcloud/i18n/client_lt_LT.qm
105
share/nextcloud/i18n/client_nb_NO.qm
118
share/nextcloud/i18n/client_nb_NO.qm
106
share/nextcloud/i18n/client_nl.qm
119
share/nextcloud/i18n/client_nl.qm
107
share/nextcloud/i18n/client_pl.qm
120
share/nextcloud/i18n/client_pl.qm

Return to bug 233260