Shift+return was always inserting newline at the end of the current line of text, ignoring where the cursor was, and not overriding currently selected text
BUG: 488585
## Summary
Due to the difficult-to-test Qt5 -> Qt6 transition, there were some GUI errors with the SMS app:
- Contact photos were missing
- Attachment previews, if present, were in the place where the contact photo should be
This also takes a shot at fixing the long-standing issue that attachment previews were shown much taller than the row item, drawing over the items above and below.
## Test Plan
### Before:
As in description, the conversations list items were not correct.
![image](/uploads/f68b662fecd6a4826986ede6e8191470/image.png)
### After:
Contact photos are shown to the left of the text preview, attachment preview, if present, is shown to the far right.
![image](/uploads/95f2b4d6e6ff26371a2f36d97fc3f52b/image.png)
Preview icon and subtitle formatting were not optimal (shifted and
not eliding properly). Refactor the delegate into a ItemDelegate
with a proper content item.
In addition, clean up some redundancy and generally refactor the
qml properties/items.
Unfortunately, most issues are in Kirigami and we can't fix them from our side. Namely, these things remain unfixed:
- `Kirigami.PlaceholderMessage` are not read by screen readers
- When navigating with the keyboard, pressing tab selects elements from right to left, which is weird
- When navigating with the keyboard, the selected element is not highlighted
- `Kirigami.Action` that don't have a `text` property don't use the `Accessible.name` property when using a screen reader.
Directly calling signals is the supported way to send signals.
Calling signal handlers worked in the past, but will be phased out in
the future (https://bugreports.qt.io/browse/QTBUG-120573).
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