Skip to content

Improve: use constants to index into special exit columns in dlgRoomExits#5505

Merged
SlySven merged 5 commits intoMudlet:developmentfrom
SlySven:Improve_useConstantsToIndexIntoSpecialExitColumnsIn_dlgRoomExits
Oct 13, 2021
Merged

Improve: use constants to index into special exit columns in dlgRoomExits#5505
SlySven merged 5 commits intoMudlet:developmentfrom
SlySven:Improve_useConstantsToIndexIntoSpecialExitColumnsIn_dlgRoomExits

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Oct 11, 2021

This will make changing/adding the columns easier as part of what was created as the draft (and to be replaced) PR #5308 - that is to be broken up into smaller, easier to digest, chunks! 8-)

I also needed to duplicate the column indexes in a second class but I can't see how to the share a single set of index definitions between the dlgRoomExit class and the exitstreewidget one - the latter is a base class on which the former depends but getting the one to inherit from the other is beyond me...There is a single set of constants which are defined in the exitstreewidget but used also by the dlgRoomExit one by virtue of making it a friend of the former.

As it happens I spotted the need for the second set both classes to have these constants when I reviewed (void) ExitsTreeWidget::keyPressEvent(QKeyEvent*) and spotted that I had not revised it to close the correct persistent editors in the merge commit 83db9f9 (part of PR #439) seven years ago!

Signed-off-by: Stephen Lyons slysven@virginmedia.com

Release post highlight

None - I think - this is an internal tweak to make a subsequent PR easier to follow

Edited

Following ff6deef ensure the text squashed into the final commit message for this PR reflects the revised text!

…olumns

This will make changing/adding the columns easier as part of what was
created as 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>
…ditors

I can't see how to share a single set of index definitions between the
`dlgRoomExit` class and the `exitstreewidget` one - the latter is a base
class on which the former depends but getting the one to inherit from the
other is beyond me...

As it happens I spotted the need for the second set when I reviewed
`(void) ExitsTreeWidget::keyPressEvent(QKeyEvent*)` and spotted that I had
not revised it to close the correct persistent editors in the merge
commit 83db9f9 (part of PR Mudlet#439) seven
years ago!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team as a code owner October 11, 2021 00:40
@SlySven SlySven requested a review from a team October 11, 2021 00:40
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Oct 11, 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.

@github-actions
Copy link
Copy Markdown
Contributor

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

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 11, 2021

I also needed to duplicate the column indexes in a second class

Would the "friend" mechanic in C++ help here?

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.

Definitely a welcome improvement 👍

@vadi2 vadi2 assigned SlySven and unassigned vadi2 Oct 11, 2021
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Oct 11, 2021

I also needed to duplicate the column indexes in a second class

Would the "friend" mechanic in C++ help here?

😲 Of course - that is what I needed...

This is so that all the (`static const`) `colIndex_Xxxx` values defined in
the latter can also be used in the former (so as to remove the previous
duplication I had to use)!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 11, 2021

Messages
✔️

PR type: Improvement

Generated by 🚫 dangerJS against f774826

@SlySven SlySven assigned vadi2 and unassigned SlySven Oct 11, 2021
@demonnic
Copy link
Copy Markdown
Member

need to merge development branch back into this PR so it can run the new checks.

…lExitColumnsIn_dlgRoomExits

Needed to pick up the danger.js stuff recently inserted into the CI builds.

Signed-off by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven merged commit c6c99cc into Mudlet:development Oct 13, 2021
@SlySven SlySven deleted the Improve_useConstantsToIndexIntoSpecialExitColumnsIn_dlgRoomExits branch October 13, 2021 11:19
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.

3 participants