#### Brief overview of PR changes/additions
Ran clang-format on all 134 CPP files in src/ using the project's
.clang-format config
#### Motivation for adding to Mudlet
Ensures consistent code formatting across the codebase.
#### Other info (issues closed, discussion etc)
None
**Test case:** Build the project and verify it compiles successfully.
#### Brief overview of PR changes/additions
Text labels are now re-rendered at the current zoom level with dynamic
font sizing, eliminating blurriness when zoomed.
#### Motivation for adding to Mudlet
Map labels were blurry when zoomed because they used fast scaling
instead of re-rendering.
#### Other info (issues closed, discussion etc)
Font size selection removed from label dialog since it's now
auto-calculated to fit.
**Test case:** Create a text label on the map, set it to scale, zoom
in/out, verify text remains crisp at all zoom levels.
https://github.com/user-attachments/assets/14308b15-706a-4d73-a881-bb57416fecae
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Reduce Mudlet build times
#### Motivation for adding to Mudlet
Address #6765, and give developers a better experience.
#### Other info (issues closed, discussion etc)
Benchmark Results
=== Testing: development (before) (development) ===
Run 1 of 3...
Time: 226.071397436s
Run 2 of 3...
Time: 216.059263209s
Run 3 of 3...
Time: 221.592760908s
=== Testing: PR #8403 (after) (pr-8403) ===
Run 1 of 3...
Time: 191.112400957s
Run 2 of 3...
Time: 193.975717783s
Run 3 of 3...
Time: 196.569316252s
[benchmark-mudlet-build.sh](https://github.com/user-attachments/files/24466717/benchmark-mudlet-build.sh)
---------
Co-authored-by: Claude <noreply@anthropic.com>
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
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>
#### Brief overview of PR changes/additions
1. Adds explicit ‘this’ or ‘*this’ capture to lambdas where required
(not in static ones).
2. Rephrases some combinations of Qt `enum`s that whilst acceptable for
C++17 upset the later one. For the non-key related ones which are
provided a `int`s arguments to a method this is sufficient; For Qt 6 there are
some additional methods that overcome the "incompatibility" of combining
such different `enum`s but those have not been back ported to the Qt
5.15.8 I have - despite what https://bugreports.qt.io/browse/QTBUG-99948
says - so fixes for combining QKey and QKeyModifier have been left out of
this PR.
3. Removes a couple of unused variables.
4. Adds our `qsl(...)` wrapper about some raw C-string literals used in
a loop.
5. Rewrite part of the qmake project file so the logic and choices are
correct.
#### Motivation for adding to Mudlet
1. To eliminate the following type of warning when building with a C++20
compiler:
"warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
[-Wdeprecated]"
2. To eliminate the following type of warning when building with a C++20
compiler:
* warning: bitwise operation between different enumeration types
‘QFont::Weight’ and ‘QFont::StyleHint’ is deprecated
[-Wdeprecated-enum-enum-conversion]
* warning: bitwise operation between different enumeration types
‘Qt::TextFlag’ and ‘Qt::AlignmentFlag’ is deprecated
[-Wdeprecated-enum-enum-conversion]
3. To eliminate the following type of warning when building with a C++20
compiler:
"warning: unused variable ‘pHost’ [-Wunused-variable]"
4. To eliminate the following type of warning when building with a C++20
compiler:
"warning: loop variable ‘file’ of type ‘const QString&’ binds to a
temporary constructed from type ‘const char* const’
[-Wrange-loop-construct]"
5. The previous logic was (incorrect)
IF Qt Major version is less than 5
OR (if Qt Major version is less than 6 AND if Qt Minor version is less
than 12))
THEN add `-std=c++20` to `QMAKE_CXXFLAGS`
ELSE add `c++2a` to `CONFIG`
This is borked because we have already rejected Qt versions less than
5.14 so the logic will **always** end up in the **ELSE** case, and
whilst Qt 5.15 is documented as accepting `CONFIG += c++2a` (and
`c++2b`) the earliest Qt 6.x version describes `c++2a` as an obsolete
alias for `c++20` (in
https://doc.qt.io/qt-6.2/qmake-variable-reference.html).
#### Other info (issues closed, discussion etc)
3. The code in the `QFont` cases contains errors that have been copied
from bogus QFont creation code going back to the very first (well
second) commit in the git history. This contained calls of the form
`QFont font("Courier New", 10, QFont::Courier)`
however even the Qt 4.8 documentation does not list a constructor of
that form but instead has:
`QFont(const QString & family, int pointSize = -1, int weight = -1, bool
italic = false)`
the third argument could possibly be `QFont::Normal` (50) or
`QFont::Bold` (75) however the value of `QFont::Courier` is `2`
but it is for a completely different purpose, that of the font matching
strategy ("the font matcher prefers fixed pitch fonts.") but that is not
something that can be set as an argument to the font constructor!
As it happens the combination of `QFont::Bold | QFont::Serif |
QFont::PreferMatch | QFont::PreferAntialias` that was being used
numerically equals 75 + 2 + 32 + 128 = 227 - and the scale that Qt
actually uses only goes from 0 to 99!
5. This change makes the code match the comments!
Overall all the changes in this PR means that
https://github.com/Mudlet/Mudlet/pull/7613 is not required after all -
at least for Mudlet's own code - though there are still some warnings
from the edbee-lib sub-module.
---------
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
#### Brief overview of PR changes/additions
Changes the text entry widget for the text content for that type of "Map
Label" from a `QLineEdit` to a `QPlainTextEdit`.
#### Motivation for adding to Mudlet
To make it possible to enter multi-line texts into text Map Labels. The
existing widget does not show/enable the native entry of line-feeds and
the only way to get them into such texts is to prepare them in an
external location and paste them in - and after doing so they look just
like spaces.
#### Other info (issues closed, discussion etc)
This the first (I hope) of some improvements I want to make to the map
label user-experience. I found out that this was needed whilst MUDding
on After the Plague MUD where, when map making I wanted to label area
exits with some extra details and to include textual information about
locations within the map.
I also discovered the `(bool) tabChangesFocus` property which several
text entry widgets possess which if set (and it is normally `false`)
allows the `<Tab>` key to be used to move the focus out of that widget;
when it is `false` it is used to enter *tabs* into the text itself. For
this widget I have set it to `true` - but I do wonder if there are other
widgets in the Mudlet application where this needs to be reviewed
because it does impact on the user experience particularly for
visually-impaired persons.
---------
Signed-off-by: Stephen Lyons <slysven@virginmedia.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
Add an outline colour chooser to map label creation window in mapper.
Update createMapLabel Lua function to reflect this as well. Adds three
optional arguments to the end of createMapLabel( ..., outlineRed,
outlineGreen, outlineBlue), default to the same colour as foreground if
not specified.
Also, chosen colours weren't being saved from one dialog to the next
forcing unnecessary typing to replicate a colour scheme when creating
multiple labels, so fix this and allow chosen colours to also save
across Mudlet restarts as well.
#### Motivation for adding to Mudlet
Better user experience, more map design options, prettier maps.
#### Other info (issues closed, discussion etc)
- The outline width is only 1 pixel, but as fonts get smaller this
starts to become increasingly larger compared to the width of the small
font. Zoomed in fonts (or larger than 16 on my display) typically look
better.
- Based on this work I think it would be fairly trivial to add drop
shadows, mirroring and other text effects.

Zoomed in;

closes#2861
/claim #2861
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Add consistent file dialog opening locations across application. When a
file dialog is actioned (i.e. a file chosen) save the location globally
in a `QSetting` named `lastFileDialogLocation`. If this setting has not
been set then fallback to default locations as discussed in #5253.
#### Motivation for adding to Mudlet
Consistency across the application.
#### Other info (issues closed, discussion etc)
closes#5253closes#5249
#### Brief overview of PR changes/additions
Update the tr() annotation style, as discussed in #5522
#### Motivation for adding to Mudlet
Makes the code cleaner and also keeps Mudlet in tune with the latest
standards.
#### Other info (issues closed, discussion etc)
/claim #5522
---------
Co-authored-by: TachyonicBytes <support@tachyonicbytes.com>
Co-authored-by: Stephen Lyons <slysven@virginmedia.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)
Start to process the outstanding items in #4578:
* Some clean up of the AnnoucerXxxx files - insert missing `pre_guard`
and `post_guard` header files.
* `EAction` - improve the constructor to take two more arguments that
the class needs. By doing so it is possible to make the two class
members that retain those values `private` - eliminating a `TODO`
comment!
* `dlgMapLabel` - move a couple of (non-standard) colour initialisations
to the header file. Also remove a dummy destructor. Convert a
`QStringLiteral(...)` wrapper to our `qsl(...)` one.
* `dlgModuleManager` - switch from the "Direct" to the "Multiple
Inheritance" approach. This means we can remove a number of pointers and
refer to members from the form/ dialogue directly in the class by their
direct identifier. Insert missing `pre_guard`/`post_guard` Mudlet
headers to `.cpp` file. Add missing `override` to the destructor.
* `dlgPackageManager` - same changes as per `dlgModuleManger`.
For the differences between the "Direct" and "Multiple Inheritance"
approaches mentioned above see:
https://doc.qt.io/qt-5/designer-using-a-ui-file.html
Unfortunately, the `dlgPackageExporter` class is NOT amenable to this
simplification as it uses a custom widget (derived from `QTextEdit`)
whose class is also defined in the same file.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@hey.com>
#### Brief overview of PR changes/additions
make variable name more readable
#### Motivation for adding to Mudlet
Improve readability
#### Other info (issues closed, discussion etc)
Fix#6375
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
When Qt's slot/signal system is used to invoke a method there is some
overhead - so it makes sense to ensure developers can spot all such
methods (functions). We have tried to do this with a `slot_` prefix to
the methods we create but it has not been applied uniformly. This PR
(and one or more to follow) is intended to help with this by more
rigorously doing so - the names changed herein should all follow a
`slot_`*camelCaseMethodName* style. In addition some methods were
detected that are not currently used or which are not actually used via
the signal/slot system, these have been commented out or have had the
prefix removed and the declaration in the relevant header file moved as
appropriate.
For reference the changes made are:
* `TLuaInterpreter::slotDeleteSender(...)` ==>
`TLuaInterpreter::slot_deleteSender(...)`
* `TLuaInterpreter::slotPurge()` ==> `TLuaInterpreter::slot_purge()`
* `cTelnet::handle_socket_signal_connected()` ==>
`cTelnet::slot_socketConnected()`
* `cTelnet::handle_socket_signal_disconnected()` ==>
`cTelnet::slot_socketDisconnected()`
* `cTelnet::handle_socket_signal_hostFound(...)` ==>
`cTelnet::slot_socketHostFound(...)`
* `cTelnet::handle_socket_signal_readyRead()` ==>
`cTelnet::slot_socketReadyToBeRead()`
* `cTelnet::handle_socket_signal_sslError(...)` ==>
`cTelnet::slot_socketSslError(...)`
* `cTelnet::setDownloadProgress(...)` ==>
`cTelnet::slot_setDownloadProgress(...)`
* `dlgComposer::cancel()` ==> `dlgComposer::slot_cancel()`
* `dlgComposer::save()` ==> `dlgComposer::slot_save()`
* `dlgConnectionProfiles::slot_item_clicked(...)` ==>
`dlgConnectionProfiles::slot_itemClicked(...)`
* `dlgConnectionProfiles::slot_save_name()` ==>
`dlgConnectionProfiles::slot_saveName()`
* `dlgConnectionProfiles::slot_update_login(...)` ==>
`dlgConnectionProfiles::slot_updateLogin(...)`
* `dlgConnectionProfiles::slot_update_name(...)` ==>
`dlgConnectionProfiles::slot_updateName(...)`
* `dlgConnectionProfiles::slot_update_pass(...)` ==>
`dlgConnectionProfiles::slot_updatePassword(...)`
* `dlgConnectionProfiles::slot_update_port(...)` ==>
`dlgConnectionProfiles::slot_updatePort(...)`
* `dlgConnectionProfiles::slot_update_SSL_TSL_port(...)` ==>
`dlgConnectionProfiles::slot_updateSslTslPort(...)`
* `dlgConnectionProfiles::slot_update_url(...)` ==>
`dlgConnectionProfiles::slot_updateUrl(...)`
* `dlgMapLabel::pickBgColor()` ==> `dlgMapLabel::slot_pickBgColor()`
* `dlgMapLabel::pickFgColor()` ==> `dlgMapLabel::slot_pickFgColor()`
* `dlgMapLabel::pickFile()` ==> `dlgMapLabel::slot_pickFile()`
* `dlgMapLabel::pickFont()` ==> `dlgMapLabel::slot_pickFont()`
* `dlgMapLabel::save()` ==> `dlgMapLabel::slot_save()`
* `dlgMapLabel::updateControls()` ==>
`dlgMapLabel::slot_updateControls()`
* `dlgMapLabel::updateControlsVisibility()` ==>
`dlgMapLabel::slot_updateControlsVisibility()`
Commented out as not being used:
* `cTelnet::handle_socket_signal_error()` ==>
`cTelnet::slot_socketError()`
* `dlgConnectionProfiles::slot_update_website(...) ==>
`dlgConnectionProfiles::slot_updateWebsite(const QString& url)`
I have my doubts about whether the
`dlgMapLabel::save()`/`dlgMapLabel::slot_save()` method is needed at
all, as it might be that the `QDialog::accept()` slot could have been
inserted into the `QObject::connect(...)` call directly instead...?
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>