Skip to content

Improve: simplify dlgRoomExits() invocation#5498

Merged
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:Improve_simplify_dlgRoomExits_invocation
Oct 9, 2021
Merged

Improve: simplify dlgRoomExits() invocation#5498
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:Improve_simplify_dlgRoomExits_invocation

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Oct 9, 2021

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 #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!

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>
@SlySven SlySven requested a review from a team as a code owner October 9, 2021 10:22
@SlySven SlySven requested a review from a team October 9, 2021 10:22
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Oct 9, 2021

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

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)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, AFAIK it's a tool limitation.

void slot_checkModified();

private:
void init();
Copy link
Copy Markdown
Member Author

@SlySven SlySven Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordered to put the private methods before the members for consistency...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 9, 2021

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, AFAIK it's a tool limitation.

@vadi2 vadi2 assigned SlySven and unassigned vadi2 Oct 9, 2021
@SlySven SlySven merged commit 365facb into Mudlet:development Oct 9, 2021
@SlySven SlySven deleted the Improve_simplify_dlgRoomExits_invocation branch October 9, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants