Skip to content

Commit 0f4792f

Browse files
committed
Merge #360 [stable-3.16] nmc/2025/2244-Activity_List_Changes
2 parents ee3805c + 851b85c commit 0f4792f

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (C) by Eugen Fischer
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but
10+
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11+
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* for more details.
13+
*/
14+
15+
#include "nmcsortedactivitylistmodel.h"
16+
17+
namespace OCC {
18+
19+
NMCSortedActivityListModel::NMCSortedActivityListModel(QObject *parent)
20+
: SortedActivityListModel(parent)
21+
{
22+
setSortRole(Qt::DescendingOrder); // Qt6-konforme Sortierung
23+
}
24+
25+
bool NMCSortedActivityListModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
26+
{
27+
Q_UNUSED(sourceParent)
28+
return sourceRow < _maxEntries; // Vereinfachte Rückgabelogik
29+
}
30+
31+
} // namespace OCC
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (C) by Eugen Fischer
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but
10+
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11+
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* for more details.
13+
*/
14+
15+
#pragma once
16+
17+
#include "tray/sortedactivitylistmodel.h"
18+
19+
namespace OCC {
20+
21+
class NMCSortedActivityListModel : public SortedActivityListModel
22+
{
23+
Q_OBJECT
24+
25+
public:
26+
explicit NMCSortedActivityListModel(QObject *parent = nullptr);
27+
~NMCSortedActivityListModel() override = default;
28+
29+
protected:
30+
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
31+
32+
private:
33+
int _maxEntries{30}; // Standardwert direkt setzen
34+
};
35+
36+
} // namespace OCC

src/gui/owncloudgui.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "tray/syncstatussummary.h"
4343
#include "tray/unifiedsearchresultslistmodel.h"
4444
#include "filesystem.h"
45+
#include "nmcgui/nmcsortedactivitylistmodel.h"
4546

4647
#ifdef WITH_LIBCLOUDPROVIDERS
4748
#include "cloudproviders/cloudprovidermanager.h"
@@ -142,6 +143,7 @@ ownCloudGui::ownCloudGui(Application *parent)
142143
qmlRegisterType<ShareeModel>("com.nextcloud.desktopclient", 1, 0, "ShareeModel");
143144
qmlRegisterType<SortedShareModel>("com.nextcloud.desktopclient", 1, 0, "SortedShareModel");
144145
qmlRegisterType<SyncConflictsModel>("com.nextcloud.desktopclient", 1, 0, "SyncConflictsModel");
146+
qmlRegisterType<NMCSortedActivityListModel>("com.nextcloud.desktopclient", 1, 0, "NMCSortedActivityListModel");
145147

146148
qmlRegisterUncreatableType<QAbstractItemModel>("com.nextcloud.desktopclient", 1, 0, "QAbstractItemModel", "QAbstractItemModel");
147149
qmlRegisterUncreatableType<Activity>("com.nextcloud.desktopclient", 1, 0, "Activity", "Activity");

src/gui/tray/ActivityList.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ScrollView {
7777
preferredHighlightBegin: 0
7878
preferredHighlightEnd: controlRoot.height
7979

80-
model: NC.SortedActivityListModel {
80+
model: NC.NMCSortedActivityListModel {
8181
id: sortedActivityList
8282
}
8383

0 commit comments

Comments
 (0)