WIP: Kirigami :) #37

Open
CarlSchwan wants to merge 3 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 2 months ago
CarlSchwan added 1 commit 1 month ago
blizzz reviewed 3 weeks ago
// SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: CC0-1.0
#include "ConversationTypeClass.h"
blizzz commented 3 weeks ago
Poster
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.
blizzz commented 3 days ago
Poster
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 3 weeks ago
try {
account = accountFromId(id);
} catch (...) {
NextcloudAccount* account = account = accountFromId(id);
blizzz commented 3 weeks ago
Poster
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.
blizzz commented 2 weeks ago
Poster
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 3 weeks 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
This pull request is marked as a work in progress.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.