WIP: Kirigami :) #37

Open
CarlSchwan wants to merge 10 commits from CarlSchwan/harbour-nextcloud-talk:work/kirigami into master

Still very much work in progress and lot of feature missing

Still very much work in progress and lot of feature missing
CarlSchwan added 1 commit 1 year ago
CarlSchwan added 1 commit 1 year ago
blizzz reviewed 1 year ago
// SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: CC0-1.0
#include "ConversationTypeClass.h"
Owner

This makes me curious, what are the advantages to add a cpp file that only imports its header?

This makes me curious, what are the advantages to add a cpp file that only imports its header?
Poster

I made the class a Q_GADGET with a Q_ENUM, to be able to use the enums in the QML. This has the side-effects that now a cpp files with all the metaobject stuff is now required.

I made the class a Q_GADGET with a Q_ENUM, to be able to use the enums in the QML. This has the side-effects that now a cpp files with all the metaobject stuff is now required.
Owner
Actually, I was using them before in QML, .e.g: https://codeberg.org/blizzz/harbour-nextcloud-talk/src/branch/master/qml/pages/chat/rooms.qml#L85
blizzz reviewed 1 year ago
try {
account = accountFromId(id);
} catch (...) {
NextcloudAccount* account = account = accountFromId(id);
Owner

Is this a short hand for what it replaces?

Is this a short hand for what it replaces?
Poster

theaccount = account is indeed wrong and should just be account =. Basically what I did is remove the exception throwing code and just use the more usual nullptr pattern.

try catch in cpp are not really recommanded to use because it's slow and usually using std::optional<Value>, std::variant<Value, Err> or an old schoold nullptr is a better idea.

the`account = account ` is indeed wrong and should just be `account =`. Basically what I did is remove the exception throwing code and just use the more usual nullptr pattern. try catch in cpp are not really recommanded to use because it's slow and usually using std::optional\<Value>, std::variant\<Value, Err> or an old schoold nullptr is a better idea.
Owner

Good to know, I had no clue :) Thanks!

Good to know, I had no clue :) Thanks!
Owner

Wow, what a huge amount of work!! About the code itself i do not have any remarks so far after a first glance (apart of the questions). I tried to give it a build though:

It does not build for me in the SFOS IDE at the moment. First thing necessary: enable C++17 in the .pro file:

diff --git a/harbour-nextcloud-talk.pro b/harbour-nextcloud-talk.pro
index 36bd755..eabaa69 100644
--- a/harbour-nextcloud-talk.pro
+++ b/harbour-nextcloud-talk.pro
@@ -15,6 +15,7 @@ TARGET = harbour-nextcloud-talk
 CONFIG += sailfishapp
 PKGCONFIG += nemonotifications-qt5 sailfishsecrets
 QT += sql dbus
+QMAKE_CXXFLAGS += -std=c++17
 
 notificationcategories.files=$$PWD/notificationcategories/*.conf
 notificationcategories.path=/usr/share/lipstick/notificationcategories

(I cannot push here)

But next is:

 roomservice.o:-1: error: in function `RoomService::startPolling(QString const&, int)':
 File not found: roomservice.o

According to https://doc.qt.io/archives/qt-5.6/qmake-variable-reference.html#objects this should be automatically added as long as the file is listed in the SOURCES variable, which it is. 🤔

Wow, what a huge amount of work!! About the code itself i do not have any remarks so far after a first glance (apart of the questions). I tried to give it a build though: It does not build for me in the SFOS IDE at the moment. First thing necessary: enable C++17 in the .pro file: ```diff diff --git a/harbour-nextcloud-talk.pro b/harbour-nextcloud-talk.pro index 36bd755..eabaa69 100644 --- a/harbour-nextcloud-talk.pro +++ b/harbour-nextcloud-talk.pro @@ -15,6 +15,7 @@ TARGET = harbour-nextcloud-talk CONFIG += sailfishapp PKGCONFIG += nemonotifications-qt5 sailfishsecrets QT += sql dbus +QMAKE_CXXFLAGS += -std=c++17 notificationcategories.files=$$PWD/notificationcategories/*.conf notificationcategories.path=/usr/share/lipstick/notificationcategories ``` (I cannot push here) But next is: ``` roomservice.o:-1: error: in function `RoomService::startPolling(QString const&, int)': File not found: roomservice.o ``` According to https://doc.qt.io/archives/qt-5.6/qmake-variable-reference.html#objects this should be automatically added as long as the file is listed in the SOURCES variable, which it is. 🤔
CarlSchwan added 1 commit 1 year ago
Poster

Sending messages now works :D image

As for the qmake errors, I will need to figure out how to use the sailfish sdk, curently it gives me some connections errors with the builder when trying to build the project.

Sending messages now works :D ![image](/attachments/2468abe4-6f24-401e-bf26-09d2a5a42ac4) As for the qmake errors, I will need to figure out how to use the sailfish sdk, curently it gives me some connections errors with the builder when trying to build the project.
114 KiB
CarlSchwan added 2 commits 11 months ago
CarlSchwan added 1 commit 11 months ago
CarlSchwan added 1 commit 11 months ago
9d7a0f91b5
Many small fixes and perf improvements
CarlSchwan added 1 commit 11 months ago
cd0b3f04ba
Add support back for images in C++ model
CarlSchwan added 1 commit 11 months ago
CarlSchwan added 1 commit 11 months ago
This pull request has changes conflicting with the target branch.
src/roomservice.cpp
src/roomservice.h
src/services/accounts.cpp
src/services/accounts.h
src/services/capabilities.h
src/services/download.cpp
qml/pages/chat/room.qml
src/harbour-nextcloud-talk.cpp
src/providers/abstractnextcloudimageprovider.cpp
src/services/capabilities.cpp
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blizzz/harbour-nextcloud-talk#37
Loading…
There is no content yet.