Summary:
Change all member variables to the form m_fooBar because it is the preferred form in Qt (it was half and half between this and mFooBar, and a minority didn't have anything).
Place all references and pointers on the side of the type since it is the majority.
Basically:
- mFoo -> m_foo
- foo -> m_foo (if it is a member variable)
- Type &ref -> Type& ref
- Type *ptr -> Type* ptr
Reviewers: #kde_connect, nicolasfella, albertvaka
Reviewed By: #kde_connect, nicolasfella, albertvaka
Subscribers: albertvaka, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D7312
Summary:
The use of Q_FOREACH is advised against (https://doc.qt.io/qt-5/qtglobal.html#Q_FOREACH) since Qt 5.7 and will eventually be removed from Qt.
I replaced all occurrences with the range-for loop introduced in C++11 (except for the one in daemon.cpp in deviceIdByName which might have a bug / typo in it).
I added const to the container or casted it with qAsConst when appropriate to avoid unnecessary copies.
(This is my first submission. I did all the unit tests, and they all passed but I don't know how to show it here.)
Reviewers: #kde_connect, nicolasfella, apol
Reviewed By: #kde_connect, nicolasfella, apol
Subscribers: albertvaka, apol, nicolasfella
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D6724
set the image data as QByteArray of the right size, otherwise
referencing a stack-based char data will be problematic when the
function is out of scope
As discussed with Albert, move the population of capabilities into the
identity package, making them static along the execution of the link.
When we receive the identityPackage, we collect the plugins we can use with
the device and stick to those. This should simplify the implementation and
remove the possibility to lose packages if packages are received before the
capabilities are processed in the former approach.
REVIEW: 128386
Introduces a big fat buffer :(
Actually test the trasfers :)
Takes QSslSocket causistic into account, for some reason QNAM refuses to
mark as finished when the QSslSocket (through QIODevice) closes.
It would be good to look into dropping the QBuffer, doing so with the test
in place will help.
In case we need to discover the device (i.e. we're running the test in a
clean environment) we need to acquire the discovery mode.
Only initialize the test after setting the test mode enabled, so the
loopback is enabled.
Configurably attach icons as payload to notification packages. By
design and due to restrictions on mobile devices *only* png is sent.
As KIconLoader preferably returns svg icons from iconPath() we fall
back to loading from "hicolor" using KIconTheme directly. Otherwise
*many* icons are dropped because of svg format.
This also improves slightly the test-case to use a tweaked TestDevice
to allow for inspecting sent NetworkPackage-s.
REVIEW: 126666
Make the share received notification explicitly internal.
Fix runtime warning about how QUrl cannot be exported.
Notify about all shares, not exclusively transferred files.
There are still some code paths where it doesn't get destroyed though,
like when the device gets unreachable (and the download socket doesn't
close for some reason).
This meant to add a lot of dependencies to each plugin since we had
KDELibs4support as PUBLIC link meaning that anything linking against
kdeconnectcore was linking at the same time to mostly all frameworks.
Now each plugin has more or less its dependencies in the CMake some
still depend on KDELibs4Support.
For the mousepad plugin I needed to add a fixX11.h file that basically
undefines/defines again some stuff xlib has that conflcits with normal
C++ and Qt.
Before it was not conflicting because some lib within KDELibs4Support
was including this file, but now we have to do it ourselves.
Straight forward port from QJson to the native Json support.
As a note I have added 2 helper functions that make the code bit more
readable (object2qvariant and qvariatn2qobject).
Ported using KDELibs4Support, for a smaller delta, so we can keep
developing on master until we decide not to.
At the moment, it builds and installs but tests don't pass because
of a QCA2 initialization problem I didn't manage to debug yet.
CCMAIL: kdeconnect@kde.org
Now protocol version is only sent once (in the identity package)
Removed "isEncrypted" bit, using type "kdeconnect.encrypted" instead.
NetworkPackage's decrypt and unserialize return false when find problems
Updated tests.
Fixed some bugs in the pairing process state machine
Keys are now stored in base64 in KConfig (was storing non-allowed chars)
Updated NetworkPackage tests to include encryption
Increased networkpackage version 1 -> 2