Commit graph

16 commits

Author SHA1 Message Date
Vadim Peretokin
b23d6f788e
Infrastructure: fix else-after-return in codebase (#9096)
<!-- 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>
2026-07-18 18:39:57 +02:00
Vadim Peretokin
745c4a5b59
Infrastructure: Remove else-after-return anti-pattern (#8575)
<!-- 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>
2025-11-25 18:10:28 +01:00
Vadim Peretokin
8cb58cf0ca
Infrastructure: remove MSVC leak detection (#8378)
<!-- 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>
2025-10-21 15:11:09 +01:00
Vadim Peretokin
a6738f4538
Infrastucture: apply fixes from clazy (const references) (#7599)
<!-- 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>
2024-12-28 13:55:40 +01:00
Vadim Peretokin
ff3ae8de4c
Infrastructure: mark read-only variables as const (#6843)
<!-- 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)
2023-05-14 15:06:15 +02:00
Geert Konijnendijk
d191ff9f53
Infrastructure: Support both Qt5 & Qt6 in CMake and qmake builds (#6654)
#### Brief overview of PR changes/additions

- Port code to work in both Qt5 & Qt6. 
- Notable exception: playing media for Qt6 (see discussion in
https://github.com/Mudlet/Mudlet/issues/5623#issuecomment-1455052433)
- Add support for Qt6 in CMake files
- Add support for Qt6 in qmake file

#### Motivation for adding to Mudlet

See https://github.com/Mudlet/Mudlet/issues/5623

#### Other info (issues closed, discussion etc)

Closes https://github.com/Mudlet/Mudlet/issues/5623. 

##### Suggested follow-up work
- Add support for Qt6 to Windows build
- Add Qt6 targets to CI
- Implement playing media for Qt6 (see discussion in
https://github.com/Mudlet/Mudlet/issues/5623#issuecomment-1455052433)
- Reimplement gamepad support using a different library as the Qt
gamepad module was [removed ](https://wiki.qt.io/Qt_6.0.0_Modules)in Qt6

---------

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@hey.com>
2023-03-20 07:18:24 +01:00
Vadim Peretokin
f744b276ae
Infrastructure: increase minimum Qt to 5.14 (#6133) 2022-06-26 10:29:56 -04:00
Vadim Peretokin
89c0aaaac3
Internal: Add missing braces around statements (#4889)
* Add missing braces

* Add missing braces around statements
2021-02-27 17:25:16 +01:00
Stephen Lyons
91148c6037
Cleanup: remove use of deprecated QString::sprintf(...) (#4426)
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>
2020-12-03 01:35:25 +00:00
Stephen Lyons
58970b8c7f
Cleanup: replace obsoleted form of QString::split(...) (#4424)
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>
2020-12-03 01:34:57 +00:00
Stephen Lyons
d5e71353e5
Cleanup: prevent unused value warnings (again!) (#4415)
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>
2020-11-28 10:37:24 +00:00
Vadim Peretokin
5ffac37c2e
Fix broken editor regression (#4404)
This reverts commit b33b6c8dc3.
2020-11-26 15:00:30 +01:00
Stephen Lyons
b33b6c8dc3 Cleanup_prevent unused value warnings
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>
2020-11-24 22:52:27 +00:00
Stephen Lyons
cd5294609d
Refactor some minor code factor issues (#3706)
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>
2020-05-02 23:49:36 +01:00
Kae
27a3e1fc6d IRC3 with more Lua features (#1087)
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.
2017-06-25 15:14:01 -07:00
Kae
8faf4819d8 IRC client update of UI and logic (#1072)
* 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
2017-06-25 12:05:18 -07:00