Improve: simplify dlgRoomExits() invocation#5498
Conversation
This removes the need for the code that uses the `dlgRoomExits` class from having to also call that class's `init()` method - the room ID for which the dialogue is being used is now to be provided in the constructor rather than in the now made private method. As a side-effect it become obvious that there is no need to provide the room ID as an argument to the `dlgRoomExit::initExit(...)` method as the value is already available in the class's member `(int) mRoomID`! This PR is a part that has been extracted from the draft (and to be replaced) PR Mudlet#5308 - that is to be broken up into smaller, easier to digest, chunks! 8-) Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
| const QString doubleParagraph{QStringLiteral("<p>%1</p><p>%2</p>")}; | ||
|
|
||
| dlgRoomExits::dlgRoomExits(Host* pH, QWidget* pW) : QDialog(pW), mpHost(pH), mpEditItem(nullptr), pR(), mRoomID(), mEditColumn() | ||
| dlgRoomExits::dlgRoomExits(Host* pH, const int roomNumber, QWidget* pW) |
There was a problem hiding this comment.
<aside>I don't know about anyone else but I find the "one member per line" layout (that we used to use) easier to read than the all on one line that our current .clang-format currently produces...</aside>
There was a problem hiding this comment.
Yeah, AFAIK it's a tool limitation.
| void slot_checkModified(); | ||
|
|
||
| private: | ||
| void init(); |
There was a problem hiding this comment.
Reordered to put the private methods before the members for consistency...
|
clang-tidy review says "All clean, LGTM! 👍" |
| const QString doubleParagraph{QStringLiteral("<p>%1</p><p>%2</p>")}; | ||
|
|
||
| dlgRoomExits::dlgRoomExits(Host* pH, QWidget* pW) : QDialog(pW), mpHost(pH), mpEditItem(nullptr), pR(), mRoomID(), mEditColumn() | ||
| dlgRoomExits::dlgRoomExits(Host* pH, const int roomNumber, QWidget* pW) |
There was a problem hiding this comment.
Yeah, AFAIK it's a tool limitation.
This removes the need for the code that uses the
dlgRoomExitsclass from having to also call that class'sinit()method - the room ID for which the dialogue is being used is now to be provided in the constructor rather than in the now made private method.As a side-effect it become obvious that there is no need to provide the room ID as an argument to the
dlgRoomExit::initExit(...)method as the value is already available in the class's member(int) mRoomID!This PR is a part that has been extracted from the draft (and to be replaced) PR #5308 - that is to be broken up into smaller, easier to digest, chunks! 8-)
Signed-off-by: Stephen Lyons slysven@virginmedia.com
Release post highlight
None - not something that needs to be announced!