By commenting out the parameter name, we get compile-time checks
Also, we can omit them for slots and Qt will not forward the parameters.
In case we had TODOs next to the code, I kept the Q_UNUSED statements
for now.
Overriding and defaulting them in the header doesn't make sense
For the dbus interfaces, we don't have any reasources to clean up or memory to be released. Meaning we can drop those lines too
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/
In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
This makes it easier to read, because we do not have to handle a list of
files that get added to the targets. In other KDE projects, we also
prefer the target centric approach.
In case one wants to reuse the same category in multiple places, it
would be best to create a small static lib. But for now, this is not
needed.
The "enabled" property of the button was set to false and has overwritten the default value based on the message length.
The message field had "anchors.fill" positioning and raised "Binding loop detected for property "implicitHeight"" error.
attachmentList property of ChatMessage didn't have the default value and was undefined.
BUG: 455149
## Summary
Add KLocalizedString::setApplicationDomain for kdeconnect-sms
Per the programmer guide, this must be done, otherwise translations will not happen.
https://api.kde.org/frameworks/ki18n/html/prg_guide.html
## Test Plan
### Before:
kdeconnect-sms would spew errors like `kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "%1" msgid_plural: "" msgctxt: ""`
(Translations still seem to work, though)
### After:
No more ki18n errors, translation works.
## Summary
For awhile (since at least early last year), it has not been possible to scroll past the first screen of message history. I believe this was due to a version bump in some library, but I was not able to biset it at the time.
This changes how messages are loaded to work again. I like this solution better anyway, because it means one can smoothly scroll back in time without needing to stop every time you reach the top of the history.
BUG: 452946
## Test Plan
### Before:
Scrolling to the top of the kdeconnect-sms history would do nothing. You could only view the first handful of messages in the conversation (whichever messages the app decided to load for you when you first open the conversation).
### After:
Scrolling to the top of the list of messages will cause the app to load more, allowing you to view more history of messages.
## Summary
Fix the bug address for the SMS app.
BUG: 452055
## Test Plan
### Before:
Clicking the "Report Bug..." button in the about screen would give a permission denied error.
### After:
Clicking the "Report Bug..." button directs the user to bugzilla to report a new bug with the correct product and component already selected.
Use a singleton instead of context properties for data handling
Fix passing initial message
Make device menu creation more declarative
Fix initial device handling
Update current device when new instance with initial device is requested
## Summary
Fix crash in kdeconnect-sms if a conversation contains a message which has no addresses.
I am not sure why this would happen and there's probably something which should be fixed on the Android side to ensure that every message has addresses, but this is an easy fix to prevent user-reported crashes.
BUG: 449719
## Test Plan
### Before:
kdeconnect-sms crashes upon selecting a conversation with a message with no addresses
### After:
kdeconnect-sms does not crash
- Move the device combobox to the global drawer
- Move search field and new button to header
- Use Kirigami SearchField instead
- Don't switch focus away from search field when typing
- Give the New button an icon
- Clarify the search field text
- Center messages view loading indicator
- Make send and attach buttons stick to bottom of text area
- Make cursor an I-beam when hovering over text area
- Move send button to the right
- Give proper padding to messages view top
- Move refresh action to global drawer
- Show refresh button directly in loading message where it is most useful
| Before | After |
| ------ | ------ |
| ![kdeconnectsms-old1](/uploads/469fa5f198ce81f1f53e8aa73694a824/kdeconnectsms-old1.png) | ![kdeconnectsms-new1](/uploads/c3b2b552d5d1bb73c566c6879c5b2a3c/kdeconnectsms-new1.png) |
| ![kdeconnectsms-old2](/uploads/eed795529946ed9ff856d8599bc66fb2/kdeconnectsms-old2.png) | ![kdeconnectsms-new2](/uploads/7abff93670aaea36052f3e3bfe01da62/kdeconnectsms-new2.png) |
| ![kdeconnectsms-old3](/uploads/f24dc7a902e33a1317cc8d9b90c39482/kdeconnectsms-old3.png) | ![kdeconnectsms-new3](/uploads/ea7d07f64d1904757dce56e86f1876ba/kdeconnectsms-new3.png) |
cc @teams/usability @teams/vdg
This commit makes use of the Kirigami.PlaceholderMessage component
instead of a QML Label, also moves the placeholder message to be
inside the ListView.
## Summary
Replace the (deprecated and removed) reference to `Kirigami.Theme.viewBackgroundColor` with `Kirigami.Theme.backgroundColor`
This element is necessary in order to have theme hot-switching work correctly
BUG 434791
## Test Plan
### Before:
When using the KDE Connect SMS app in an un-modified dark theme, the message entry text box would be rendered as all white and text would correctly be rendered in white (making it un-readable).
This seems to be somehow related to a recent Kirigami version (it only happened to me after doing a distro upgrade and my ancient Kirigami installed to ~/.prefix does not reproduce the issue).
viewBackgroundColor was deprecated and apparently removed from Kirigami a version or two ago. Thus the coloring was no longer correct.
For screenshots and discussion, see [bug 434791](https://bugs.kde.org/show_bug.cgi?id=434791)
### After:
Text and background are rendered in the expected colours for the theme.
On Plasma qqc2-desktop-style is used automatically, but not on other
DEs. Set it as a default and allow overriding it via environment
variables.
Also add it as a runtime dep so distros actually ship it.
We use kdeconnect-version.h in several places and therefore it needs to be in the include path. We currently do this by setting target_include_path in a few places. Replace this with an interface library that we can link against that sets up the correct include path. IMO it is cleaner this way.
Turn smshelper into a static library, which makes sense given it's only used internally at this point. This allows to get rid of some stuff.
Also cleanup other things.
While mostly theoretical it makes for a more expressive API since it communicates that it is a list instead of a single value. It also allows to get rid of some conversion code.
This is also preparation work for potentially using the custom type capabilities that QtDBus offers.
The current implementation seems to have an issue with an undetected binding loop that causes lockup. During investigation I figured that the code was way to complex and brittle for what we need.
This is a cleaner reimplementation. It also replaces the custom Avatar component with the one from Kirigami.
The looks are subject to tweaking of course
Launching smsapp prints:
qrc:/qml/main.qml:36: ReferenceError: _initialMessage is not defined
This patch applies the changes made to the property from C++ in
c17972881b to QML.
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.
Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.