Fix typos
src: Yearly copyright bump This time on time!
ssl: Remove fallback code for missing SSL support
src: Yearly copyright bump Let's welcome 2020.
src: Yearly copyright bump ... and it's still January!
sigproxy: Modernize RPC calls (remote signals) The previous implementation relied on undocumented Qt internals to transform signals into RpcCall messages. It also relied on the old-style, slow signal/slot connections and required RPC call receivers to be actual slots, a feature deprecated in Qt. Reimplement this feature to make use of PMF connections. Utilize C++14 features such as variadic lambdas and templates to shift most of the work to compile time, which is not only more efficient, but also gives us compile-time checks for most things. Arguments are now marshalled to and from QVariant using the methods intended for the purpose, rather than reinterpreting void pointers into raw memory (which mimicked the way Qt works internally, but is of course fully unsupported, even though it miraculously worked basically unchanged since the early days of Qt 4...). The marshalling code is generated at compile time, which is more efficient than the previous approach of looking up types and constructing arguments at runtime. SignalProxy::attachSignal() now expects the signal to be given as a member function pointer. SignalProxy::attachSlot() supports member function pointers as well as functors, similar to QObject::connect(). Remove SignalRelay and related methods that are no longer needed. While we're at it, rename RpcCall's slotName attribute to signalName, which better reflects reality. The reimplementation does not affect the protocol; the serialization format remains unchanged.
sigproxy: Actually rename SyncableObjects when requested Until now, renaming a SyncableObject would properly update the maps in SignalProxy, but it would not actually update the objectName property on the client side. Fix this. Remove the renameObject() method in SyncableObject in favor of using setObjectName() and listening to the notifier signal emitted by Qt for triggering the update. This ensures that the actual object name and the expected one stay in sync. Also change places where we unnecessarily rename right after construction to use the appropriate constructor instead. Extend the test case to cover the renaming of SyncableObject.
modernize: Reformat ALL the source... again! It's been more than six years since we last used an autoformatter on the codebase. Tooling has progressed, so has the language and of course our personal preferences. Use clang-format this time to reformat the whole codebase, following the rules laid out in .clang-format (which one can use for configuring an IDE, too, if it supports autoformatting). Overall, the new style is not too different from what we used before, with one significant change: We now attach pointer/reference indicators (*&) to the type rather than the name, i.e. we left-align. While this is a major deviation from the Qt style which we use for almost everything else, it aligns more closely with many other projects, as well as the C++ documentation and STL. It also makes more sense semantically, because */& are really part of the type. Other changes include (but are not limited to): - Use only one blank line between function definitions - Categorize includes from generic/system to local, sorting each category alphabetically. The generic-to-local sort order seems to be more common than the other way round, so we use that. - In .cpp files, the corresponding header is always included first. This is a general recommendation, because it makes it harder to accidentally introduce a reliance on transitive includes in headers. - Consistently break initializers in ctors before the comma, so the commas are left-aligned together with the colon. - Use two spaces between code and trailing comments. Note that sometimes even clang-format gets things wrong. In a few places, formatting was manually fixed; however, reviewing a diff of almost 80k lines is a rather boring task, so we didn't thoroughly go through all the changes. Wrong formatting can always be fixed in follow-up commits, anyway. Note also that we don't intend to re-run clang-format on a regular basis, nor do we want to religiously follow a hardcoded set of rules for new code in the future. Where it makes sense, the rules may be bent in favor of better readability or more pleasing code.
clazy: Convert many old-style connects into function pointer based Since Qt5, signal/slot connections can be expressed using function pointers rather than the SIGNAL/SLOT macros. This is a) much more efficient, and b) provides a compile-time check for the sender and receiver being compatible. Let clazy auto-fix old-style connects where it can. However, a lot of occurrences remain where we'll need manual intervention for one reason or another.
modernize: Use auto where the type is clear from context Apply clang-tidy's modernize-use-auto fix, which uses auto where the type would otherwise be duplicated in the line (e.g. when casting a type, or creating an instance with 'new').
modernize: Use '= default' instead of empty ctor/dtor bodies Also remove lots of unnecessary, empty ctors and dtors.
modernize: Prefer default member init over ctor init Where appropriate, initialize class members in the header rather than in the constructor.
modernize: Pass arguments by value and move in constructors If a method (or constructor) wants to store an argument in a local variable or attribute, one should prefer passing it in by value and moving it into the final location, rather than taking a const reference and copying it over. In the best case, this saves one copy, if the method is called with an rvalue. This pattern is most frequent in constructors initializing class members, so let clang-tidy fix this for argument types that have move constructors.
modernize: Use override instead of virtual Let clang-tidy fix all occurrences where override should be used instead of virtual. Also, let it annotate member functions where virtual was missing in the first place.
modernize: Use nullptr Let clang-tidy fix all occurrences where nullptr should be used instead of 0.
sigproxy: Don't expose the thread_local '_current' attribute Windows does not allow exporting thread_local attributes in the DLL interface. Since it's not good practice anyway to expose such an implementation detail in the public header, make the accessor non-inline and move the attribute into a private anonymous namespace, removing it from the public interface.
qt4-b-gone: Remove all code supporting Qt < 5.5 and KDE4 Remove compatibility code for Qt versions we no longer support.
common: Avoid crash on SignalProxy destruction Since SignalProxy itself attaches a slot, it will try to detach itself on destruction, leading to a crash. Avoid this by checking for self-detachment.
Fix crash caused by repeated kicks of an already-kicked client As it turns out, the QHash[] operator implicitly adds nullptrs to the map when called with a nonexistent key. If a user clicked the button to kick another client multiple times, this would cause a nullptr to be inserted into the peerMap, then causing a crash later on at least when another client connected. To solve the problem, the value() method is used instead, which has no such side-effect. A big thanks to @digitalcircuit for discovering this behavior.
Semi-yearly copyright bump It's no longer 2016.