Modernize the codebase (C++11)
Are you aware of clang-tidy? Fixing at least the override and nullptr warnings should be fairly straightforward using it (https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/).
Yeah, I had it in mind and I ran it on some projects, but I had excuses to not run it on TelepathyQt yet. Thank you for the remind, I think it is a good time to use it right now.
I also would like to apply your https://github.com/JBBgameich/telepathy-qt/commit/3bbe12683d8247948175a42e3ebbd1410a591a5e, :-) but we can't rely on Qt > 5.6 yet.
(e.g. QDateTime::setSecsSinceEpoch() introduced in Qt 5.8)
Would you mind to rework the commit to support Qt 5.6 or split the changes, so we can apply at least qVariantFromValue -> QVariant::fromValue and std::sort replacements? (I'm running override and nullptr conversions so those are going to be irrelevant).
Opened https://github.com/TelepathyIM/telepathy-qt/pull/36 with the changes.
Most of the work is done. Still TODO:
- Use Qt5 connections wherever applicable
- Use default member initializers instead of code in constructors
- Use initializer lists wherever applicable
- Use range-based
forwhere it makes sense
Get rid of stuff like this:
QVariantMap map;
map.insert(QLatin1String(".AvailableMechanisms"),
QVariant::fromValue(mPriv->adaptee->availableMechanisms()));
map.insert(QLatin1String(".HasInitialData"),
QVariant::fromValue(mPriv->adaptee->hasInitialData()));
map.insert(QLatin1String(".CanTryAgain"),
QVariant::fromValue(mPriv->adaptee->canTryAgain()));
map.insert(QLatin1String(".AuthorizationIdentity"),
QVariant::fromValue(mPriv->adaptee->authorizationIdentity()));
map.insert(QLatin1String(".DefaultUsername"),
QVariant::fromValue(mPriv->adaptee->defaultUsername()));
map.insert(QLatin1String(".DefaultRealm"),
QVariant::fromValue(mPriv->adaptee->defaultRealm()));
map.insert(QLatin1String(".MaySaveResponse"),
QVariant::fromValue(mPriv->adaptee->maySaveResponse()));
return map;
For the old-style connects we could look into automating most of the work using clazy. The harder part will be the spec code generator.