-
-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up/refactor InputCompletionPopup #4242
Conversation
Mainly flattening anon namespaces & respecting clang-tidy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
} | ||
} | ||
|
||
void addEmojis(std::vector<CompletionEmote> &out, const EmojiMap &map, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'out' is unused [misc-unused-parameters]
void addEmojis(std::vector<CompletionEmote> &out, const EmojiMap &map, | |
void addEmojis(const EmojiMap &map, |
void InputCompletionPopup::updateEmotes(const QString &text, ChannelPtr channel) | ||
{ | ||
std::vector<_Emote> emotes; | ||
auto tc = dynamic_cast<TwitchChannel *>(channel.get()); | ||
std::vector<CompletionEmote> emotes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'emotes' is not initialized [cppcoreguidelines-init-variables]
std::vector<CompletionEmote> emotes; | |
std::vector<CompletionEmote> emotes = 0; |
std::vector<_Emote> emotes; | ||
auto tc = dynamic_cast<TwitchChannel *>(channel.get()); | ||
std::vector<CompletionEmote> emotes; | ||
auto *tc = dynamic_cast<TwitchChannel *>(channel.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'tc' is not initialized [cppcoreguidelines-init-variables]
auto *tc = dynamic_cast<TwitchChannel *>(channel.get()); | |
auto *tc = nullptr = dynamic_cast<TwitchChannel *>(channel.get()); |
@@ -160,45 +169,68 @@ | |||
|
|||
void InputCompletionPopup::updateUsers(const QString &text, ChannelPtr channel) | |||
{ | |||
auto twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()); | |||
if (twitchChannel) | |||
auto *tc = dynamic_cast<TwitchChannel *>(channel.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'tc' is not initialized [cppcoreguidelines-init-variables]
auto *tc = dynamic_cast<TwitchChannel *>(channel.get()); | |
auto *tc = nullptr = dynamic_cast<TwitchChannel *>(channel.get()); |
{ | ||
this->redrawTimer_.stop(); | ||
} | ||
|
||
void InputCompletionPopup::initLayout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'initLayout' can be made static [readability-convert-member-functions-to-static]
src/widgets/splits/InputCompletionPopup.hpp:33:
- void initLayout();
+ static void initLayout();
auto channel = this->split_->getChannel().get(); | ||
auto tc = dynamic_cast<TwitchChannel *>(channel); | ||
auto *channel = this->split_->getChannel().get(); | ||
auto *tc = dynamic_cast<TwitchChannel *>(channel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'tc' is not initialized [cppcoreguidelines-init-variables]
auto *tc = dynamic_cast<TwitchChannel *>(channel); | |
auto *tc = nullptr = dynamic_cast<TwitchChannel *>(channel); |
assert(popup); | ||
|
||
if (emoteCompletion) // autocomplete emotes | ||
if (emoteCompletion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: if with identical then and else branches [bugprone-branch-clone]
if (emoteCompletion)
^
src/widgets/splits/SplitInput.cpp:761: else branch starts here
else
^
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
Mainly flattening anon namespaces & respecting clang-tidy