<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Remove unnecessary else/else-if after return, break, continue, and throw
statements - and in places where fixing them is more trouble than its
worth, added NOLINT.
#### Motivation for adding to Mudlet
https://clang.llvm.org/extra/clang-tidy/checks/readability/else-after-return.html,
so it doesn't pop up in PR reviews.
#### Other info (issues closed, discussion etc)
---------
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vadi2@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Remove unnecessary else blocks following return statements throughout
the codebase.
#### Motivation for adding to Mudlet
Better code readability
#### Other info (issues closed, discussion etc)
Other anti patterns are visible in this PR thanks to this, but let's
keep this PR focused on one pattern only.
---------
Co-authored-by: Claude <noreply@anthropic.com>
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Remove support for leak detection using MSVC - this functionality hasn't
been in use in a decade, and we're switching to to using
[LeakSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer)
instead.
#### Motivation for adding to Mudlet
Cleaner code.
#### Other info (issues closed, discussion etc)
---------
Co-authored-by: Claude <noreply@anthropic.com>
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Apply fixes from clazy - mostly add const and references.
#### Motivation for adding to Mudlet
Better code quality and a potentially quicker Mudlet!
#### Other info (issues closed, discussion etc)
Co-authored-by: Vadim Peretokin <vadi2@users.noreply.github.com>
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Mark read-only variables as const - that is, not intended to change
after they've been declared
#### Motivation for adding to Mudlet
So we don't change them by accident later on, and also to clearly state
intentions for the variables
#### Other info (issues closed, discussion etc)
This is also recommended by the [C++ Core
Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es25-declare-an-object-const-or-constexpr-unless-you-want-to-modify-its-value-later-on)
This was not recommended for use even as far back as Qt 4.8 see:
https://doc.qt.io/archives/qt-4.8/qstring.html#sprintf
This commit also removes a triplet of old C-style casts where the speed
improvement by using `float`s is not even justified compared to the
inherent use of `double`s when a `.0` is added to a divisor in a simple
maths expression!
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Change:
`(QStringList) QString::split(const QString&, QString::SplitBehavior,
Qt::CaseSensitivity)`
declared obsolete in Qt 5.14 with the new form:
`(QStringList) QString::split(const QString&, Qt::SplitBehavior,
Qt::CaseSensitivity)`
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Using `Q_UNUSED` will silence the warnings that CMake gives us, though
we have disabled them for ages in the QMake build process.
Also remove some unused methods and variables.
Unlike the previous attempt in PR #4383 that had to be reverted by PR #4404
this does NOT remove a pair of methods from the `TTreeWidget` class that
did not seem to be being called - it turns out that they override methods
in the base `QTreeWidget` class and as such they will be called by Qt
library code when certain things happen to the class.
This reduces the warnings count (if they are shown by the compiler) from a
starting point of about 2718 down to around 696.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Using `Q_UNUSED` will silence the warnings that CMake gives us, though
we have disabled them for ages in the QMake build process.
Also remove some unused methods and variables.
This reduces the warnings count (if they are shown by the compiler) from a
starting point of about 2718 down to around 696.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Refactor: convert from Qt foreach to C++ range-based for loops
Refactor: add/remove spaces in function calls, conditionals & init. lists
Refactor: reorganise a pair of multi-conditions if/elseifs
Simplifies the conditions into a single four alternative
if/elseif/elseif/else, whilst it does mean some of the conditionally
executed lines have to be duplicated into some of the alternatives
it is a little clearer to deduce which lines are used by each alternative.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Changes IRC client to run with settings given per-profile, making the IRC client more visible and configurable within Lua.
This adds configuration options to the settings window in the "Special Options" tab for configuring an IRC client on the host profile which opens the settings window.
See the PR summary comment for details on available Lua functions and IRC Client commands.
* Add Communi Model & Util libs
* Full refactor of IRC Client code & UI
This retains the primary functions of the old IRC client but adds many
more new IRC commands by default. The UI is slightly more organized and
interactive now.
* Adds QPointer to IRC Dialog pointer variable.
* Update Lua `sendIrc()` slightly.
* Added /msg command, Input History, and updated display colors.
Input History stores a total of 8 previously entered commands the user
can cycle through using the Up Arrow key.
The previously include /msg command has been added again.
Colors of some messages have been updated for (relatively) easier
distinction of message lines.
* Updated channel handling.
* Fix CMake builds
Things needed to fix CMake builds:
- communi CMake builds needed `include_directories` explicitly specified
- more MOC calls in communi
- more explicit dependencies to MOC files in communi
- ircmessageformatter must be compiled into mudlet