Skip to content

Commit b70044d

Browse files
committed
fixup! refactor: Port to QML modules
1 parent db4e44d commit b70044d

File tree

8 files changed

+54
-44
lines changed

8 files changed

+54
-44
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ include(KDEInstallDirs)
9494
include(KDECMakeSettings)
9595
include(ECMMarkNonGuiExecutable)
9696
include(ECMSetupVersion)
97+
include(ECMQmlModule)
9798

9899
#include(KDECompilerSettings NO_POLICY_SCOPE)
99100
include(ECMEnableSanitizers)

src/3rdparty/kirigami/wheelhandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class WheelFilterItem : public QQuickItem
169169
class WheelHandler : public QObject
170170
{
171171
Q_OBJECT
172+
QML_NAMED_ELEMENT(WheelHandler)
172173

173174
/**
174175
* @brief This property holds the Qt Quick Flickable that the WheelHandler will control.

src/gui/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ set(client_SRCS
150150
syncrunfilelog.cpp
151151
systray.h
152152
systray.cpp
153+
types.h
154+
types.cpp
153155
userinfo.h
154156
userinfo.cpp
155157
vfsdownloaderrordialog.h
@@ -487,13 +489,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
487489
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
488490
endif()
489491

490-
add_library(nextcloudCore STATIC ${final_src})
492+
add_library(nextcloudCore STATIC)
491493

492-
qt_add_qml_module(nextcloudCore
494+
ecm_add_qml_module(nextcloudCore
493495
URI com.nextcloud.desktopclient
496+
GENERATE_PLUGIN_SOURCE
494497
IMPORTS
495498
com.nextcloud.desktopclient.tray
496-
com.nextcloud.desktopclient.filedetails
499+
com.nextcloud.desktopclient.filedetails
497500
QML_FILES
498501
UserStatusMessageView.qml
499502
UserStatusSelectorPage.qml
@@ -502,6 +505,8 @@ qt_add_qml_module(nextcloudCore
502505
UserStatusSetStatusView.qml
503506
PredefinedStatusButton.qml
504507
ErrorBox.qml
508+
SOURCES
509+
${final_src}
505510
)
506511

507512
target_link_libraries(nextcloudCore PUBLIC

src/gui/EmojiPicker.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Controls
88
import QtQuick.Layouts
99

1010
import Style
11-
import com.nextcloud.desktopclient 1.0 as NC
11+
import com.nextcloud.desktopclient as NC
1212
import "./tray"
1313

1414
ColumnLayout {

src/gui/filedetails/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
add_library(nextcloudFileDetails STATIC)
66

7-
qt_add_qml_module(nextcloudFileDetails
7+
ecm_add_qml_module(nextcloudFileDetails
88
URI com.nextcloud.desktopclient.filedetails
9+
GENERATE_PLUGIN_SOURCE
910
QML_FILES
1011
FileActivityView.qml
1112
FileDetailsPage.qml

src/gui/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <QQmlExtensionPlugin>
3636

3737
Q_IMPORT_QML_PLUGIN(com_nextcloud_desktopclient_trayPlugin)
38+
Q_IMPORT_QML_PLUGIN(com_nextcloud_desktopclient_filedetailsPlugin)
3839

3940
using namespace OCC;
4041

src/gui/tray/CMakeLists.txt

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,11 @@
22
# SPDX-FileContributor: Carl Schwan <carl.schwan@nextcloud.com>
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
add_library(nextcloudTray STATIC
6-
activitydata.cpp
7-
activitydata.h
8-
activitylistmodel.cpp
9-
activitylistmodel.h
10-
asyncimageresponse.cpp
11-
fileactivitylistmodel.cpp
12-
fileactivitylistmodel.h
13-
notificationhandler.cpp
14-
notificationhandler.h
15-
sortedactivitylistmodel.cpp
16-
sortedactivitylistmodel.h
17-
svgimageprovider.cpp
18-
svgimageprovider.h
19-
syncstatussummary.cpp
20-
syncstatussummary.h
21-
talkreply.cpp
22-
trayimageprovider.cpp
23-
unifiedsearchresult.cpp
24-
unifiedsearchresult.h
25-
unifiedsearchresultslistmodel.cpp
26-
unifiedsearchresultslistmodel.h
27-
usermodel.cpp
28-
usermodel.h
29-
)
30-
31-
target_link_libraries(nextcloudTray PRIVATE nextcloudCore Qt::QmlIntegration)
5+
add_library(nextcloudTray STATIC)
326

33-
qt_add_qml_module(nextcloudTray
7+
ecm_add_qml_module(nextcloudTray
348
URI com.nextcloud.desktopclient.tray
9+
GENERATE_PLUGIN_SOURCE
3510
QML_FILES
3611
MainWindow.qml
3712
UserLine.qml
@@ -66,4 +41,30 @@ qt_add_qml_module(nextcloudTray
6641
ListItemLineAndSubline.qml
6742
TrayFoldersMenuButton.qml
6843
TrayFolderListItem.qml
44+
SOURCES
45+
activitydata.cpp
46+
activitydata.h
47+
activitylistmodel.cpp
48+
activitylistmodel.h
49+
asyncimageresponse.cpp
50+
fileactivitylistmodel.cpp
51+
fileactivitylistmodel.h
52+
notificationhandler.cpp
53+
notificationhandler.h
54+
sortedactivitylistmodel.cpp
55+
sortedactivitylistmodel.h
56+
svgimageprovider.cpp
57+
svgimageprovider.h
58+
syncstatussummary.cpp
59+
syncstatussummary.h
60+
talkreply.cpp
61+
trayimageprovider.cpp
62+
unifiedsearchresult.cpp
63+
unifiedsearchresult.h
64+
unifiedsearchresultslistmodel.cpp
65+
unifiedsearchresultslistmodel.h
66+
usermodel.cpp
67+
usermodel.h
6968
)
69+
70+
target_link_libraries(nextcloudTray PRIVATE nextcloudCore Qt::QmlIntegration)

src/gui/types.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ class UserStatusForeign
1616
{
1717
Q_GADGET
1818
QML_NAMED_ELEMENT(UserStatus)
19-
QML_FOREIGN(UserStatus)
20-
QML_UNCREATABLE()
19+
QML_FOREIGN(OCC::UserStatus)
20+
QML_UNCREATABLE("")
2121
};
2222

2323
class ShareeForeign
2424
{
2525
Q_GADGET
2626
QML_NAMED_ELEMENT(Sharee)
27-
QML_FOREIGN(Sharee)
28-
QML_UNCREATABLE()
27+
QML_FOREIGN(OCC::Sharee)
28+
QML_UNCREATABLE("")
2929
};
3030

3131
class ClientSideEncryptionTokenSelectorForeign : public QObject
3232
{
3333
Q_OBJECT
3434
QML_NAMED_ELEMENT(ClientSideEncryptionTokenSelector)
35-
QML_FOREIGN(ClientSideEncryptionTokenSelector)
36-
QML_UNCREATABLE()
35+
QML_FOREIGN(OCC::ClientSideEncryptionTokenSelector)
36+
QML_UNCREATABLE("")
3737
};
3838

3939
class ThemeForeign : public QObject
4040
{
4141
Q_OBJECT
4242
QML_NAMED_ELEMENT(Theme)
43-
QML_FOREIGN(Theme)
43+
QML_FOREIGN(OCC::Theme)
4444
QML_SINGLETON
45-
QML_UNCREATABLE()
45+
QML_UNCREATABLE("")
4646

47-
static Theme *create(QQmlEngine *, QJSEngine *engine)
47+
static OCC::Theme *create(QQmlEngine *, QJSEngine *engine)
4848
{
49-
auto _instance = Theme::instance();
50-
QQmlEngine::setObjectOwnership(_instance, QJSEngine::CppOwnership);
49+
auto _instance = OCC::Theme::instance();
50+
QQmlEngine::setObjectOwnership(_instance, QJSEngine::CppOwnership);
5151
return _instance;
5252
}
5353
};

0 commit comments

Comments
 (0)