src: Yearly copyright bump This time on time!
src: Yearly copyright bump Let's welcome 2020.
src: Yearly copyright bump ... and it's still January!
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.
modernize: Replace most remaining old-style connects by PMF ones Manually replace old-style connects (using the SIGNAL/SLOT macros) by the much more efficient and typesafe pointer-to-member-function- based ones. This fixes the cases where clazy could not auto-migrate to the new syntax for a variety of reasons. In most of the cases, we need to remove overloads or explicitly select the desired one, because the plain syntax cannot deal with overloads. Another issue is trying to connect to signals in a baseclass that are only declared in a derived class (which works with the old-style runtime connection handling, but obviously no longer with the compile-time version). Also do some selected cleanups in places.
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').
qa: Remove lots of superfluous semicolons Since we have now enabled -Wpedantic, the compiler warns us about superfluous semicolons, of which we apparently have a lot. Remove them.
qt4-b-gone: Remove all code supporting Qt < 5.5 and KDE4 Remove compatibility code for Qt versions we no longer support.
clang-tidy: Avoid another warning about potential memory leak This is a false positive (since the newly created QFormLayout takes a widget as its parent), however some slight rearrangement of code shuts up clang-tidy without resorting to NOLINT.
icons: Warn on missing icons Provide new helper functions icon::get() that replace the uses of QIcon::fromTheme. These functions still use fromTheme() internally, but log a warning if an icon could not be found. This should make it easier to detect problems with icons. Replace all uses of QIcon::fromTheme() with icon::get(), remove useless fallbacks as that should be taken care of by the normal icon loader mechanism. Update the icon import script accordingly.
Semi-yearly copyright bump It's no longer 2016.
common: Represent core/client features as string list in the protocol The previous way of representing all supported features as a bit-wise combination of flags is reaching its limits, due to the fact that the old Features enum didn't have a defined width, and thus the compiler can (and does) choose to represent it as a 16 bit value even though the serialization in the protocol is defined as a 32 bit value. In order to solve this problem, and to make feature negotiation more robust, a new field "FeatureList" is added to both "ClientInit" and "ClientInitAck" handshake messages that holds a string list with the supported features. Clients still send both "Features" and "FeatureList" fields when registering, in order to support older cores. The core now omits the legacy "CoreFeatures" field if the client indicates support for extended features. Support for extended features is indicated as the legacy feature 0x8000. Note that legacy features are a subset of the new extended features. Clients supporting extended features are encouraged to send the full list, including legacy ones, in their FeatureList field. Internally, the string-based feature list is mapped to a std::vector<bool> to provide for fast lookup of enabled features. The new methods Client::isCoreFeatureEnabled() and Peer::hasFeature() allow for convenient checking. Both client and core now output a log message if there is a mismatch between the peers.
qtui: Avoid bogus tr() context warning lupdate in Qt versions prior to 5.6.1 has issues parsing brace- initialization in constructors, and complains about "tr() cannot be called without context". Work around this by explicitly giving the class name as suggested in QTBUG-34128.
Fix layout issues in CoreConfigWizard; cleanup Qt has trouble layouting widgets dynamically added to wizard pages, so switch to using QStackedWidget for storage and authenticator settings. Add size policies as needed and explicitly set the size of all pages to fit the largest one to ensure that the wizard is large enough. While we're at it, clean up related code a bit. Closes GH-170.
Rework the handling of storage/auth backends and config The legacy way of transmitting backend settings to the client for initial core configuration was pretty weird, especially regarding the setupKeys/setupDefaults mess that required guesswork on the client side as of the property types. With the introduction of authenticators, an opportunity presented itself to improve this. Upon fixing this, I realized that lots of pretty crazy legacy code was involved, and partially even duplicated for authenticator handling. I could not keep myself from cleaning that up. In the process, the affected parts of the code were modernized too, leveraging Modern C++ and the STL where possible. The setupKeys/setupDefaults properties of the backend info structs are now deprecated and replaced by a setupData list of field IDs, translatable display names, and default values/types. To keep legacy clients working, the old properties are still transmitted until the next protocol break.
ldap: Don't use the backend's display name as identifier We'd like to have the display name translatable, so it should not be used as an identifer. Instead, introduce a backendId property for this purpose.
ldap: ConnectionProperties -> AuthProperties This commit changes the settings key to something making slightly more sense in the context of authentication.
ldap: Some cleanups for GH-170 Mostly formatting and a few other bits.
Authenticator code cleanup as per review * Standardized on "authenticator" rather than "authBackend" * Removed XXXs and replaced with TODO or FIXME comments appropriately * Fixed a couple whitespace errors * Cleared up some comments in the ldap cmake * In the authenticator code, renamed displayName to backendId * Added missing newline at the end of authenticator.cpp