Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui
find_package(KF6Archive REQUIRED)
find_package(KF6GuiAddons)

#NMC customization: needed to find the ui file in a different location than the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

if (NOT TARGET Qt::GuiPrivate)
message(FATAL_ERROR "Could not find GuiPrivate component of Qt. It might be shipped as a separate package, please check that.")
endif()
Expand Down Expand Up @@ -255,6 +258,10 @@ set(client_SRCS
wizard/linklabel.cpp
)

file(GLOB NMC_FILES "nmcgui/*")
set(NMC_SRCS ${NMC_FILES})
list(APPEND client_SRCS ${NMC_SRCS})

if (WITH_WEBENGINE)
list(APPEND client_SRCS
wizard/webviewpage.h
Expand Down
31 changes: 31 additions & 0 deletions src/gui/nmcgui/nmcsortedactivitylistmodel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) by Eugen Fischer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

#include "nmcsortedactivitylistmodel.h"

namespace OCC {

NMCSortedActivityListModel::NMCSortedActivityListModel(QObject *parent)
: SortedActivityListModel(parent)
{
setSortRole(Qt::DescendingOrder); // Qt6-konforme Sortierung
}

bool NMCSortedActivityListModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
Q_UNUSED(sourceParent)
return sourceRow < _maxEntries; // Vereinfachte Rückgabelogik
}

} // namespace OCC
36 changes: 36 additions & 0 deletions src/gui/nmcgui/nmcsortedactivitylistmodel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) by Eugen Fischer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

#pragma once

#include "tray/sortedactivitylistmodel.h"

namespace OCC {

class NMCSortedActivityListModel : public SortedActivityListModel
{
Q_OBJECT

public:
explicit NMCSortedActivityListModel(QObject *parent = nullptr);
~NMCSortedActivityListModel() override = default;

protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;

private:
int _maxEntries{30}; // Standardwert direkt setzen
};

} // namespace OCC
2 changes: 2 additions & 0 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "tray/syncstatussummary.h"
#include "tray/unifiedsearchresultslistmodel.h"
#include "filesystem.h"
#include "nmcgui/nmcsortedactivitylistmodel.h"

#ifdef WITH_LIBCLOUDPROVIDERS
#include "cloudproviders/cloudprovidermanager.h"
Expand Down Expand Up @@ -142,6 +143,7 @@ ownCloudGui::ownCloudGui(Application *parent)
qmlRegisterType<ShareeModel>("com.nextcloud.desktopclient", 1, 0, "ShareeModel");
qmlRegisterType<SortedShareModel>("com.nextcloud.desktopclient", 1, 0, "SortedShareModel");
qmlRegisterType<SyncConflictsModel>("com.nextcloud.desktopclient", 1, 0, "SyncConflictsModel");
qmlRegisterType<NMCSortedActivityListModel>("com.nextcloud.desktopclient", 1, 0, "NMCSortedActivityListModel");

qmlRegisterUncreatableType<QAbstractItemModel>("com.nextcloud.desktopclient", 1, 0, "QAbstractItemModel", "QAbstractItemModel");
qmlRegisterUncreatableType<Activity>("com.nextcloud.desktopclient", 1, 0, "Activity", "Activity");
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ScrollView {
preferredHighlightBegin: 0
preferredHighlightEnd: controlRoot.height

model: NC.SortedActivityListModel {
model: NC.NMCSortedActivityListModel {
id: sortedActivityList
}

Expand Down