src: Yearly copyright bump This time on time!
src: Yearly copyright bump Let's welcome 2020.
Replace deprecated additionalFormats with formats
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: Require member function pointers for Settings::notify() Require member function pointers for Settings::notify() and Settings::initAndNotify(). This brings us one step closer to being SLOT-free.
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').
qt4-b-gone: Remove all code supporting Qt < 5.5 and KDE4 Remove compatibility code for Qt versions we no longer support.
common: Unify Date/Time formatting, UTC offset Unify date/time formatting for the client UI, using Qt::DateFormat::DefaultLocaleShortDate to respect the operating system's configured locale. This avoids Qt's kind-of-weird default date/time format that mixes numbers and named short months/days. See https://doc.qt.io/qt-5/qt.html#DateFormat-enum Modify AM/PM detection to use application locale, which currently defaults to system locale. This avoids any inconsistencies should Quassel later allow specifying an application-wide locale different from the system locale. In CTCP VERSION replies, always use UTC time in ISO8601 date format, avoiding locale-specific replies and timezone differences. This fixes client version statistic-tracking software from treating different languages and different timezones as unique versions of Quassel IRC. In CTCP TIME replies, use local time in ISO8601 date format with timezone offset. This provides a consistent format for others to parse and still provides the timezone information. Work around a Qt bug for the latter. See https://bugreports.qt.io/browse/QTBUG-26161 And https://stackoverflow.com/questions/18750569/qdatetime-isodate-with-timezone
qss: Introduce new message label "hovered" In order to make the appearance of hovered-upon URLs controllable by stylesheet, add support for a new message label "hovered". Extend the default stylesheet to underline hovered-upon URLs.
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.
client: Highest sender prefix mode, migrate, fix Add a "Highest mode" for showing sender prefixes, to only show the highest in a given situation. This mimics most IRC clients, including Quasseldroid, while still saving the full mode details behind the scenes. Switch the UI from a Checkbox to a ComboBox, with all the 'fun' of enums in Qt. (Tip: don't code when tired.) Add settings migration to preserve "None" for people upgrading, so they won't suddenly see changes. NOTE: 0.13 master users will need to opt in to enable showing sender prefixes again. A migration could be added, but the checkbox has never been in beta or stable... Fix up the "enableSenderBrackets" fallback default to be false, as per Quassel itself. Fix the sender prefix feature check to use "SenderPrefixes" instead of "CoreSideHighlights".
icons: Use more common names for irc-channel-* icons irc-channel-joined and irc-channel-parted are not shipped with Oxygen. Use irc-channel-active and irc-channel-inactive instead, which are supported by both Oxygen and Breeze (and are identical to the previous ones in Breeze).
Semi-yearly copyright bump It's no longer 2016.
uistyle: Ignore format code for Monospace Since the current rendering engine does not easily support switching fonts in the middle of a message, we can't currently support the Monospace format code as specified in [1]. However, to avoid weird artifacts when other clients send this, ignore the format code for now. [1] https://modern.ircdocs.horse/formatting.html#monospace Closes GH-342.
uistyle: Support rendering of strikethrough'd text As defined in [1], format code 0x1e indicates text that is struck through. Add support for rendering this accordingly. Extend the stylesheet parser so the format can be defined, and add to the default stylesheet. [1] https://modern.ircdocs.horse/formatting.html#strikethrough
uistyle: Support reverse color rendering Format codes 0x12 and 0x16 toggle the swap of foreground and background colors. In the current implementation, the color swap only applies to custom colors, i.e. mIRC colors and hex colors. Normal text is not affected. Since this is not a styleable property, remove support for it from the stylesheet parser.
uistyle: Define via stylesheet if color codes have an effect In certain situations, color codes should have no effect, e.g. when selecting text. This required hacks in stylesheets; for example when setting a foreground color for self or highlighted messages, the mIRC colors had to be redefined in the stylesheet for that label. Also the code had some workaround, e.g. for URLs. With the introduction of the non-styleable extended mIRC and hex colors, these workarounds are no longer possible. Solve these issues by introducing two new properties that can be set in the stylesheet: allow-foreground-override: true|false allow-background-override: true|false The default stylesheet sets them to true by default, and to false e.g. for selections. Remove the now unneeded workaround from m4yer's stylesheet, too.
uistyle: Support rendering of hex colors Hex colors are a relatively new addition to IRC, as defined in <https://modern.ircdocs.horse/formatting.html#hex-color>. Note that there are known issues with prioritization in the theme engine (i.e., setting the foreground explicitly in the stylesheet will always override hex colors), which will be fixed in a follow-up commit.
uistyle: Fix weird way of registering Qt types Well, maybe it didn't seem so weird a decade ago, but these days we can do type registration in a nicer way.